commit dd061664505a22fa09a1d267cfdc995244961beb Author: eszense Date: Thu Jan 19 20:42:39 2017 +0800 Fix install-script execution for alt python location Without this patch, if install-script specified and alternative python location selected during installation, msiexec will faile with: "There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor." diff --git a/Lib/distutils/command/bdist_msi.py b/Lib/distutils/command/bdist_msi.py index a4bd5a5..9a90fb6 100644 --- a/Lib/distutils/command/bdist_msi.py +++ b/Lib/distutils/command/bdist_msi.py @@ -377,6 +377,17 @@ class bdist_msi(Command): def add_scripts(self): if self.install_script: start = 6800 + + ver = self.other_version + exe_action = "PythonExe" + ver + exe_prop = "PYTHON" + ver + target_dir_prop = "TARGETDIR" + ver + add_data(self.db, "CustomAction", + [(exe_action, 51, exe_prop, "[" + target_dir_prop + "]\\python.exe")]) + add_data(self.db, "InstallExecuteSequence", + [(exe_action, None, start)]) + start += 1 + for ver in self.versions + [self.other_version]: install_action = "install_script." + ver exe_prop = "PYTHON" + ver