commit 90172bd5f8a95394125fb327ee30099485939839 Author: eszense Date: Thu Jan 19 03:26:35 2017 +0800 Proper handle space in install_script absolute path Without this patch, if python.exe path contains space, msi generated with bdist_msi command with --install-script=abc.py will fail with msg: C:\\Program Files\\Python35\\python.exe: can't open file 'C:\\Program': [Error 2] No such file or directory diff --git a/Lib/distutils/command/bdist_msi.py b/Lib/distutils/command/bdist_msi.py index a4bd5a5..33d52ff 100644 --- a/Lib/distutils/command/bdist_msi.py +++ b/Lib/distutils/command/bdist_msi.py @@ -381,7 +381,7 @@ class bdist_msi(Command): install_action = "install_script." + ver exe_prop = "PYTHON" + ver add_data(self.db, "CustomAction", - [(install_action, 50, exe_prop, self.install_script_key)]) + [(install_action, 50, exe_prop, '"' + self.install_script_key + '"')]) add_data(self.db, "InstallExecuteSequence", [(install_action, "&Python%s=3" % ver, start)]) start += 1