Skip to content

Commit 1d4880d

Browse files
committed
Enables shortcuts to be deselected when installing on Windows.
1 parent 2d0a69a commit 1d4880d

File tree

14 files changed

+100
-64
lines changed

14 files changed

+100
-64
lines changed

Doc/using/windows.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ of available options is shown below.
115115
| | tho :envvar:`PATH` and ``.PY`` to | |
116116
| | :envvar:`PATHEXT` | |
117117
+---------------------------+--------------------------------------+--------------------------+
118+
| Shortcuts | Create shortcuts for the interpreter,| 1 |
119+
| | documentation and IDLE if installed. | |
120+
+---------------------------+--------------------------------------+--------------------------+
118121
| Include_doc | Install Python manual | 1 |
119122
+---------------------------+--------------------------------------+--------------------------+
120123
| Include_debug | Install debug binaries | 0 |

Tools/msi/bundle/Default.thm

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,16 @@
6565

6666
<Checkbox Name="InstallAllUsers" X="185" Y="51" Width="-11" Height="20" TabStop="yes" FontId="3" HideWhenDisabled="no">#(loc.InstallAllUsersLabel)</Checkbox>
6767
<Checkbox Name="AssociateFiles" X="185" Y="76" Width="-11" Height="20" TabStop="yes" FontId="3" HideWhenDisabled="no">#(loc.AssociateFilesLabel)</Checkbox>
68-
<Checkbox Name="PrependPath" X="185" Y="101" Width="-11" Height="20" TabStop="yes" FontId="3" HideWhenDisabled="no">#(loc.PrependPathLabel)</Checkbox>
69-
<Checkbox Name="CompileAll" X="185" Y="126" Width="-11" Height="20" TabStop="yes" FontId="3" HideWhenDisabled="no">#(loc.PrecompileLabel)</Checkbox>
70-
<Checkbox Name="Include_symbols" X="185" Y="151" Width="-11" Height="20" TabStop="yes" FontId="3" HideWhenDisabled="no">#(loc.Include_symbolsLabel)</Checkbox>
71-
<Checkbox Name="Include_debug" X="185" Y="176" Width="-11" Height="20" TabStop="yes" FontId="3" HideWhenDisabled="no">#(loc.Include_debugLabel)</Checkbox>
72-
73-
<Text X="185" Y="221" Width="-11" Height="17" FontId="3">#(loc.CustomLocationLabel)</Text>
74-
<Editbox Name="TargetDir" X="185" Y="237" Width="-91" Height="21" TabStop="yes" FontId="3" FileSystemAutoComplete="yes" />
75-
<Button Name="CustomBrowseButton" X="-11" Y="236" Width="75" Height="23" TabStop="yes" FontId="3">#(loc.CustomBrowseButton)</Button>
76-
<Text Name="CustomBrowseButtonLabel" X="185" Y="261" Width="-91" Height="35" FontId="5" Visible="no">#(loc.CustomLocationHelpLabel)</Text>
68+
<Checkbox Name="Shortcuts" X="185" Y="101" Width="-11" Height="20" TabStop="yes" FontId="3" HideWhenDisabled="no">#(loc.ShortcutsLabel)</Checkbox>
69+
<Checkbox Name="PrependPath" X="185" Y="126" Width="-11" Height="20" TabStop="yes" FontId="3" HideWhenDisabled="no">#(loc.PrependPathLabel)</Checkbox>
70+
<Checkbox Name="CompileAll" X="185" Y="151" Width="-11" Height="20" TabStop="yes" FontId="3" HideWhenDisabled="no">#(loc.PrecompileLabel)</Checkbox>
71+
<Checkbox Name="Include_symbols" X="185" Y="176" Width="-11" Height="20" TabStop="yes" FontId="3" HideWhenDisabled="no">#(loc.Include_symbolsLabel)</Checkbox>
72+
<Checkbox Name="Include_debug" X="185" Y="201" Width="-11" Height="20" TabStop="yes" FontId="3" HideWhenDisabled="no">#(loc.Include_debugLabel)</Checkbox>
73+
74+
<Text X="185" Y="241" Width="-11" Height="17" FontId="3">#(loc.CustomLocationLabel)</Text>
75+
<Editbox Name="TargetDir" X="185" Y="257" Width="-91" Height="21" TabStop="yes" FontId="3" FileSystemAutoComplete="yes" />
76+
<Button Name="CustomBrowseButton" X="-11" Y="256" Width="75" Height="23" TabStop="yes" FontId="3">#(loc.CustomBrowseButton)</Button>
77+
<Text Name="CustomBrowseButtonLabel" X="185" Y="281" Width="-91" Height="35" FontId="5" Visible="no">#(loc.CustomLocationHelpLabel)</Text>
7778

7879
<Button Name="Custom2BackButton" X="185" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.CustomBackButton)</Button>
7980
<Button Name="CustomInstallButton" X="-91" Y="-11" Width="95" Height="23" TabStop="yes" FontId="0">#(loc.CustomInstallButton)</Button>

Tools/msi/bundle/Default.wxl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ Continue?</String>
4242
<String Id="InstallAcceptCheckbox">I &amp;agree to the license terms and conditions</String>
4343
<String Id="InstallJustForMeButton">&amp;Install Now</String>
4444
<String Id="InstallJustForMeButtonNote">[DefaultJustForMeTargetDir]
45-
Includes IDLE and pip
45+
46+
Includes IDLE, pip and documentation
4647
Creates shortcuts and file associations</String>
4748
<String Id="InstallCustomButton">C&amp;ustomize installation</String>
4849
<String Id="InstallCustomButtonNote">Choose location and features</String>
@@ -68,6 +69,7 @@ Creates shortcuts and file associations</String>
6869
<String Id="Include_launcherHelpLabel">Installs the global 'py' launcher to make it easier to start Python.</String>
6970

7071
<String Id="AssociateFilesLabel">Associate &amp;files with Python (requires the py launcher)</String>
72+
<String Id="ShortcutsLabel">Create shortcuts for installed applications</String>
7173
<String Id="PrependPathLabel">Add Python to &amp;environment variables</String>
7274
<String Id="ShortPrependPathLabel">Add &amp;Python [ShortVersion] to PATH</String>
7375
<String Id="InstallAllUsersLabel">Install as &amp;Administrator</String>

Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -746,8 +746,8 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication {
746746
) {
747747
LONGLONG install;
748748

749-
if (wcscmp(wzFeatureId, L"AssociateFiles") == 0) {
750-
if (SUCCEEDED(_engine->GetVariableNumeric(L"AssociateFiles", &install)) && install) {
749+
if (wcscmp(wzFeatureId, L"AssociateFiles") == 0 || wcscmp(wzFeatureId, L"Shortcuts") == 0) {
750+
if (SUCCEEDED(_engine->GetVariableNumeric(wzFeatureId, &install)) && install) {
751751
*pRequestedState = BOOTSTRAPPER_FEATURE_STATE_LOCAL;
752752
} else {
753753
*pRequestedState = BOOTSTRAPPER_FEATURE_STATE_ABSENT;

Tools/msi/bundle/bundle.wxs

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

6060
<Variable Name="AssociateFiles" Value="1" Persisted="yes" bal:Overridable="yes" />
61+
<Variable Name="Shortcuts" Value="1" Persisted="yes" bal:Overridable="yes" />
6162
<Variable Name="PrependPath" Value="0" Persisted="yes" bal:Overridable="yes" />
6263
<Variable Name="CompileAll" Value="1" Persisted="yes" bal:Overridable="yes" />
6364

Tools/msi/bundle/packagegroups/doc.wxs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
SourceFile="doc.msi"
77
Compressed="$(var.CompressMSI)"
88
DownloadUrl="$(var.DownloadUrl)"
9+
EnableFeatureSelection="yes"
910
ForcePerMachine="yes"
1011
InstallCondition="InstallAllUsers and Include_doc">
1112
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
@@ -15,6 +16,7 @@
1516
SourceFile="doc.msi"
1617
Compressed="$(var.CompressMSI)"
1718
DownloadUrl="$(var.DownloadUrl)"
19+
EnableFeatureSelection="yes"
1820
ForcePerMachine="no"
1921
InstallCondition="not InstallAllUsers and Include_doc">
2022
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />

Tools/msi/bundle/packagegroups/exe.wxs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
ForcePerMachine="yes"
88
Compressed="$(var.CompressMSI)"
99
DownloadUrl="$(var.DownloadUrl)"
10+
EnableFeatureSelection="yes"
1011
InstallCondition="InstallAllUsers and (Include_exe or Include_launcher or Include_pip)">
1112
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
1213
</MsiPackage>
@@ -32,6 +33,7 @@
3233
ForcePerMachine="no"
3334
Compressed="$(var.CompressMSI)"
3435
DownloadUrl="$(var.DownloadUrl)"
36+
EnableFeatureSelection="yes"
3537
InstallCondition="not InstallAllUsers and (Include_exe or Include_launcher or Include_pip)">
3638
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
3739
</MsiPackage>

Tools/msi/doc/doc.wxs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@
88
<PropertyRef Id="REGISTRYKEY" />
99

1010
<Feature Id="DefaultFeature" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
11+
<ComponentGroupRef Id="doc" Primary="yes" />
12+
</Feature>
13+
<Feature Id="Shortcuts" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
1114
<ComponentGroupRef Id="doc" />
1215

1316
<?ifdef DocFilename ?>
1417
<Component Id="doc_shortcut" Directory="MenuDir" Guid="*">
15-
<RegistryKey Root="HKMU" Key="[REGISTRYKEY]">
16-
<RegistryValue Key="Help\Main Python Documentation" Type="string" Value="[#python.chm]" KeyPath="yes" />
17-
</RegistryKey>
18+
<RegistryValue Root="HKMU" Key="[REGISTRYKEY]\DocShortcuts" Type="integer" Value="1" KeyPath="yes" />
1819
<Shortcut Id="python.chm"
1920
Target="[#python.chm]"
2021
Name="!(loc.ShortcutName)"

Tools/msi/doc/doc_files.wxs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
<ComponentGroup Id="doc">
77
<Component Id="python.chm" Directory="Doc" Guid="*">
88
<File Id="python.chm" Name="$(var.DocFilename)" KeyPath="yes" />
9+
<RegistryKey Root="HKMU" Key="[REGISTRYKEY]">
10+
<RegistryValue Key="Help\Main Python Documentation" Type="string" Value="[#python.chm]" />
11+
</RegistryKey>
912
</Component>
1013
</ComponentGroup>
1114
</Fragment>

Tools/msi/exe/exe.wxs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,21 @@
88
<PropertyRef Id="REGISTRYKEY" />
99

1010
<Feature Id="DefaultFeature" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
11-
<ComponentGroupRef Id="exe_python" />
11+
<ComponentGroupRef Id="exe_python" Primary="yes" />
1212
<ComponentGroupRef Id="exe_txt" />
1313
<ComponentGroupRef Id="exe_icons" />
14+
</Feature>
1415

16+
<Feature Id="Shortcuts" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
17+
<ComponentGroupRef Id="exe_python" />
1518
<Component Id="exe_shortcut" Directory="MenuDir" Guid="*">
1619
<Shortcut Id="python.exe"
1720
Target="[#python.exe]"
1821
Name="!(loc.ShortcutName)"
1922
Description="!(loc.ShortcutDescription)" />
2023
<RemoveFolder Id="Remove_MenuDir" Directory="MenuDir" On="uninstall" />
2124
<RegistryKey Root="HKMU" Key="[REGISTRYKEY]">
22-
<RegistryValue Key="InstallPath" Type="string" Value="[InstallDirectory]" KeyPath="yes" />
23-
<RegistryValue Key="InstallPath\InstallGroup" Type="string" Value="Python $(var.ShortVersion)" />
25+
<RegistryValue Key="InstallPath\InstallGroup" Type="string" Value="!(loc.ProductName)" KeyPath="yes" />
2426
</RegistryKey>
2527
</Component>
2628
</Feature>

0 commit comments

Comments
 (0)