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

Skip to content

Commit bb24087

Browse files
committed
Issue #23260: Update Windows installer
1 parent 7425f36 commit bb24087

133 files changed

Lines changed: 7042 additions & 4997 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,6 @@ TAGS
8282
coverage/
8383
externals/
8484
htmlcov/
85+
Tools/msi/obj
8586
Tools/ssl/amd64
8687
Tools/ssl/win32

.hgignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,6 @@ htmlcov/
9090
*.gcno
9191
*.gcov
9292
coverage.info
93+
Tools/msi/obj
9394
Tools/ssl/amd64
9495
Tools/ssl/win32

Doc/make.bat

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@ set this=%~n0
88
if "%SPHINXBUILD%" EQU "" set SPHINXBUILD=sphinx-build
99
if "%PYTHON%" EQU "" set PYTHON=py
1010

11-
if DEFINED ProgramFiles(x86) set _PRGMFLS=%ProgramFiles(x86)%
12-
if NOT DEFINED ProgramFiles(x86) set _PRGMFLS=%ProgramFiles%
13-
if "%HTMLHELP%" EQU "" set HTMLHELP=%_PRGMFLS%\HTML Help Workshop\hhc.exe
11+
if "%HTMLHELP%" EQU "" (
12+
where hhc 2>nul >"%TEMP%\hhc.loc"
13+
if errorlevel 1 dir "..\externals\hhc.exe" /s/b > "%TEMP%\hhc.loc"
14+
if errorlevel 1 echo Cannot find HHC on PATH or in externals & exit /B 1
15+
set /P HTMLHELP= < "%TEMP%\hhc.loc"
16+
del "%TEMP%\hhc.loc"
17+
)
1418

15-
if "%DISTVERSION%" EQU "" for /f "usebackq" %%v in (`%PYTHON% tools/patchlevel.py`) do set DISTVERSION=%%v
19+
if "%DISTVERSION%" EQU "" for /f "usebackq" %%v in (`%PYTHON% tools/extensions/patchlevel.py`) do set DISTVERSION=%%v
1620

1721
if "%BUILDDIR%" EQU "" set BUILDDIR=build
1822

@@ -36,7 +40,8 @@ if errorlevel 9009 (
3640
echo.
3741
echo.If you don't have Sphinx installed, grab it from
3842
echo.http://sphinx-doc.org/
39-
goto end
43+
popd
44+
exit /B 1
4045
)
4146

4247
rem Targets that do require sphinx-build and have their own label

Doc/using/win_installer.png

130 KB
Loading

Doc/using/windows.rst

Lines changed: 339 additions & 168 deletions
Large diffs are not rendered by default.

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1778,6 +1778,8 @@ Tools/Demos
17781778
Windows
17791779
-------
17801780

1781+
- Issue #23260: Update Windows installer
1782+
17811783
- The bundled version of Tcl/Tk has been updated to 8.6.3. The most visible
17821784
result of this change is the addition of new native file dialogs when
17831785
running on Windows Vista or newer. See Tcl/Tk's TIP 432 for more

PC/launcher.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,19 @@ static INSTALLED_PYTHON installed_pythons[MAX_INSTALLED_PYTHONS];
157157

158158
static size_t num_installed_pythons = 0;
159159

160-
/* to hold SOFTWARE\Python\PythonCore\X.Y\InstallPath */
160+
/*
161+
* To hold SOFTWARE\Python\PythonCore\X.Y...\InstallPath
162+
* The version name can be longer than MAX_VERSION_SIZE, but will be
163+
* truncated to just X.Y for comparisons.
164+
*/
161165
#define IP_BASE_SIZE 40
162-
#define IP_SIZE (IP_BASE_SIZE + MAX_VERSION_SIZE)
166+
#define IP_VERSION_SIZE 8
167+
#define IP_SIZE (IP_BASE_SIZE + IP_VERSION_SIZE)
163168
#define CORE_PATH L"SOFTWARE\\Python\\PythonCore"
164169

165170
static wchar_t * location_checks[] = {
166171
L"\\",
167-
L"\\PCBuild\\",
172+
L"\\PCBuild\\win32\\",
168173
L"\\PCBuild\\amd64\\",
169174
NULL
170175
};
@@ -196,6 +201,7 @@ locate_pythons_for_key(HKEY root, REGSAM flags)
196201
BOOL ok;
197202
DWORD type, data_size, attrs;
198203
INSTALLED_PYTHON * ip, * pip;
204+
wchar_t ip_version[IP_VERSION_SIZE];
199205
wchar_t ip_path[IP_SIZE];
200206
wchar_t * check;
201207
wchar_t ** checkp;
@@ -207,19 +213,21 @@ locate_pythons_for_key(HKEY root, REGSAM flags)
207213
else {
208214
ip = &installed_pythons[num_installed_pythons];
209215
for (i = 0; num_installed_pythons < MAX_INSTALLED_PYTHONS; i++) {
210-
status = RegEnumKeyW(core_root, i, ip->version, MAX_VERSION_SIZE);
216+
status = RegEnumKeyW(core_root, i, ip_version, IP_VERSION_SIZE);
211217
if (status != ERROR_SUCCESS) {
212218
if (status != ERROR_NO_MORE_ITEMS) {
213219
/* unexpected error */
214220
winerror(status, message, MSGSIZE);
215221
debug(L"Can't enumerate registry key for version %ls: %ls\n",
216-
ip->version, message);
222+
ip_version, message);
217223
}
218224
break;
219225
}
220226
else {
227+
wcsncpy_s(ip->version, MAX_VERSION_SIZE, ip_version,
228+
MAX_VERSION_SIZE-1);
221229
_snwprintf_s(ip_path, IP_SIZE, _TRUNCATE,
222-
L"%ls\\%ls\\InstallPath", CORE_PATH, ip->version);
230+
L"%ls\\%ls\\InstallPath", CORE_PATH, ip_version);
223231
status = RegOpenKeyExW(root, ip_path, 0, flags, &ip_key);
224232
if (status != ERROR_SUCCESS) {
225233
winerror(status, message, MSGSIZE);

PCbuild/_freeze_importlib.vcxproj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
8282
<ImportGroup Label="ExtensionTargets">
8383
</ImportGroup>
84-
<Target Name="RebuildImportLib" AfterTargets="AfterBuild">
84+
<Target Name="RebuildImportLib" AfterTargets="AfterBuild" Condition="$(Configuration) == 'Debug' or $(Configuration) == 'Release'">
8585
<Exec Command='"$(TargetPath)" "$(PySourcePath)Lib\importlib\_bootstrap.py" "$(IntDir)importlib.g.h"' />
8686

8787
<PropertyGroup>
@@ -93,9 +93,10 @@
9393
DestinationFiles="$(PySourcePath)Python\importlib.h"
9494
Condition="Exists('$(IntDir)importlib.g.h') and '$(_OldContent)' != '$(_NewContent)'" />
9595

96-
<Message Text="importlib.h has been updated. You will need to rebuild pythoncore to see the changes."
97-
Importance="high"
98-
Condition="Exists('$(IntDir)importlib.g.h') and '$(_OldContent)' != '$(_NewContent)'" />
96+
<Warning Text="importlib.h has been updated. You will need to rebuild pythoncore to see the changes."
97+
Condition="Exists('$(IntDir)importlib.g.h') and '$(_OldContent)' != '$(_NewContent)' and $(Configuration) == 'Debug'" />
98+
<Error Text="importlib.h has been updated. You will need to rebuild pythoncore to see the changes."
99+
Condition="Exists('$(IntDir)importlib.g.h') and '$(_OldContent)' != '$(_NewContent)' and $(Configuration) == 'Release'" />
99100
</Target>
100101
<Target Name="_CleanImportLib" BeforeTargets="CoreClean">
101102
<ItemGroup>

PCbuild/libeay.vcxproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,12 @@
4141

4242
<Import Project="python.props" />
4343
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
44+
45+
<PropertyGroup Label="Configuration">
46+
<ConfigurationType>StaticLibrary</ConfigurationType>
47+
</PropertyGroup>
48+
4449
<Import Project="openssl.props" />
45-
4650
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
4751

4852
<Target Name="CreateBuildinfH" Inputs="$(MSBuildProjectFullPath)" Outputs="$(IntDir)\buildinf.h" AfterTargets="PrepareForBuild">

PCbuild/pylauncher.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
<ItemDefinitionGroup>
6262
<ClCompile>
6363
<PreprocessorDefinitions>_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
64+
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
6465
</ClCompile>
6566
<Link>
6667
<AdditionalDependencies>version.lib;%(AdditionalDependencies)</AdditionalDependencies>

0 commit comments

Comments
 (0)