diff --git a/aqt/installer.py b/aqt/installer.py index 58ab3a38..011dc69c 100644 --- a/aqt/installer.py +++ b/aqt/installer.py @@ -1591,27 +1591,8 @@ def _get_install_command(self, installer_path: Path) -> list[str]: ) return cmd - def _exec_qt_installer(self, arguments: list[str], working_dir: str) -> None: - """Execute Qt installer with validated arguments.""" - original_cwd = os.getcwd() - os.chdir(working_dir) - try: - if sys.platform == "win32": - os.spawnv(os.P_WAIT, "qt-unified-windows-x64-online.exe", ["qt-unified-windows-x64-online.exe"] + arguments) - else: - pid = os.fork() - if pid == 0: # Child process - if self.os_name == "mac": - os.execv("qt-unified-macOS-x64-online.dmg", ["qt-unified-macOS-x64-online.dmg"] + arguments) - elif self.os_name == "linux": - os.execv("qt-unified-linux-x64-online.run", ["qt-unified-linux-x64-online.run"] + arguments) - sys.exit(1) - else: # Parent process - _, status = os.waitpid(pid, 0) - if status != 0: - raise RuntimeError(f"Qt installation failed with status {status}") - finally: - os.chdir(original_cwd) # Restore original working directory + def _exec_qt_installer(self, cmd: list[str], working_dir: str) -> None: + subprocess.run(cmd, shell=False, check=True, cwd=working_dir) def install(self) -> None: if ( @@ -1646,13 +1627,7 @@ def install(self) -> None: safe_cmd[email_index + 1] = "********" self.logger.info(f"Running: {' '.join(safe_cmd)}") - target_path = temp_path / self.ALLOWED_INSTALLERS[self.os_name] - if installer_path != target_path: - if target_path.exists(): - target_path.unlink() - os.symlink(installer_path, target_path) - - self._exec_qt_installer(cmd[1:], temp_dir) + self._exec_qt_installer(cmd, temp_dir) except subprocess.CalledProcessError as e: self.logger.error(f"Installation failed with exit code {e.returncode}")