@@ -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
0 commit comments