-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlauncher_gui_new.py
57 lines (48 loc) · 1.69 KB
/
launcher_gui_new.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
import requests
import configparser
import time
import os
import platform
import subprocess
import psutil
def clear_screen():
if platform.system() == 'Windows':
os.system('cls')
else:
os.system('clear')
def welcome_screen():
print("======VLDEP======")
def read_config_value(filename, section, key):
with open(filename, 'r') as config_file:
for line in config_file:
if line.strip().startswith(f"[{section}]"):
break
else:
return None
for line in config_file:
if line.strip().startswith(key):
_, value = line.split('=', 1)
return value.strip()
return None
def main():
clear_screen()
welcome_screen()
try:
#config = configparser.ConfigParser()
#config.read('config.ini')
#fse_status = config.get('OTHER', 'fse')
fse_status = read_config_value('config.ini', 'OTHER', 'fse')
if fse_status == "7":
current_directory = os.getcwd()
java_file = os.path.join(current_directory, "assets", "redist", "jdk-21_windows-x64_bin.msi")
subprocess.call(['msiexec', '/i', java_file, '/passive', '/norestart'])
print("Successfully installed Java 21!")
net_file = os.path.join(current_directory, "assets", "redist", "ndp472-kb4054531-web.exe")
subprocess.call(['msiexec', '/i', net_file, '/passive', '/norestart'])
print("Successfully installed .NET Framework 4.7.2")
executable_path = os.path.join(os.getcwd(), "VLLauncher.exe")
subprocess.Popen(executable_path)
except Exception as e:
print(e)
if __name__ == "__main__":
main()