Skip to content

Commit 6cf3526

Browse files
Fix launch functionality with platform-specific commands
1 parent 25dcc1b commit 6cf3526

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

installer/main.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import zipfile
66
import requests
77
import threading
8+
import subprocess
89
import customtkinter
910
import CTkMessagebox as messagebox
1011

@@ -74,7 +75,7 @@ def install(path):
7475
)
7576
progress_bar.step()
7677

77-
customtkinter.CTkButton(app, text="Launch", command=launch).grid(
78+
customtkinter.CTkButton(app, text="Launch", command=lambda: launch(path)).grid(
7879
column=0, row=2, columnspan=2, padx=5, pady=5
7980
)
8081

@@ -107,8 +108,13 @@ def uninstall(path):
107108
)
108109

109110

110-
def launch():
111-
os.startfile("steam://rungameid/874390")
111+
def launch(path):
112+
if sys.platform != "win32":
113+
subprocess.check_call(f"chmod +x {path}/run_bepinex.sh", shell=True)
114+
subprocess.check_call(f"{path}/run_bepinex.sh {path}/Polytopia.*", shell=True)
115+
subprocess.check_call(f"xdg-open https://docs.bepinex.dev/articles/advanced/steam_interop.html", shell=True)
116+
else:
117+
subprocess.check_call(f"start steam://rungameid/874390", shell=True)
112118
quit()
113119

114120

0 commit comments

Comments
 (0)