[Python-checkins] cpython (merge 3.5 -> 3.5): Merge from 3.5.0

steve.dower python-checkins at python.org
Fri Sep 11 20:31:46 CEST 2015


https://hg.python.org/cpython/rev/7cb5d8133d00
changeset:   97924:7cb5d8133d00
branch:      3.5
parent:      97921:33925c19516e
parent:      97923:da8f2767b6cc
user:        Steve Dower <steve.dower at microsoft.com>
date:        Fri Sep 11 11:27:45 2015 -0700
summary:
  Merge from 3.5.0

files:
  Misc/NEWS                                                    |   5 +
  Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp |  30 ++++++++++
  2 files changed, 35 insertions(+), 0 deletions(-)


diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -104,6 +104,11 @@
 
 - Issue #25022: Removed very outdated PC/example_nt/ directory.
 
+Build
+-----
+
+- Issue #25071: Windows installer should not require TargetDir
+  parameter when installing quietly
 
 What's New in Python 3.5.0 release candidate 4?
 ===============================================
diff --git a/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp b/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp
--- a/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp
+++ b/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp
@@ -723,6 +723,36 @@
             hrStatus = EvaluateConditions();
         }
 
+        if (SUCCEEDED(hrStatus)) {
+            // Ensure the default path has been set
+            LONGLONG installAll;
+            LPWSTR targetDir = nullptr;
+            LPWSTR defaultTargetDir = nullptr;
+
+            hrStatus = BalGetStringVariable(L"TargetDir", &targetDir);
+            if (FAILED(hrStatus) || !targetDir || !targetDir[0]) {
+                ReleaseStr(targetDir);
+                targetDir = nullptr;
+
+                if (FAILED(BalGetNumericVariable(L"InstallAllUsers", &installAll))) {
+                    installAll = 0;
+                }
+
+                hrStatus = BalGetStringVariable(
+                    installAll ? L"DefaultAllUsersTargetDir" : L"DefaultJustForMeTargetDir",
+                    &defaultTargetDir
+                );
+
+                if (SUCCEEDED(hrStatus) && defaultTargetDir) {
+                    if (defaultTargetDir[0] && SUCCEEDED(BalFormatString(defaultTargetDir, &targetDir))) {
+                        hrStatus = _engine->SetVariableString(L"TargetDir", targetDir);
+                        ReleaseStr(targetDir);
+                    }
+                    ReleaseStr(defaultTargetDir);
+                }
+            }
+        }
+
         SetState(PYBA_STATE_DETECTED, hrStatus);
 
         // If we're not interacting with the user or we're doing a layout or we're just after a force restart

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


More information about the Python-checkins mailing list