@@ -727,9 +727,13 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication {
727727 BalLog (BOOTSTRAPPER_LOG_LEVEL_ERROR, " Failed to load AssociateFiles state: error code 0x%08X" , hr);
728728 }
729729
730- _engine->SetVariableNumeric (L" Include_launcher" , 1 );
730+ LONGLONG includeLauncher;
731+ if (FAILED (BalGetNumericVariable (L" Include_launcher" , &includeLauncher))
732+ || includeLauncher == -1 ) {
733+ _engine->SetVariableNumeric (L" Include_launcher" , 1 );
734+ _engine->SetVariableNumeric (L" InstallLauncherAllUsers" , fPerMachine ? 1 : 0 );
735+ }
731736 _engine->SetVariableNumeric (L" DetectedOldLauncher" , 1 );
732- _engine->SetVariableNumeric (L" InstallLauncherAllUsers" , fPerMachine ? 1 : 0 );
733737 }
734738 return CheckCanceled () ? IDCANCEL : IDNOACTION;
735739 }
@@ -796,6 +800,12 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication {
796800 }
797801 }
798802
803+ LONGLONG includeLauncher;
804+ if (SUCCEEDED (BalGetNumericVariable (L" Include_launcher" , &includeLauncher))
805+ && includeLauncher != -1 ) {
806+ detectedLauncher = FALSE ;
807+ }
808+
799809 if (detectedLauncher) {
800810 /* When we detect the current version of the launcher. */
801811 _engine->SetVariableNumeric (L" Include_launcher" , 1 );
@@ -819,6 +829,14 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication {
819829 _baFunction->OnDetectComplete ();
820830 }
821831
832+ if (SUCCEEDED (hrStatus)) {
833+ LONGLONG includeLauncher;
834+ if (SUCCEEDED (BalGetNumericVariable (L" Include_launcher" , &includeLauncher))
835+ && includeLauncher == -1 ) {
836+ _engine->SetVariableNumeric (L" Include_launcher" , 1 );
837+ }
838+ }
839+
822840 if (SUCCEEDED (hrStatus)) {
823841 hrStatus = EvaluateConditions ();
824842 }
@@ -1451,6 +1469,10 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication {
14511469 hr = ParseOverridableVariablesFromXml (pixdManifest);
14521470 BalExitOnFailure (hr, " Failed to read overridable variables." );
14531471
1472+ if (_command.action == BOOTSTRAPPER_ACTION_MODIFY) {
1473+ LoadOptionalFeatureStates (_engine);
1474+ }
1475+
14541476 hr = ParseVariablesFromUnattendXml ();
14551477 ExitOnFailure (hr, " Failed to read unattend.ini file." );
14561478
@@ -1478,10 +1500,6 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication {
14781500 hr = UpdateUIStrings (_command.action );
14791501 BalExitOnFailure (hr, " Failed to load UI strings." );
14801502
1481- if (_command.action == BOOTSTRAPPER_ACTION_MODIFY) {
1482- LoadOptionalFeatureStates (_engine);
1483- }
1484-
14851503 GetBundleFileVersion ();
14861504 // don't fail if we couldn't get the version info; best-effort only
14871505 LExit:
0 commit comments