From c218f71db9a1ee68b82057b89c6af27db6b4f097 Mon Sep 17 00:00:00 2001 From: MKLeb Date: Tue, 19 Sep 2023 15:30:48 -0400 Subject: [PATCH] Run the NSIS installer using `start /wait` --- pkg/tests/support/helpers.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/pkg/tests/support/helpers.py b/pkg/tests/support/helpers.py index 91b6bf0fb5e..e0adccd3717 100644 --- a/pkg/tests/support/helpers.py +++ b/pkg/tests/support/helpers.py @@ -392,7 +392,13 @@ class SaltPkgInstall: if pkg.endswith("exe"): # Install the package log.debug("Installing: %s", str(pkg)) - ret = self.proc.run(str(pkg), "/start-minion=0", "/S") + # ret = self.proc.run("start", "/wait", f"\"{str(pkg)} /start-minion=0 /S\"") + batch_file = pathlib.Path(pkg).parent / "install_nsis.cmd" + batch_content = f"start /wait {str(pkg)} /start-minion=0 /S" + with open(batch_file, "w") as fp: + fp.write(batch_content) + # Now run the batch file + ret = self.proc.run("cmd.exe", "/c", str(batch_file)) self._check_retcode(ret) elif pkg.endswith("msi"): # Install the package @@ -672,7 +678,13 @@ class SaltPkgInstall: ret = self.proc.run("cmd.exe", "/c", str(batch_file)) self._check_retcode(ret) else: - ret = self.proc.run(pkg_path, "/start-minion=0", "/S") + # ret = self.proc.run("start", "/wait", f"\"{pkg_path} /start-minion=0 /S\"") + batch_file = pkg_path.parent / "install_nsis.cmd" + batch_content = f"start /wait {str(pkg_path)} /start-minion=0 /S" + with open(batch_file, "w") as fp: + fp.write(batch_content) + # Now run the batch file + ret = self.proc.run("cmd.exe", "/c", str(batch_file)) self._check_retcode(ret) log.debug("Removing installed salt-minion service")