| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8cc80f1 commit 2237bdc
13 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -130,6 +130,9 @@ of available options is shown below. | |||
| 130 | 130 | +---------------------------+--------------------------------------+--------------------------+ | |
| 131 | 131 | | Include_launcher | Install :ref:`launcher`. | 1 | | |
| 132 | 132 | +---------------------------+--------------------------------------+--------------------------+ | |
| 133 | + | InstallLauncherAllUsers | Installs :ref:`launcher` for all | 1 | | ||
| 134 | + | | users. | | | ||
| 135 | + +---------------------------+--------------------------------------+--------------------------+ | ||
| 133 | 136 | | Include_lib | Install standard library and | 1 | | |
| 134 | 137 | | | extension modules | | | |
| 135 | 138 | +---------------------------+--------------------------------------+--------------------------+ | |
@@ -145,16 +148,21 @@ of available options is shown below. | |||
| 145 | 148 | +---------------------------+--------------------------------------+--------------------------+ | |
| 146 | 149 | | SimpleInstall | Disable most install UI | 0 | | |
| 147 | 150 | +---------------------------+--------------------------------------+--------------------------+ | |
| 151 | + | SimpleInstallDescription | A custom message to display when the | (empty) | | ||
| 152 | + | | simplified install UI is used. | | | ||
| 153 | + +---------------------------+--------------------------------------+--------------------------+ | ||
| 148 | 154 | ||
| 149 | 155 | For example, to silently install a default, system-wide Python installation, | |
| 150 | 156 | you could use the following command (from an elevated command prompt):: | |
| 151 | 157 | ||
| 152 | 158 | python-3.5.0.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0 | |
| 153 | 159 | ||
| 154 | 160 | To allow users to easily install a personal copy of Python without the test | |
| 155 | - suite, you could provide a shortcut with the following command:: | ||
| 161 | + suite, you could provide a shortcut with the following command. This will | ||
| 162 | + display a simplified initial page and disallow customization:: | ||
| 156 | 163 | ||
| 157 | - python-3.5.0.exe /passive InstallAllUsers=0 Include_launcher=0 Include_test=0 SimpleInstall=1 | ||
| 164 | + python-3.5.0.exe InstallAllUsers=0 Include_launcher=0 Include_test=0 | ||
| 165 | + SimpleInstall=1 SimpleInstallDescription="Just for me, no test suite." | ||
| 158 | 166 | ||
| 159 | 167 | (Note that omitting the launcher also omits file associations, and is only | |
| 160 | 168 | recommended for per-user installs when there is also a system-wide installation | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,12 +6,14 @@ set PCBUILD=%D%..\..\PCBuild\ | |||
| 6 | 6 | set BUILDX86= | |
| 7 | 7 | set BUILDX64= | |
| 8 | 8 | set BUILDDOC= | |
| 9 | + set BUILDPX= | ||
| 9 | 10 | ||
| 10 | 11 | :CheckOpts | |
| 11 | 12 | if "%~1" EQU "-h" goto Help | |
| 12 | 13 | if "%~1" EQU "-x86" (set BUILDX86=1) && shift && goto CheckOpts | |
| 13 | 14 | if "%~1" EQU "-x64" (set BUILDX64=1) && shift && goto CheckOpts | |
| 14 | 15 | if "%~1" EQU "--doc" (set BUILDDOC=1) && shift && goto CheckOpts | |
| 16 | + if "%~1" EQU "--test-marker" (set BUILDPX=1) && shift && goto CheckOpts | ||
| 15 | 17 | ||
| 16 | 18 | if not defined BUILDX86 if not defined BUILDX64 (set BUILDX86=1) && (set BUILDX64=1) | |
| 17 | 19 | ||
@@ -35,22 +37,28 @@ if defined BUILDDOC ( | |||
| 35 | 37 | if errorlevel 1 goto :eof | |
| 36 | 38 | ) | |
| 37 | 39 | ||
| 40 | + set BUILD_CMD="%D%bundle\snapshot.wixproj" | ||
| 41 | + if defined BUILDPX ( | ||
| 42 | + set BUILD_CMD=%BUILD_CMD% /p:UseTestMarker=true | ||
| 43 | + ) | ||
| 44 | + | ||
| 38 | 45 | if defined BUILDX86 ( | |
| 39 | 46 | "%PCBUILD%win32\python.exe" "%D%get_wix.py" | |
| 40 | - msbuild "%D%bundle\snapshot.wixproj" | ||
| 47 | + msbuild %BUILD_CMD% | ||
| 41 | 48 | if errorlevel 1 goto :eof | |
| 42 | 49 | ) | |
| 43 | 50 | if defined BUILDX64 ( | |
| 44 | 51 | "%PCBUILD%amd64\python.exe" "%D%get_wix.py" | |
| 45 | - msbuild "%D%bundle\snapshot.wixproj" /p:Platform=x64 | ||
| 52 | + msbuild /p:Platform=x64 %BUILD_CMD% | ||
| 46 | 53 | if errorlevel 1 goto :eof | |
| 47 | 54 | ) | |
| 48 | 55 | ||
| 49 | 56 | exit /B 0 | |
| 50 | 57 | ||
| 51 | 58 | :Help | |
| 52 | - echo build.bat [-x86] [-x64] [--doc] [-h] | ||
| 59 | + echo build.bat [-x86] [-x64] [--doc] [-h] [--test-marker] | ||
| 53 | 60 | echo. | |
| 54 | 61 | echo -x86 Build x86 installers | |
| 55 | 62 | echo -x64 Build x64 installers | |
| 56 | 63 | echo --doc Build CHM documentation | |
| 64 | + echo --test-marker Build installers with 'x' markers | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,10 +21,11 @@ | |||
| 21 | 21 | ||
| 22 | 22 | <Text X="185" Y="50" Width="-11" Height="50" FontId="3" TabStop="yes">#(loc.InstallMessage)</Text> | |
| 23 | 23 | ||
| 24 | - <Button Name="InstallButton" X="175" Y="101" Width="-11" Height="129" TabStop="yes" FontId="3" HexStyle="0xE">#(loc.InstallButton)</Button> | ||
| 25 | - <Button Name="InstallCustomButton" X="175" Y="241" Width="-11" Height="59" TabStop="yes" FontId="3" HexStyle="0xE">#(loc.InstallCustomButton)</Button> | ||
| 24 | + <Button Name="InstallButton" X="175" Y="101" Width="-11" Height="109" TabStop="yes" FontId="3" HexStyle="0xE">#(loc.InstallButton)</Button> | ||
| 25 | + <Button Name="InstallCustomButton" X="175" Y="221" Width="-11" Height="59" TabStop="yes" FontId="3" HexStyle="0xE">#(loc.InstallCustomButton)</Button> | ||
| 26 | 26 | ||
| 27 | 27 | <Checkbox Name="PrependPath" X="185" Y="-13" Width="-100" Height="20" TabStop="yes" FontId="3">#(loc.ShortPrependPathLabel)</Checkbox> | |
| 28 | + <Checkbox Name="InstallLauncherAllUsers" X="185" Y="-33" Width="-100" Height="20" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.ShortInstallLauncherAllUsersLabel)</Checkbox> | ||
| 28 | 29 | ||
| 29 | 30 | <Button Name="InstallCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.CancelButton)</Button> | |
| 30 | 31 | </Page> | |
@@ -43,7 +44,7 @@ | |||
| 43 | 44 | <Text X="185" Y="11" Width="-11" Height="32" FontId="1" DisablePrefix="yes">#(loc.InstallHeader)</Text> | |
| 44 | 45 | <Image X="0" Y="0" Width="162" Height="352" ImageFile="SideBar.png"/> | |
| 45 | 46 | ||
| 46 | - <Button Name="InstallSimpleButton" X="175" Y="101" Width="-11" Height="59" TabStop="yes" FontId="3" HideWhenDisabled="yes" HexStyle="0xF">#(loc.InstallSimpleButton)</Button> | ||
| 47 | + <Button Name="InstallSimpleButton" X="175" Y="101" Width="-11" Height="129" TabStop="yes" FontId="3" HideWhenDisabled="yes" HexStyle="0xF">#(loc.InstallSimpleButton)</Button> | ||
| 47 | 48 | ||
| 48 | 49 | <Button Name="InstallCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.CancelButton)</Button> | |
| 49 | 50 | </Page> | |
@@ -63,7 +64,8 @@ | |||
| 63 | 64 | <Checkbox Name="Include_test" X="185" Y="186" Width="-11" Height="20" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.Include_testLabel)</Checkbox> | |
| 64 | 65 | <Text X="205" Y="206" Width="-11" Height="20" TabStop="no" FontId="5">#(loc.Include_testHelpLabel)</Text> | |
| 65 | 66 | ||
| 66 | - <Checkbox Name="Include_launcher" X="185" Y="231" Width="-11" Height="20" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.Include_launcherLabel)</Checkbox> | ||
| 67 | + <Checkbox Name="Include_launcher" X="185" Y="231" Width="100" Height="20" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.Include_launcherLabel)</Checkbox> | ||
| 68 | + <Checkbox Name="CustomInstallLauncherAllUsers" X="285" Y="231" Width="-11" Height="20" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.InstallLauncherAllUsersLabel)</Checkbox> | ||
| 67 | 69 | <Text X="205" Y="251" Width="-11" Height="20" TabStop="no" FontId="5">#(loc.Include_launcherHelpLabel)</Text> | |
| 68 | 70 | ||
| 69 | 71 | <Button Name="Custom1BackButton" X="185" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.CustomBackButton)</Button> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -50,7 +50,9 @@ Creates shortcuts and file associations</String> | |||
| 50 | 50 | <String Id="InstallCustomButton">C&ustomize installation</String> | |
| 51 | 51 | <String Id="InstallCustomButtonNote">Choose location and features</String> | |
| 52 | 52 | <String Id="InstallSimpleButton">&Install</String> | |
| 53 | - <String Id="InstallSimpleButtonNote">Uses setting preselected by your administrator</String> | ||
| 53 | + <String Id="InstallSimpleButtonNote">Use settings preselected by your administrator | ||
| 54 | + | ||
| 55 | + [SimpleInstallDescription]</String> | ||
| 54 | 56 | <String Id="InstallUpgradeButton">&Upgrade Now</String> | |
| 55 | 57 | <String Id="InstallUpgradeButtonNote">[TargetDir] | |
| 56 | 58 | ||
@@ -81,7 +83,9 @@ Select Customize to review current options.</String> | |||
| 81 | 83 | <String Id="ShortcutsLabel">Create shortcuts for installed applications</String> | |
| 82 | 84 | <String Id="PrependPathLabel">Add Python to &environment variables</String> | |
| 83 | 85 | <String Id="ShortPrependPathLabel">Add &Python [ShortVersion] to PATH</String> | |
| 84 | - <String Id="InstallAllUsersLabel">Install as &Administrator</String> | ||
| 86 | + <String Id="InstallAllUsersLabel">Install for &all users</String> | ||
| 87 | + <String Id="InstallLauncherAllUsersLabel">for &all users (requires elevation)</String> | ||
| 88 | + <String Id="ShortInstallLauncherAllUsersLabel">Install &launcher for all users (recommended)</String> | ||
| 85 | 89 | <String Id="PrecompileLabel">&Precompile standard library</String> | |
| 86 | 90 | <String Id="Include_symbolsLabel">Install debugging &symbols</String> | |
| 87 | 91 | <String Id="Include_debugLabel">Install debu&g binaries (requires VS 2015 or later)</String> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -87,11 +87,13 @@ enum CONTROL_ID { | |||
| 87 | 87 | ID_INSTALL_UPGRADE_BUTTON, | |
| 88 | 88 | ID_INSTALL_UPGRADE_CUSTOM_BUTTON, | |
| 89 | 89 | ID_INSTALL_CANCEL_BUTTON, | |
| 90 | - | ||
| 90 | + ID_INSTALL_LAUNCHER_ALL_USERS_CHECKBOX, | ||
| 91 | + | ||
| 91 | 92 | // Customize Page | |
| 92 | 93 | ID_TARGETDIR_EDITBOX, | |
| 93 | 94 | ID_CUSTOM_ASSOCIATE_FILES_CHECKBOX, | |
| 94 | 95 | ID_CUSTOM_INSTALL_ALL_USERS_CHECKBOX, | |
| 96 | + ID_CUSTOM_INSTALL_LAUNCHER_ALL_USERS_CHECKBOX, | ||
| 95 | 97 | ID_CUSTOM_COMPILE_ALL_CHECKBOX, | |
| 96 | 98 | ID_CUSTOM_BROWSE_BUTTON, | |
| 97 | 99 | ID_CUSTOM_BROWSE_BUTTON_LABEL, | |
@@ -150,10 +152,12 @@ static THEME_ASSIGN_CONTROL_ID CONTROL_ID_NAMES[] = { | |||
| 150 | 152 | { ID_INSTALL_UPGRADE_BUTTON, L"InstallUpgradeButton" }, | |
| 151 | 153 | { ID_INSTALL_UPGRADE_CUSTOM_BUTTON, L"InstallUpgradeCustomButton" }, | |
| 152 | 154 | { ID_INSTALL_CANCEL_BUTTON, L"InstallCancelButton" }, | |
| 155 | + { ID_INSTALL_LAUNCHER_ALL_USERS_CHECKBOX, L"InstallLauncherAllUsers" }, | ||
| 153 | 156 | ||
| 154 | 157 | { ID_TARGETDIR_EDITBOX, L"TargetDir" }, | |
| 155 | 158 | { ID_CUSTOM_ASSOCIATE_FILES_CHECKBOX, L"AssociateFiles" }, | |
| 156 | 159 | { ID_CUSTOM_INSTALL_ALL_USERS_CHECKBOX, L"InstallAllUsers" }, | |
| 160 | + { ID_CUSTOM_INSTALL_LAUNCHER_ALL_USERS_CHECKBOX, L"CustomInstallLauncherAllUsers" }, | ||
| 157 | 161 | { ID_CUSTOM_COMPILE_ALL_CHECKBOX, L"CompileAll" }, | |
| 158 | 162 | { ID_CUSTOM_BROWSE_BUTTON, L"CustomBrowseButton" }, | |
| 159 | 163 | { ID_CUSTOM_BROWSE_BUTTON_LABEL, L"CustomBrowseButtonLabel" }, | |
@@ -261,10 +265,11 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication { | |||
| 261 | 265 | LPWSTR defaultDir = nullptr; | |
| 262 | 266 | LPWSTR targetDir = nullptr; | |
| 263 | 267 | LONGLONG elevated, crtInstalled, installAllUsers; | |
| 264 | - BOOL checked; | ||
| 268 | + BOOL checked, launcherChecked; | ||
| 265 | 269 | WCHAR wzPath[MAX_PATH] = { }; | |
| 266 | 270 | BROWSEINFOW browseInfo = { }; | |
| 267 | 271 | PIDLIST_ABSOLUTE pidl = nullptr; | |
| 272 | + DWORD pageId; | ||
| 268 | 273 | HRESULT hr = S_OK; | |
| 269 | 274 | ||
| 270 | 275 | switch(id) { | |
@@ -278,7 +283,7 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication { | |||
| 278 | 283 | case ID_INSTALL_BUTTON: | |
| 279 | 284 | SavePageSettings(); | |
| 280 | 285 | ||
| 281 | - if (!QueryElevateForCrtInstall()) { | ||
| 286 | + if (!WillElevate() && !QueryElevateForCrtInstall()) { | ||
| 282 | 287 | break; | |
| 283 | 288 | } | |
| 284 | 289 | ||
@@ -344,18 +349,32 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication { | |||
| 344 | 349 | ReleaseStr(targetDir); | |
| 345 | 350 | } | |
| 346 | 351 | ||
| 347 | - checked = ThemeIsControlChecked(_theme, ID_CUSTOM_INSTALL_ALL_USERS_CHECKBOX); | ||
| 348 | - if (!checked && !QueryElevateForCrtInstall()) { | ||
| 352 | + if (!WillElevate() && !QueryElevateForCrtInstall()) { | ||
| 349 | 353 | break; | |
| 350 | 354 | } | |
| 351 | 355 | ||
| 352 | 356 | OnPlan(_command.action); | |
| 353 | 357 | break; | |
| 354 | 358 | ||
| 359 | + case ID_INSTALL_LAUNCHER_ALL_USERS_CHECKBOX: | ||
| 360 | + checked = ThemeIsControlChecked(_theme, ID_INSTALL_LAUNCHER_ALL_USERS_CHECKBOX); | ||
| 361 | + _engine->SetVariableNumeric(L"InstallLauncherAllUsers", checked); | ||
| 362 | + | ||
| 363 | + ThemeControlElevates(_theme, ID_INSTALL_BUTTON, WillElevate()); | ||
| 364 | + break; | ||
| 365 | + | ||
| 366 | + case ID_CUSTOM_INSTALL_LAUNCHER_ALL_USERS_CHECKBOX: | ||
| 367 | + checked = ThemeIsControlChecked(_theme, ID_CUSTOM_INSTALL_LAUNCHER_ALL_USERS_CHECKBOX); | ||
| 368 | + _engine->SetVariableNumeric(L"InstallLauncherAllUsers", checked); | ||
| 369 | + | ||
| 370 | + ThemeControlElevates(_theme, ID_CUSTOM_INSTALL_BUTTON, WillElevate()); | ||
| 371 | + break; | ||
| 372 | + | ||
| 355 | 373 | case ID_CUSTOM_INSTALL_ALL_USERS_CHECKBOX: | |
| 356 | - hr = BalGetNumericVariable(L"WixBundleElevated", &elevated); | ||
| 357 | 374 | checked = ThemeIsControlChecked(_theme, ID_CUSTOM_INSTALL_ALL_USERS_CHECKBOX); | |
| 358 | - ThemeControlElevates(_theme, ID_CUSTOM_INSTALL_BUTTON, checked && (FAILED(hr) || !elevated)); | ||
| 375 | + _engine->SetVariableNumeric(L"InstallAllUsers", checked); | ||
| 376 | + | ||
| 377 | + ThemeControlElevates(_theme, ID_CUSTOM_INSTALL_BUTTON, WillElevate()); | ||
| 359 | 378 | ThemeControlEnable(_theme, ID_CUSTOM_BROWSE_BUTTON_LABEL, !checked); | |
| 360 | 379 | if (checked) { | |
| 361 | 380 | _engine->SetVariableNumeric(L"CompileAll", 1); | |
@@ -416,6 +435,7 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication { | |||
| 416 | 435 | case ID_MODIFY_BUTTON: | |
| 417 | 436 | // Some variables cannot be modified | |
| 418 | 437 | _engine->SetVariableString(L"InstallAllUsersState", L"disable"); | |
| 438 | + _engine->SetVariableString(L"InstallLauncherAllUsersState", L"disable"); | ||
| 419 | 439 | _engine->SetVariableString(L"TargetDirState", L"disable"); | |
| 420 | 440 | _engine->SetVariableString(L"CustomBrowseButtonState", L"disable"); | |
| 421 | 441 | _modifying = TRUE; | |
@@ -437,35 +457,36 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication { | |||
| 437 | 457 | ||
| 438 | 458 | void InstallPage_Show() { | |
| 439 | 459 | // Ensure the All Users install button has a UAC shield | |
| 440 | - LONGLONG elevated, installAll; | ||
| 441 | - | ||
| 442 | - if (FAILED(BalGetNumericVariable(L"WixBundleElevated", &elevated))) { | ||
| 443 | - elevated = 0; | ||
| 444 | - } | ||
| 460 | + BOOL elevated = WillElevate(); | ||
| 461 | + ThemeControlElevates(_theme, ID_INSTALL_BUTTON, elevated); | ||
| 462 | + ThemeControlElevates(_theme, ID_INSTALL_SIMPLE_BUTTON, elevated); | ||
| 463 | + ThemeControlElevates(_theme, ID_INSTALL_UPGRADE_BUTTON, elevated); | ||
| 464 | + } | ||
| 445 | 465 | ||
| 466 | + void Custom1Page_Show() { | ||
| 467 | + LONGLONG installLauncherAllUsers; | ||
| 446 | 468 | ||
| 447 | - if (SUCCEEDED(BalGetNumericVariable(L"InstallAllUsers", &installAll)) && installAll && !elevated) { | ||
| 448 | - ThemeControlElevates(_theme, ID_INSTALL_BUTTON, TRUE); | ||
| 449 | - ThemeControlElevates(_theme, ID_INSTALL_SIMPLE_BUTTON, TRUE); | ||
| 450 | - ThemeControlElevates(_theme, ID_INSTALL_UPGRADE_BUTTON, TRUE); | ||
| 469 | + if (FAILED(BalGetNumericVariable(L"InstallLauncherAllUsers", &installLauncherAllUsers))) { | ||
| 470 | + installLauncherAllUsers = 0; | ||
| 451 | 471 | } | |
| 452 | - } | ||
| 453 | 472 | ||
| 454 | - void Custom1Page_Show() { | ||
| 473 | + ThemeSendControlMessage(_theme, ID_CUSTOM_INSTALL_LAUNCHER_ALL_USERS_CHECKBOX, BM_SETCHECK, | ||
| 474 | + installLauncherAllUsers ? BST_CHECKED : BST_UNCHECKED, 0); | ||
| 455 | 475 | } | |
| 456 | 476 | ||
| 457 | 477 | void Custom2Page_Show() { | |
| 458 | 478 | HRESULT hr; | |
| 459 | - LONGLONG installAll, elevated, includeLauncher; | ||
| 479 | + LONGLONG installAll, includeLauncher; | ||
| 460 | 480 | ||
| 461 | - if (FAILED(BalGetNumericVariable(L"WixBundleElevated", &elevated))) { | ||
| 462 | - elevated = 0; | ||
| 481 | + if (FAILED(BalGetNumericVariable(L"InstallAllUsers", &installAll))) { | ||
| 482 | + installAll = 0; | ||
| 463 | 483 | } | |
| 464 | - if (SUCCEEDED(BalGetNumericVariable(L"InstallAllUsers", &installAll))) { | ||
| 465 | - ThemeControlElevates(_theme, ID_CUSTOM_INSTALL_BUTTON, installAll && !elevated); | ||
| 484 | + | ||
| 485 | + if (WillElevate()) { | ||
| 486 | + ThemeControlElevates(_theme, ID_CUSTOM_INSTALL_BUTTON, TRUE); | ||
| 466 | 487 | ThemeShowControl(_theme, ID_CUSTOM_BROWSE_BUTTON_LABEL, SW_HIDE); | |
| 467 | 488 | } else { | |
| 468 | - installAll = 0; | ||
| 489 | + ThemeControlElevates(_theme, ID_CUSTOM_INSTALL_BUTTON, FALSE); | ||
| 469 | 490 | ThemeShowControl(_theme, ID_CUSTOM_BROWSE_BUTTON_LABEL, SW_SHOW); | |
| 470 | 491 | } | |
| 471 | 492 | ||
@@ -1839,8 +1860,8 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication { | |||
| 1839 | 1860 | COLORREF fg = fnt->crForeground, bg = fnt->crBackground; | |
| 1840 | 1861 | *brush = fnt->hBackground; | |
| 1841 | 1862 | RemapColor(&fg, &bg, brush); | |
| 1842 | - SetTextColor(hDC, fg); | ||
| 1843 | - SetBkColor(hDC, bg); | ||
| 1863 | + ::SetTextColor(hDC, fg); | ||
| 1864 | + ::SetBkColor(hDC, bg); | ||
| 1844 | 1865 | ||
| 1845 | 1866 | return TRUE; | |
| 1846 | 1867 | } | |
@@ -2080,6 +2101,7 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication { | |||
| 2080 | 2101 | ||
| 2081 | 2102 | for (DWORD i = 0; i < pPage->cControlIndices; ++i) { | |
| 2082 | 2103 | THEME_CONTROL* pControl = _theme->rgControls + pPage->rgdwControlIndices[i]; | |
| 2104 | + BOOL enableControl = TRUE; | ||
| 2083 | 2105 | ||
| 2084 | 2106 | // If this is a named control, try to set its default state. | |
| 2085 | 2107 | if (pControl->sczName && *pControl->sczName) { | |
@@ -2091,7 +2113,7 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication { | |||
| 2091 | 2113 | ||
| 2092 | 2114 | // If the control value isn't set then disable it. | |
| 2093 | 2115 | if (!SUCCEEDED(hr)) { | |
| 2094 | - ThemeControlEnable(_theme, pControl->wId, FALSE); | ||
| 2116 | + enableControl = FALSE; | ||
| 2095 | 2117 | } else { | |
| 2096 | 2118 | ThemeSendControlMessage( | |
| 2097 | 2119 | _theme, | |
@@ -2110,20 +2132,34 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication { | |||
| 2110 | 2132 | LPWSTR controlState = nullptr; | |
| 2111 | 2133 | hr = BalGetStringVariable(controlName, &controlState); | |
| 2112 | 2134 | if (SUCCEEDED(hr) && controlState && *controlState) { | |
| 2135 | + if (controlState[0] == '[') { | ||
| 2136 | + LPWSTR formatted = nullptr; | ||
| 2137 | + if (SUCCEEDED(BalFormatString(controlState, &formatted))) { | ||
| 2138 | + StrFree(controlState); | ||
| 2139 | + controlState = formatted; | ||
| 2140 | + } | ||
| 2141 | + } | ||
| 2142 | + | ||
| 2113 | 2143 | if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, controlState, -1, L"disable", -1)) { | |
| 2114 | 2144 | BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Disable control %ls", pControl->sczName); | |
| 2115 | - ThemeControlEnable(_theme, pControl->wId, FALSE); | ||
| 2145 | + enableControl = FALSE; | ||
| 2116 | 2146 | } else if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, controlState, -1, L"hide", -1)) { | |
| 2117 | 2147 | BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Hide control %ls", pControl->sczName); | |
| 2118 | 2148 | // TODO: This doesn't work | |
| 2119 | 2149 | ThemeShowControl(_theme, pControl->wId, SW_HIDE); | |
| 2150 | + } else { | ||
| 2151 | + // An explicit state can override the lack of a | ||
| 2152 | + // backing variable. | ||
| 2153 | + enableControl = TRUE; | ||
| 2120 | 2154 | } | |
| 2121 | 2155 | } | |
| 2122 | 2156 | StrFree(controlState); | |
| 2123 | 2157 | } | |
| 2124 | 2158 | StrFree(controlName); | |
| 2125 | 2159 | } | |
| 2126 | 2160 | ||
| 2161 | + ThemeControlEnable(_theme, pControl->wId, enableControl); | ||
| 2162 | + | ||
| 2127 | 2163 | // Format the text in each of the new page's controls | |
| 2128 | 2164 | if (pControl->sczText && *pControl->sczText) { | |
| 2129 | 2165 | // If the wix developer is showing a hidden variable | |
@@ -2405,6 +2441,16 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication { | |||
| 2405 | 2441 | } | |
| 2406 | 2442 | } | |
| 2407 | 2443 | ||
| 2444 | + BOOL WillElevate() { | ||
| 2445 | + static BAL_CONDITION WILL_ELEVATE_CONDITION = { | ||
| 2446 | + L"not WixBundleElevated and (InstallAllUsers or (InstallLauncherAllUsers and Include_launcher))", | ||
| 2447 | + L"" | ||
| 2448 | + }; | ||
| 2449 | + BOOL result; | ||
| 2450 | + | ||
| 2451 | + return SUCCEEDED(BalConditionEvaluate(&WILL_ELEVATE_CONDITION, _engine, &result, nullptr)) && result; | ||
| 2452 | + } | ||
| 2453 | + | ||
| 2408 | 2454 | BOOL IsCrtInstalled() { | |
| 2409 | 2455 | if (_crtInstalledToken > 0) { | |
| 2410 | 2456 | return TRUE; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -88,7 +88,7 @@ | |||
| 88 | 88 | ||
| 89 | 89 | <Target Name="BuildLauncher" BeforeTargets="BeforeBuild" Condition="'$(RebuildAll)' != 'false'"> | |
| 90 | 90 | <!-- Build the launcher MSI using Exec rather than MSBuild --> | |
| 91 | - <Exec Command='msbuild ..\launcher\launcher.wixproj /p:Platform=x86 /p:OutputPath="$(BuildPath.TrimEnd(`\`))" /p:OutputSuffix=$(Platform) /p:BuildForRelease=$(BuildForRelease)' | ||
| 91 | + <Exec Command='msbuild ..\launcher\launcher.wixproj /p:Platform=x86 /p:OutputPath="$(BuildPath.TrimEnd(`\`))" /p:OutputSuffix=$(Platform) /p:BuildForRelease=$(BuildForRelease) /p:UseTestMarker=$(UseTestMarker)' | ||
| 92 | 92 | ContinueOnError="false" /> | |
| 93 | 93 | </Target> | |
| 94 | 94 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments