Skip to content

Commit e904770

Browse files
committed
enabled exception printing on cli
1 parent f6c88d7 commit e904770

File tree

1 file changed

+39
-32
lines changed

1 file changed

+39
-32
lines changed

srxdbepinexinstaller.py

Lines changed: 39 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,40 +5,47 @@
55
from modules.installer import Installer
66
from modules.args import ArgsUtils
77

8-
# Init Arg Vars
9-
uninstall = False
10-
# Parse Args
11-
argsutils = ArgsUtils()
12-
for index, arg in enumerate(argsutils.getArgs()):
13-
if arg == "uninstall":
14-
uninstall = True
15-
16-
# Init Steam Module
17-
print("Getting Steam Info...")
18-
steamutils = SteamUtils()
19-
if(steamutils.gameDirectory == ""):
20-
steamutils.inputPathIfEmpty()
21-
print(f"Found Game Path: {steamutils.gameDirectory}")
22-
23-
# Init Installer Module
24-
installer = Installer(steamutils.gameDirectory)
25-
26-
if (uninstall):
8+
def main():
9+
# Init Arg Vars
10+
uninstall = False
11+
# Parse Args
12+
argsutils = ArgsUtils()
13+
for index, arg in enumerate(argsutils.getArgs()):
14+
if arg == "uninstall":
15+
uninstall = True
16+
17+
# Init Steam Module
18+
print("Getting Steam Info...")
19+
steamutils = SteamUtils()
2720
if(steamutils.gameDirectory == ""):
2821
steamutils.inputPathIfEmpty()
29-
installer.uninstall()
22+
print(f"Found Game Path: {steamutils.gameDirectory}")
23+
24+
# Init Installer Module
25+
installer = Installer(steamutils.gameDirectory)
26+
27+
if (uninstall):
28+
if(steamutils.gameDirectory == ""):
29+
steamutils.inputPathIfEmpty()
30+
installer.uninstall()
31+
32+
# Do rest of work:
33+
else:
34+
# Init BepInEx Webpage
35+
print("\nGetting Info from BepInEx Bleeding Edge Website...")
36+
bepinutils = BepInExUtils()
37+
38+
# Get Download URL
39+
url = bepinutils.downloadURLs[bepinutils.downloadVersions.index("353")]
40+
print(f"Found BepInExURL: {url}")
41+
42+
# Run installer
43+
installer.install(bepinUrl=url)
44+
try:
45+
main()
46+
except Exception as e:
47+
print(f'Exception: "{e}"')
48+
input("Press any Key to Close...")
3049

31-
# Do rest of work:
32-
else:
33-
# Init BepInEx Webpage
34-
print("\nGetting Info from BepInEx Bleeding Edge Website...")
35-
bepinutils = BepInExUtils()
36-
37-
# Get Download URL
38-
url = bepinutils.downloadURLs[bepinutils.downloadVersions.index("353")]
39-
print(f"Found BepInExURL: {url}")
40-
41-
# Run installer
42-
installer.install(bepinUrl=url)
4350

4451

0 commit comments

Comments
 (0)