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

Skip to content

Commit 102f72c

Browse files
committed
Adds pydoc shortcut, Edit with IDLE menu, moves redist folder into externals and fixes test script.
1 parent fef9c1b commit 102f72c

8 files changed

Lines changed: 94 additions & 31 deletions

File tree

Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,8 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication {
742742
} else {
743743
*pRequestedState = BOOTSTRAPPER_FEATURE_STATE_ABSENT;
744744
}
745+
} else {
746+
*pRequestedState = BOOTSTRAPPER_FEATURE_STATE_LOCAL;
745747
}
746748
return CheckCanceled() ? IDCANCEL : IDNOACTION;
747749
}

Tools/msi/common.wxs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
<?if $(var.UpgradeCode)!=$(var.CoreUpgradeCode) ?>
1616
<Upgrade Id="$(var.CoreUpgradeCode)">
17-
<UpgradeVersion Property="MISSING_CORE" Minimum="$(var.Version)" Maximum="$(var.Version)" OnlyDetect="yes" />
17+
<UpgradeVersion Property="MISSING_CORE" Minimum="$(var.Version)" IncludeMinimum="yes" Maximum="$(var.Version)" IncludeMaximum="yes" OnlyDetect="yes" />
1818
</Upgrade>
1919
<?endif ?>
2020

Tools/msi/doc/doc_en-US.wxl_template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">
33
<String Id="ShortDescriptor">doc</String>
44
<String Id="Descriptor">Documentation</String>
5-
<String Id="ShortcutName">Python {{ShortVersion}} {{Bitness}} Manuals</String>
5+
<String Id="ShortcutName">Python {{ShortVersion}} Manuals ({{Bitness}})</String>
66
<String Id="ShortcutDescription">View the !(loc.ProductName) documentation.</String>
77
</WixLocalization>

Tools/msi/msi.props

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@
4949
<OutputPath Condition="!HasTrailingSlash($(OutputPath))">$(OutputPath)\</OutputPath>
5050
<OutDir>$(OutputPath)</OutDir>
5151
<ReuseCabinetCache>true</ReuseCabinetCache>
52-
<CRTRedist Condition="">$([System.IO.Path]::GetFullPath(`$(VS140COMNTOOLS)\..\..\VC\redist\$(Platform)\Microsoft.VC140.CRT`))</CRTRedist>
53-
<CRTRedist Condition="'$(CRTRedist)' != '' and !Exists($(CRTRedist))">$(MSBuildThisFileDirectory)\redist\$(Platform)</CRTRedist>
54-
<CRTRedist Condition="'$(CRTRedist)' != '' and !Exists($(CRTRedist))"></CRTRedist>
52+
<CRTRedist Condition="'$(CRTRedist)' == ''">$(ExternalsDir)\redist</CRTRedist>
53+
<CRTRedist Condition="!Exists($(CRTRedist))"></CRTRedist>
54+
<DocFilename>python$(MajorVersionNumber)$(MinorVersionNumber)$(MicroVersionNumber)$(ReleaseLevelName).chm</DocFilename>
5555

5656
<RevisionNumber>$(ReleaseLevelNumber)</RevisionNumber>
5757
<RevisionNumber Condition="!$(BuildForRelease)">$([System.Math]::Floor($([System.DateTime]::Now.Subtract($([System.DateTime]::new(2001, 1, 1))).TotalDays)))</RevisionNumber>
@@ -69,6 +69,7 @@
6969
MinorVersionNumber=$(MinorVersionNumber);
7070
UpgradeMinimumVersion=$(MajorVersionNumber).$(MinorVersionNumber).0.0;
7171
NextMajorVersionNumber=$(MajorVersionNumber).$([msbuild]::Add($(MinorVersionNumber), 1)).0.0;
72+
Bitness=$(Bitness);
7273
PyDebugExt=$(PyDebugExt);
7374
</DefineConstants>
7475
<DefineConstants Condition="'$(CRTRedist)' != ''">
@@ -109,11 +110,11 @@
109110
<BindName>tcltk</BindName>
110111
</LinkerBindInputPaths>
111112
<LinkerBindInputPaths Include="$(CRTRedist)" Condition="'$(CRTRedist)' != ''">
112-
<BindName>crt</BindName>
113-
</LinkerBindInputPaths>
114-
<LinkerBindInputPaths Include="$(MSBuildThisFileDirectory)\redist">
115113
<BindName>redist</BindName>
116114
</LinkerBindInputPaths>
115+
<LinkerBindInputPaths Include="$(CRTRedist)\$(Platform)" Condition="'$(CRTRedist)' != ''">
116+
<BindName>crt</BindName>
117+
</LinkerBindInputPaths>
117118
</ItemGroup>
118119

119120
<Target Name="_ValidateMsiProps" BeforeTargets="PrepareForBuild">

Tools/msi/redist/README.txt

Lines changed: 0 additions & 15 deletions
This file was deleted.

Tools/msi/tcltk/tcltk.wxs

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

1010
<Property Id="PYTHON_EXE" Secure="yes">
11-
<ComponentSearch Id="PythonExe" Guid="$(var.PythonwExeComponentGuid)">
11+
<ComponentSearch Id="PythonExe" Guid="$(var.PythonExeComponentGuid)">
12+
<FileSearch Name="python.exe" />
13+
</ComponentSearch>
14+
</Property>
15+
16+
<Property Id="PYTHONW_EXE" Secure="yes">
17+
<ComponentSearch Id="PythonwExe" Guid="$(var.PythonwExeComponentGuid)">
1218
<FileSearch Name="pythonw.exe" />
1319
</ComponentSearch>
1420
</Property>
1521

16-
<Condition Message="!(loc.NoPython)">PYTHON_EXE</Condition>
22+
<Condition Message="!(loc.NoPython)">PYTHON_EXE and PYTHONW_EXE</Condition>
1723

1824
<Feature Id="DefaultFeature" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
1925
<ComponentGroupRef Id="tkinter_extension" />
2026
<ComponentGroupRef Id="tcltk_dlls" />
2127
<ComponentGroupRef Id="tcltk_lib" />
22-
<ComponentGroupRef Id="tkinter_lib" />
28+
<ComponentGroupRef Id="tkinter_lib" Primary="yes" />
2329

2430
<Component Id="idle_shortcut" Directory="MenuDir">
2531
<RegistryValue KeyPath="yes" Root="HKMU" Key="[REGISTRYKEY]\Idle" Type="string" Value="[#Lib_idlelib_idle.pyw]" />
@@ -29,11 +35,62 @@
2935
Directory="MenuDir"
3036
Name="!(loc.ShortcutName)"
3137
Description="!(loc.ShortcutDescription)"
32-
Target="[PYTHON_EXE]"
38+
Target="[PYTHONW_EXE]"
3339
Arguments='"[#Lib_idlelib_idle.pyw]"'
3440
Icon="idle.exe">
3541
<Icon Id="idle.exe" SourceFile="!(bindpath.src)Lib\idlelib\Icons\idle.ico" />
3642
</Shortcut>
43+
<Shortcut Id="pydoc.py"
44+
Target="[PYTHON_EXE]"
45+
Arguments='-m pydoc -b'
46+
Name="!(loc.PyDocShortcutName)"
47+
Description="!(loc.PyDocShortcutDescription)"
48+
Icon="idle.exe" />
49+
</Component>
50+
</Feature>
51+
<Feature Id="AssociateFiles" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
52+
<ComponentGroupRef Id="tkinter_lib" />
53+
54+
<!-- We fix the guid of the Subcommands key so that it is correctly reference counted -->
55+
<Component Id="assoc_subcommands" Directory="InstallDirectory" Guid="{57D47B4C-96E6-40A0-A958-57083D74423F}">
56+
<Condition>VersionNT > 600</Condition>
57+
<RegistryValue Root="HKCR" Key="$(var.TestPrefix)Python.File\Shell\editwithidle" Name="MUIVerb" Value="!(loc.EditMenu)" Type="string" KeyPath="yes" />
58+
<RegistryValue Root="HKCR" Key="$(var.TestPrefix)Python.File\Shell\editwithidle" Name="Subcommands" Value="" Type="string" KeyPath="no" />
59+
</Component>
60+
<Component Id="assoc_subcommands_nocon" Directory="InstallDirectory" Guid="{07061D85-9151-4FC4-BB78-13628020D026}">
61+
<Condition>VersionNT > 600</Condition>
62+
<RegistryValue Root="HKCR" Key="$(var.TestPrefix)Python.NoConFile\Shell\editwithidle" Name="MUIVerb" Value="!(loc.EditMenu)" Type="string" KeyPath="yes" />
63+
<RegistryValue Root="HKCR" Key="$(var.TestPrefix)Python.NoConFile\Shell\editwithidle" Name="Subcommands" Value="" Type="string" KeyPath="no" />
64+
</Component>
65+
66+
<Component Id="assoc_editwithidle" Directory="InstallDirectory">
67+
<Condition>VersionNT > 600</Condition>
68+
<RegistryKey Root="HKCR" Key="$(var.TestPrefix)Python.File\Shell\editwithidle\shell\edit$(var.MajorVersionNumber)$(var.MinorVersionNumber)$(var.Suffix32)">
69+
<RegistryValue Name="MUIVerb" Value="!(loc.EditSubMenu)" Type="string" KeyPath="yes" />
70+
<RegistryValue Key="command" Value='"[PYTHONW_EXE]" -m idlelib "%L" %*' Type="string" />
71+
</RegistryKey>
72+
</Component>
73+
<Component Id="assoc_editwithidle_nocon" Directory="InstallDirectory">
74+
<Condition>VersionNT > 600</Condition>
75+
<RegistryKey Root="HKCR" Key="$(var.TestPrefix)Python.NoConFile\Shell\editwithidle\shell\edit$(var.MajorVersionNumber)$(var.MinorVersionNumber)$(var.Suffix32)">
76+
<RegistryValue Name="MUIVerb" Value="!(loc.EditSubMenu)" Type="string" KeyPath="yes" />
77+
<RegistryValue Key="command" Value='"[PYTHONW_EXE]" -m idlelib "%L" %*' Type="string" />
78+
</RegistryKey>
79+
</Component>
80+
81+
<Component Id="assoc_editwithidle_vista" Directory="InstallDirectory">
82+
<Condition>VersionNT = 600</Condition>
83+
<RegistryKey Root="HKCR" Key="$(var.TestPrefix)Python.File\Shell\editwithidle$(var.MajorVersionNumber)$(var.MinorVersionNumber)$(var.Suffix32)">
84+
<RegistryValue Value="!(loc.EditSubMenu)" Type="string" KeyPath="yes" />
85+
<RegistryValue Key="command" Value='"[PYTHONW_EXE]" -m idlelib "%L" %*' Type="string" />
86+
</RegistryKey>
87+
</Component>
88+
<Component Id="assoc_editwithidle_nocon_vista" Directory="InstallDirectory">
89+
<Condition>VersionNT = 600</Condition>
90+
<RegistryKey Root="HKCR" Key="$(var.TestPrefix)Python.NoConFile\Shell\editwithidle$(var.MajorVersionNumber)$(var.MinorVersionNumber)$(var.Suffix32)">
91+
<RegistryValue Value="!(loc.EditSubMenu)" Type="string" KeyPath="yes" />
92+
<RegistryValue Key="command" Value='"[PYTHONW_EXE]" -m idlelib "%L" %*' Type="string" />
93+
</RegistryKey>
3794
</Component>
3895
</Feature>
3996
</Product>

Tools/msi/tcltk/tcltk_en-US.wxl_template

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@
55
<String Id="NoPython">No !(loc.ProductName) installation was detected.</String>
66
<String Id="ShortcutName">IDLE (Python {{ShortVersion}} {{Bitness}})</String>
77
<String Id="ShortcutDescription">Launches IDLE, the interactive environment for !(loc.ProductName).</String>
8+
<String Id="PyDocShortcutName">Python {{ShortVersion}} Module Docs ({{Bitness}})</String>
9+
<String Id="PyDocShortcutDescription">Start the !(loc.ProductName) documentation server.</String>
10+
<String Id="EditMenu">&amp;Edit with IDLE</String>
11+
<String Id="EditSubMenu">Edit with IDLE {{ShortVersion}} ({{Bitness}})</String>
812
</WixLocalization>

Tools/msi/testrelease.bat

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,26 @@ exit /B 0
5959
@echo Printing version
6060
"%~2\Python\python.exe" -c "import sys; print(sys.version)" > "%~2\version.txt" 2>&1
6161
)
62+
63+
@if not errorlevel 1 (
64+
@echo Capturing Start Menu
65+
@dir /s/b "%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs" | findstr /ic:"python" > "%~2\startmenu.txt" 2>&1
66+
@dir /s/b "%APPDATA%\Microsoft\Windows\Start Menu\Programs" | findstr /ic:"python" >> "%~2\startmenu.txt" 2>&1
67+
68+
@echo Capturing registry
69+
@for /F "usebackq" %%f in (`reg query HKCR /s /f python /k`) do @(
70+
echo %%f >> "%~2\hkcr.txt"
71+
reg query "%%f" /s >> "%~2\hkcr.txt" 2>&1
72+
)
73+
@reg query HKCU\Software\Python /s > "%~2\hkcu.txt" 2>&1
74+
@reg query HKLM\Software\Python /reg:32 /s > "%~2\hklm.txt" 2>&1
75+
@reg query HKLM\Software\Python /reg:64 /s >> "%~2\hklm.txt" 2>&1
76+
cmd /k exit 0
77+
)
78+
6279
@if not errorlevel 1 (
6380
@echo Installing package
64-
"%~2\Python\python.exe" -m pip install azure > "%~2\pip.txt" 2>&1
81+
"%~2\Python\python.exe" -m pip install "azure<0.10" > "%~2\pip.txt" 2>&1
6582
@if not errorlevel 1 (
6683
"%~2\Python\python.exe" -m pip uninstall -y azure python-dateutil six >> "%~2\pip.txt" 2>&1
6784
)
@@ -75,9 +92,6 @@ exit /B 0
7592

7693
@set EXITCODE=%ERRORLEVEL%
7794

78-
@for /d %%f in ("%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Python*") do @dir "%%~ff\*.lnk" /s/b > "%~2\startmenu.txt" 2>&1
79-
@for /d %%f in ("%APPDATA%\Microsoft\Windows\Start Menu\Programs\Python*") do @dir "%%~ff\*.lnk" /s/b >> "%~2\startmenu.txt" 2>&1
80-
8195
@echo Result was %EXITCODE%
8296
@echo Removing %1
8397
"%~1" /passive /uninstall /log "%~2\uninstall\log.txt"

0 commit comments

Comments
 (0)