fix: installer & lnk-runs

This commit is contained in:
2024-05-30 23:31:07 +02:00
parent cb03300eb2
commit c9c70b418c
2 changed files with 16 additions and 2 deletions

View File

@@ -53,7 +53,10 @@ def run_exe(path, synchronous=False):
'''Launches a given software''' '''Launches a given software'''
if os.name != "nt": if os.name != "nt":
subprocess.Popen(["wine64", path], cwd=os.path.dirname(path)) if ".lnk" in path:
subprocess.Popen(["wine64", "start", path])
else:
subprocess.Popen(["wine64", path], cwd=os.path.dirname(path))
return return
if synchronous: if synchronous:

View File

@@ -103,6 +103,9 @@ class Software:
# execute or unpack # # execute or unpack #
if local_file.endswith(".exe"): if local_file.endswith(".exe"):
if os.name != "nt" and not os.path.isabs(local_file):
# need abs path for wine #
local_file = os.path.join(os.getcwd(), local_file)
localaction.run_exe(local_file) localaction.run_exe(local_file)
elif local_file.endswith(".zip"): elif local_file.endswith(".zip"):
self._extract_to_target(local_file, self.backend.install_dir) self._extract_to_target(local_file, self.backend.install_dir)
@@ -127,6 +130,11 @@ class Software:
# run installer if set # # run installer if set #
if self.installer: if self.installer:
installer_path = os.path.join(self.backend.install_dir, self.title, self.installer) installer_path = os.path.join(self.backend.install_dir, self.title, self.installer)
if os.name != "nt" and not os.path.isabs(installer_path):
# need abs path for wine #
installer_path = os.path.join(os.getcwd(), installer_path)
print("Running installer:", installer_path) print("Running installer:", installer_path)
localaction.run_exe(installer_path) localaction.run_exe(installer_path)
@@ -148,4 +156,7 @@ class Software:
return return
if self.run_exe: if self.run_exe:
localaction.run_exe(os.path.join(self.backend.install_dir, self.title, self.run_exe)) if os.name == "nt" or not ".lnk" in self.run_exe:
localaction.run_exe(os.path.join(self.backend.install_dir, self.title, self.run_exe))
else:
localaction.run_exe(self.run_exe)