#  -*- coding: utf-8 -*-
#
# GUI module generated by PAGE version 4.26
#  in conjunction with Tcl version 8.6
#    Jan 04, 2020 05:57:26 PM EST  platform: Windows NT

from time import time, localtime, strftime
import sys
import os

try:
    import Tkinter
except ImportError:
    import tkinter

from tkinter import filedialog
try:
    import ttk
    py3 = False
except ImportError:
    import tkinter.ttk as ttk
    py3 = True


def installError(name, URL, filename):
    def download():
        import webbrowser
        webbrowser.open(URL, autoraise=True)

    def navigate():
        path = filedialog.askopenfilename(
            filetypes=((name, filename), (name, filename)))
        if(os.getenv("path")[-1] != ";"):
            path = ";" + path
        path = path.replace("/", "\\").replace("\\" + filename, "")
        if(len(os.getenv("path") + path) >= 1024):
            info0.configure(
                text="Error: we could not add the file to your path for you. You will have to do this manually.")
        if os.getenv("userprofile") in path:
            if(os.system("setx PATH \"%path%" + path + "\"")):
                print("Failed to do command")
        else:
            if(os.system("setx PATH \"%path%" + path + "\"")):
                print("failed to do command")

    ie = tkinter.Tk(baseName="Missing Software")
    ie.title("Missing Software")
    ie.geometry("438x478")
    ie.minsize(120, 1)
    ie.maxsize(1370, 749)
    ie.resizable(1, 1)
    ie.configure(background="#d9d9d9")
    font11 = "-family {Segoe UI} -size 18 -weight bold"
    font13 = "-family {Segoe UI} -size 16 -weight bold"
    Header = tkinter.Label(ie, text="Software Not Installed")
    Header.place(relx=0.16, rely=0.042, height=61, width=294)
    Header.configure(font=font11, activeforeground="#372fd7", background="#d9d9d9",
                     disabledforeground="#a3a3a3", foreground="#2432d9")
    info0 = tkinter.Label(
        ie, text="Warning: Youre missing {name}. it is a required software to make this tool run. To fix this issue, please follow the instructions below.".format(name=name))
    info0.place(relx=0.16, rely=0.167, height=151, width=294)
    info0.configure(font="-family {Segoe UI} -size 14", background="#ffffff",
                    disabledforeground="#a3a3a3", foreground="#000000", wraplength="294")
    info1 = tkinter.Label(
        ie, text="If you havent already installed this software, please follow the download link.")
    info1.place(relx=0.16, rely=0.523, height=31, width=294)
    info1.configure(background="#eeeeee", disabledforeground="#a3a3a3",
                    foreground="#000000", wraplength="294")
    tor = tkinter.Label(ie, text="Or")
    tor.place(relx=0.457, rely=0.69, height=36, width=40)
    tor.configure(font="-family {Segoe UI} -size 16 -weight bold",
                  background="#d9d9d9", disabledforeground="#a3a3a3", foreground="#29c1dc")
    info2 = tkinter.Label(
        ie, text="If you've already installed the software, please lead us to where it is as we cannot find it.")
    info2.place(relx=0.16, rely=0.774, height=41, width=294)
    info2.configure(background="#eeeeee", wraplength="294",
                    disabledforeground="#a3a3a3", foreground="#000000")
    download = tkinter.Button(
        ie, text="Download {name}".format(name=name), command=download)
    download.place(relx=0.16, rely=0.607, height=34, width=297)
    download.configure(font=font11, activebackground="#ececec", activeforeground="#000000", background="#48d250",
                       disabledforeground="#a3a3a3", foreground="#000000", highlightbackground="#d9d9d9", highlightcolor="black", pady="0")
    navigate = tkinter.Button(
        ie, text="Navigate to {name}".format(name=name), command=navigate)
    navigate.place(relx=0.16, rely=0.879, height=34, width=297)
    navigate.configure(font=font13, activebackground="#ececec", activeforeground="#000000", background="#eaecec",
                       disabledforeground="#a3a3a3", foreground="#000000", highlightbackground="#d9d9d9", highlightcolor="black", pady="0")

    ie.mainloop()
    os.sys.exit()


installError("tesseract", "https://google.com", "tesseract.exe")

#  -*- coding: utf-8 -*-
#
# GUI module generated by PAGE version 4.26
#  in conjunction with Tcl version 8.6
#    Jan 04, 2020 05:57:26 PM EST  platform: Windows NT

from time import time, localtime, strftime
import sys
import os

try:
    import Tkinter
except ImportError:
    import tkinter

from tkinter import filedialog
try:
    import ttk
    py3 = False
except ImportError:
    import tkinter.ttk as ttk
    py3 = True


def installError(name, URL, filename):
    def download():
        import webbrowser
        webbrowser.open(URL, autoraise=True)

    def navigate():
        path = filedialog.askopenfilename(
            filetypes=((name, filename), (name, filename)))
        if(os.getenv("path")[-1] != ";"):
            path = ";" + path
        path = path.replace("/", "\\").replace("\\" + filename, "")
        if(len(os.getenv("path") + path) >= 1024):
            info0.configure(
                text="Error: we could not add the file to your path for you. You will have to do this manually.")
        if os.getenv("userprofile") in path:
            if(os.system("setx PATH \"%path%" + path + "\"")):
                print("Failed to do command")
        else:
            if(os.system("setx PATH \"%path%" + path + "\"")):
                print("failed to do command")

    ie = tkinter.Tk(baseName="Missing Software")
    ie.title("Missing Software")
    ie.geometry("438x478")
    ie.minsize(120, 1)
    ie.maxsize(1370, 749)
    ie.resizable(1, 1)
    ie.configure(background="#d9d9d9")
    font11 = "-family {Segoe UI} -size 18 -weight bold"
    font13 = "-family {Segoe UI} -size 16 -weight bold"
    Header = tkinter.Label(ie, text="Software Not Installed")
    Header.place(relx=0.16, rely=0.042, height=61, width=294)
    Header.configure(font=font11, activeforeground="#372fd7", background="#d9d9d9",
                     disabledforeground="#a3a3a3", foreground="#2432d9")
    info0 = tkinter.Label(
        ie, text="Warning: Youre missing {name}. it is a required software to make this tool run. To fix this issue, please follow the instructions below.".format(name=name))
    info0.place(relx=0.16, rely=0.167, height=151, width=294)
    info0.configure(font="-family {Segoe UI} -size 14", background="#ffffff",
                    disabledforeground="#a3a3a3", foreground="#000000", wraplength="294")
    info1 = tkinter.Label(
        ie, text="If you havent already installed this software, please follow the download link.")
    info1.place(relx=0.16, rely=0.523, height=31, width=294)
    info1.configure(background="#eeeeee", disabledforeground="#a3a3a3",
                    foreground="#000000", wraplength="294")
    tor = tkinter.Label(ie, text="Or")
    tor.place(relx=0.457, rely=0.69, height=36, width=40)
    tor.configure(font="-family {Segoe UI} -size 16 -weight bold",
                  background="#d9d9d9", disabledforeground="#a3a3a3", foreground="#29c1dc")
    info2 = tkinter.Label(
        ie, text="If you've already installed the software, please lead us to where it is as we cannot find it.")
    info2.place(relx=0.16, rely=0.774, height=41, width=294)
    info2.configure(background="#eeeeee", wraplength="294",
                    disabledforeground="#a3a3a3", foreground="#000000")
    download = tkinter.Button(
        ie, text="Download {name}".format(name=name), command=download)
    download.place(relx=0.16, rely=0.607, height=34, width=297)
    download.configure(font=font11, activebackground="#ececec", activeforeground="#000000", background="#48d250",
                       disabledforeground="#a3a3a3", foreground="#000000", highlightbackground="#d9d9d9", highlightcolor="black", pady="0")
    navigate = tkinter.Button(
        ie, text="Navigate to {name}".format(name=name), command=navigate)
    navigate.place(relx=0.16, rely=0.879, height=34, width=297)
    navigate.configure(font=font13, activebackground="#ececec", activeforeground="#000000", background="#eaecec",
                       disabledforeground="#a3a3a3", foreground="#000000", highlightbackground="#d9d9d9", highlightcolor="black", pady="0")

    ie.mainloop()
    os.sys.exit()


installError("tesseract", "https://google.com", "tesseract.exe")

#  -*- coding: utf-8 -*- # # GUI module generated by PAGE version 4.26 #  in conjunction with Tcl version 8.6 #    Jan 04, 2020 05:57:26 PM EST  platform: Windows NT