diff --git a/localaction.py b/localaction.py index c1b9535..1b2e800 100644 --- a/localaction.py +++ b/localaction.py @@ -53,7 +53,10 @@ def run_exe(path, synchronous=False): '''Launches a given software''' 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 if synchronous: diff --git a/software.py b/software.py index 0879340..6b731b3 100644 --- a/software.py +++ b/software.py @@ -103,6 +103,9 @@ class Software: # execute or unpack # 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) elif local_file.endswith(".zip"): self._extract_to_target(local_file, self.backend.install_dir) @@ -127,6 +130,11 @@ class Software: # run installer if set # if 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) localaction.run_exe(installer_path) @@ -148,4 +156,7 @@ class Software: return if self.run_exe: - localaction.run_exe(os.path.join(self.backend.install_dir, self.title, self.run_exe)) \ No newline at end of file + 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)