Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8ffe4fd

Browse files
committed
Only detects features from previous version when a bundle is found.
Otherwise, stray registry entries would cause issues. Also fixes an accelerator collision and improves UAC icons when upgrading.
1 parent b966981 commit 8ffe4fd

3 files changed

Lines changed: 16 additions & 3 deletions

File tree

Tools/msi/bundle/Default.wxl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Creates shortcuts and file associations</String>
5252
<String Id="InstallSimpleButtonNote">Use settings preselected by your administrator
5353

5454
[SimpleInstallDescription]</String>
55-
<String Id="InstallUpgradeButton">&amp;Upgrade Now</String>
55+
<String Id="InstallUpgradeButton">Up&amp;grade Now</String>
5656
<String Id="InstallUpgradeButtonNote">[TargetDir]
5757

5858
Replaces your existing installation without changing settings.

Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,8 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication {
674674
hr
675675
);
676676
}
677+
678+
LoadOptionalFeatureStates(_engine);
677679
} else if (BOOTSTRAPPER_RELATED_OPERATION_NONE == operation) {
678680
if (_command.action == BOOTSTRAPPER_ACTION_INSTALL) {
679681
LOC_STRING *pLocString = nullptr;
@@ -2556,7 +2558,14 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication {
25562558

25572559
BOOL WillElevate() {
25582560
static BAL_CONDITION WILL_ELEVATE_CONDITION = {
2559-
L"not WixBundleElevated and (InstallAllUsers or (InstallLauncherAllUsers and Include_launcher))",
2561+
L"not WixBundleElevated and ("
2562+
/*Elevate when installing for all users*/
2563+
L"InstallAllUsers or"
2564+
/*Elevate when installing the launcher for all users and it was not detected*/
2565+
L"(InstallLauncherAllUsers and Include_launcher and not DetectedLauncher) or"
2566+
/*Elevate when the launcher was installed for all users and it is being removed*/
2567+
L"(DetectedLauncher and DetectedLauncherAllUsers and not Include_launcher)"
2568+
L")",
25602569
L""
25612570
};
25622571
BOOL result;
@@ -2884,6 +2893,10 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication {
28842893
pEngine->SetVariableNumeric(L"Include_launcher", 0);
28852894
} else if (res == ERROR_SUCCESS) {
28862895
pEngine->SetVariableNumeric(L"Include_launcher", 1);
2896+
pEngine->SetVariableNumeric(L"DetectedLauncher", 1);
2897+
pEngine->SetVariableNumeric(L"InstallLauncherAllUsers", (hkHive == HKEY_LOCAL_MACHINE) ? 1 : 0);
2898+
pEngine->SetVariableNumeric(L"DetectedLauncherAllUsers", (hkHive == HKEY_LOCAL_MACHINE) ? 1 : 0);
2899+
pEngine->SetVariableString(L"InstallLauncherAllUsersState", L"disable");
28872900
}
28882901

28892902
res = RegQueryValueExW(hKey, L"AssociateFiles", nullptr, nullptr, nullptr, nullptr);
@@ -3101,7 +3114,6 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication {
31013114
_hBAFModule = nullptr;
31023115
_baFunction = nullptr;
31033116

3104-
LoadOptionalFeatureStates(pEngine);
31053117
EnsureTargetDir();
31063118
}
31073119

Tools/msi/bundle/bundle.wxs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
<Variable Name="Include_debug" Value="0" bal:Overridable="yes" />
6666

6767
<Variable Name="LauncherOnly" Value="0" bal:Overridable="yes" />
68+
<Variable Name="DetectedLauncher" Value="0" />
6869

6970
<Variable Name="AssociateFiles" Value="1" bal:Overridable="yes" />
7071
<Variable Name="Shortcuts" Value="1" bal:Overridable="yes" />

0 commit comments

Comments
 (0)