diff options
| author | Steve Dower <steve.dower@microsoft.com> | 2015-09-11 18:31:07 (GMT) |
|---|---|---|
| committer | Steve Dower <steve.dower@microsoft.com> | 2015-09-11 18:31:07 (GMT) |
| commit | a004c54f9481f41ac846302159d103fe611f7761 (patch) | |
| tree | de93747bf9e16d1832b197fbf612dc108102aa23 | |
| parent | 4d31570837a63328397ff193d7223bbf500f68b4 (diff) | |
| parent | 729aa1462a13c778b3181cf1c784afc1609f89d7 (diff) | |
| download | cpython-a004c54f9481f41ac846302159d103fe611f7761.zip cpython-a004c54f9481f41ac846302159d103fe611f7761.tar.gz cpython-a004c54f9481f41ac846302159d103fe611f7761.tar.bz2 | |
Issue #25071: Windows installer should not require TargetDir parameter when installing quietly
| -rw-r--r-- | Misc/NEWS | 16 | ||||
| -rw-r--r-- | Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp | 30 |
2 files changed, 46 insertions, 0 deletions
@@ -189,6 +189,22 @@ Build when external libraries are not available. +Windows +------- + +- Issue #25022: Removed very outdated PC/example_nt/ directory. + +What's New in Python 3.5.0 final? +================================= + +Release date: 2015-09-13 + +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 index 416f2d5..35ed2fe 100644 --- a/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp +++ b/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp @@ -723,6 +723,36 @@ public: // IBootstrapperApplication 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 |
