From: Steve Dower Date: Thu, 1 Sep 2016 18:21:56 +0000 (-0700) Subject: Issue #27888: Prevent Windows installer from displaying console windows and failing... X-Git-Tag: v2.7.13rc1~187 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0ca4b6f5a62ecf75f80a2d8497b30464acfb205e;p=python Issue #27888: Prevent Windows installer from displaying console windows and failing when pip cannot be installed/uninstalled. --- diff --git a/.hgeol b/.hgeol index 1688634699..08be82829f 100644 --- a/.hgeol +++ b/.hgeol @@ -14,6 +14,7 @@ **.aiff = BIN **.au = BIN **.bmp = BIN +**.blob = BIN **.db = BIN **.exe = BIN **.icns = BIN diff --git a/Misc/NEWS b/Misc/NEWS index 2701c7b88b..aeccb5478f 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -131,6 +131,11 @@ Build - Issue #10910: Avoid C++ compilation errors on FreeBSD and OS X. Also update FreedBSD version checks for the original ctype UTF-8 workaround. +Windows +------- + +- Issue #27888: Prevent Windows installer from displaying console windows and + failing when pip cannot be installed/uninstalled. What's New in Python 2.7.12? ============================ diff --git a/Tools/msi/WixCA.blob b/Tools/msi/WixCA.blob new file mode 100644 index 0000000000..171d3094ef Binary files /dev/null and b/Tools/msi/WixCA.blob differ diff --git a/Tools/msi/msi.py b/Tools/msi/msi.py index 3ef4a6519e..1c2fdfaa61 100644 --- a/Tools/msi/msi.py +++ b/Tools/msi/msi.py @@ -376,6 +376,7 @@ def add_ui(db): # the installed/uninstalled state according to both the # Extensions and TclTk features. add_data(db, "Binary", [("Script", msilib.Binary("msisupport.dll"))]) + add_data(db, "Binary", [("WixCA", msilib.Binary("WixCA.blob"))]) # See "Custom Action Type 1" if msilib.Win64: CheckDir = "CheckDir" @@ -407,10 +408,11 @@ def add_ui(db): ("VerdanaRed9", "Verdana", 9, 255, 0), ]) - compileargs = r'-Wi "[TARGETDIR]Lib\compileall.py" -f -x "bad_coding|badsyntax|site-packages|py3_" "[TARGETDIR]Lib"' - lib2to3args = r'-c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"' - updatepipargs = r'-m ensurepip -U --default-pip' - removepipargs = r'-B -m ensurepip._uninstall' + compileargs = r'"[#python.exe]" -Wi "[TARGETDIR]Lib\compileall.py" -f -x "bad_coding|badsyntax|site-packages|py3_" "[TARGETDIR]Lib"' + compileoargs = r'"[#python.exe]" -O -Wi "[TARGETDIR]Lib\compileall.py" -f -x "bad_coding|badsyntax|site-packages|py3_" "[TARGETDIR]Lib"' + lib2to3args = r'"[#python.exe]" -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"' + updatepipargs = r'"[#python.exe]" -m ensurepip -U --default-pip' + removepipargs = r'"[#python.exe]" -B -m ensurepip._uninstall' # See "CustomAction Table" add_data(db, "CustomAction", [ # msidbCustomActionTypeFirstSequence + msidbCustomActionTypeTextData + msidbCustomActionTypeProperty @@ -424,11 +426,16 @@ def add_ui(db): # See "Custom Action Type 18" # msidbCustomActionTypeInScript (1024); run during actual installation # msidbCustomActionTypeNoImpersonate (2048); run action in system account, not user account - ("CompilePyc", 18+1024+2048, "python.exe", compileargs), - ("CompilePyo", 18+1024+2048, "python.exe", "-O "+compileargs), - ("CompileGrammar", 18+1024+2048, "python.exe", lib2to3args), - ("UpdatePip", 18+1024+2048, "python.exe", updatepipargs), - ("RemovePip", 18+1024+2048, "python.exe", removepipargs), + ("SetCompilePycCommandLine", 51, "CompilePyc", compileargs), + ("SetCompilePyoCommandLine", 51, "CompilePyo", compileoargs), + ("SetCompileGrammarCommandLine", 51, "CompileGrammar", lib2to3args), + ("CompilePyc", 1+64+1024, "WixCA", "CAQuietExec"), + ("CompilePyo", 1+64+1024, "WixCA", "CAQuietExec"), + ("CompileGrammar", 1+64+1024, "WixCA", "CAQuietExec"), + ("SetUpdatePipCommandLine", 51, "UpdatePip", updatepipargs), + ("UpdatePip", 1+64+1024, "WixCA", "CAQuietExec"), + ("SetRemovePipCommandLine", 51, "RemovePip", removepipargs), + ("RemovePip", 1+64+1024, "WixCA", "CAQuietExec"), ]) # UI Sequences, see "InstallUISequence Table", "Using a Sequence Table" @@ -460,15 +467,20 @@ def add_ui(db): ("SetDLLDirToSystem32", 'DLLDIR="" and ' + sys32cond, 751), ("SetDLLDirToTarget", 'DLLDIR="" and not ' + sys32cond, 752), ("UpdateEditIDLE", None, 1050), - # run command if install state of pip changes to INSTALLSTATE_LOCAL - # run after InstallFiles - ("UpdatePip", "&pip_feature=3", 4001), # remove pip when state changes to INSTALLSTATE_ABSENT # run before RemoveFiles - ("RemovePip", "&pip_feature=2", 3499), - ("CompilePyc", "COMPILEALL", 4002), - ("CompilePyo", "COMPILEALL", 4003), - ("CompileGrammar", "COMPILEALL", 4004), + ("SetRemovePipCommandLine", "&pip_feature=2 and !pip_feature=3", 3498), + ("RemovePip", "RemovePip", 3499), + # run command if install state of pip changes to INSTALLSTATE_LOCAL + # run after InstallFiles + ("SetUpdatePipCommandLine", "&pip_feature=3 and not !pip_feature=3", 4001), + ("UpdatePip", "UpdatePip", 4002), + ("SetCompilePycCommandLine", "COMPILEALL", 4003), + ("SetCompilePyoCommandLine", "COMPILEALL", 4004), + ("SetCompileGrammarCommandLine", "COMPILEALL", 4005), + ("CompilePyc", "CompilePyc", 4006), + ("CompilePyo", "CompilePyo", 4007), + ("CompileGrammar", "CompileGrammar", 4008), ]) add_data(db, "AdminExecuteSequence", [("InitialTargetDir", 'TARGETDIR=""', 750),