[Python-checkins] cpython (2.7): Issue #27888: Prevent Windows installer from displaying console windows and

steve.dower python-checkins at python.org
Thu Sep 1 14:25:47 EDT 2016


https://hg.python.org/cpython/rev/e065aec0e6fa
changeset:   102986:e065aec0e6fa
branch:      2.7
parent:      102981:bf0cb86c6219
user:        Steve Dower <steve.dower at microsoft.com>
date:        Thu Sep 01 11:21:56 2016 -0700
summary:
  Issue #27888: Prevent Windows installer from displaying console windows and failing when pip cannot be installed/uninstalled.

files:
  .hgeol               |    1 +
  Misc/NEWS            |    5 +++
  Tools/msi/WixCA.blob |  Bin 
  Tools/msi/msi.py     |   44 +++++++++++++++++++-----------
  4 files changed, 34 insertions(+), 16 deletions(-)


diff --git a/.hgeol b/.hgeol
--- 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
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -131,6 +131,11 @@
 - 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 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..171d3094effbba5f86f60da0ed00791d0cc87025
GIT binary patch
[stripped]
diff --git a/Tools/msi/msi.py b/Tools/msi/msi.py
--- a/Tools/msi/msi.py
+++ b/Tools/msi/msi.py
@@ -376,6 +376,7 @@
     # 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 @@
               ("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 @@
         # 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 @@
              ("SetDLLDirToSystem32", 'DLLDIR="" and ' + sys32cond, 751),
              ("SetDLLDirToTarget", 'DLLDIR="" and not ' + sys32cond, 752),
              ("UpdateEditIDLE", None, 1050),
+             # remove pip when state changes to INSTALLSTATE_ABSENT
+             # run before RemoveFiles
+             ("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
-             ("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),
+             ("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),

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list