-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
58 lines (48 loc) · 2.11 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import os
import tkinter as tk
from tkinter import messagebox
# Change the background color to a cool color
BACKGROUND_COLOR = "#13294b"
class Installer:
def __init__(self):
self.root = tk.Tk()
self.root.geometry("400x300")
self.root.title("2018cord")
self.root.configure(bg=BACKGROUND_COLOR)
self.create_ui()
self.root.mainloop()
def create_ui(self):
# Create the install button
self.install_button = tk.Button(self.root, text="Install", bg="#61c7d8", command=self.install)
self.install_button.pack(pady=30)
# Create the uninstall button
self.uninstall_button = tk.Button(self.root, text="Uninstall", bg="#e84c3d", command=self.uninstall)
self.uninstall_button.pack(pady=30)
def install(self):
# Show loading screen while installing
self.loading_screen = tk.Toplevel(self.root)
self.loading_screen.title("Loading...")
self.loading_screen.geometry("150x150")
self.loading_screen.configure(bg=BACKGROUND_COLOR)
# Show message and destroy loading screen after 2 seconds
message = tk.Label(self.loading_screen, text="Installing...")
message.pack(pady=20)
os.system(
"CssInstaller\\Injector.exe --css template.css"
)
self.root.after(2000, lambda: [self.loading_screen.destroy(), messagebox.showinfo("2018cord", "Installation completed!")])
def uninstall(self):
# Show loading screen while uninstalling
self.loading_screen = tk.Toplevel(self.root)
self.loading_screen.title("Loading...")
self.loading_screen.geometry("150x150")
self.loading_screen.configure(bg=BACKGROUND_COLOR)
# Show message and destroy loading screen after 2 seconds
message = tk.Label(self.loading_screen, text="Uninstalling...")
message.pack(pady=20)
os.system(
"CssInstaller\\Injector.exe --revert"
)
self.root.after(2000, lambda: [self.loading_screen.destroy(), messagebox.showinfo("2018cord", "Uninstallation completed!")])
# Create and run the installer
Installer()