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

Skip to content

bpo-32507: Change Windows install to include app-local UCRT #5119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jan 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Use app-local UCRT install rather than the proper update for old versions of
Windows.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ensure separate Modify and Uninstall buttons are displayed.
77 changes: 0 additions & 77 deletions PC/dllbase_nt.txt

This file was deleted.

3 changes: 0 additions & 3 deletions PCbuild/_bz2.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@
<PreprocessorDefinitions>WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4244;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<BaseAddress>0x1D170000</BaseAddress>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\Modules\_bz2module.c" />
Expand Down
1 change: 0 additions & 1 deletion PCbuild/_ctypes.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
<AdditionalIncludeDirectories>..\Modules\_ctypes\libffi_msvc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<BaseAddress>0x1D1A0000</BaseAddress>
<AdditionalOptions>/EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
Expand Down
3 changes: 0 additions & 3 deletions PCbuild/_decimal.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@
<PreprocessorDefinitions Condition="'$(Platform)' == 'x64'">CONFIG_64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\Modules\_decimal;..\Modules\_decimal\libmpdec;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<BaseAddress>0x1D1A0000</BaseAddress>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\Modules\_decimal\libmpdec\basearith.h" />
Expand Down
3 changes: 0 additions & 3 deletions PCbuild/_elementtree.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@
<AdditionalIncludeDirectories>..\Modules\expat;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;XML_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<BaseAddress>0x1D100000</BaseAddress>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\Modules\expat\ascii.h" />
Expand Down
1 change: 0 additions & 1 deletion PCbuild/_msi.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
<ItemDefinitionGroup>
<Link>
<AdditionalDependencies>cabinet.lib;msi.lib;rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
<BaseAddress>0x1D160000</BaseAddress>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion PCbuild/_multiprocessing.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
<ItemDefinitionGroup>
<Link>
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<BaseAddress>0x1e1D0000</BaseAddress>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion PCbuild/_overlapped.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
<ItemDefinitionGroup>
<Link>
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<BaseAddress>0x1D110000</BaseAddress>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion PCbuild/_socket.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
<ItemDefinitionGroup>
<Link>
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<BaseAddress>0x1e1D0000</BaseAddress>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down
3 changes: 0 additions & 3 deletions PCbuild/_sqlite3.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@
<AdditionalIncludeDirectories>$(sqlite3Dir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>MODULE_NAME="sqlite3";%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<BaseAddress>0x1e180000</BaseAddress>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\Modules\_sqlite\cache.h" />
Expand Down
5 changes: 0 additions & 5 deletions PCbuild/_testbuffer.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
</PropertyGroup>
<ItemDefinitionGroup>
<Link>
<BaseAddress>0x1e1F0000</BaseAddress>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\Modules\_testbuffer.c" />
</ItemGroup>
Expand Down
5 changes: 0 additions & 5 deletions PCbuild/_testcapi.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
</PropertyGroup>
<ItemDefinitionGroup>
<Link>
<BaseAddress>0x1e1F0000</BaseAddress>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\Modules\_testcapimodule.c" />
</ItemGroup>
Expand Down
5 changes: 0 additions & 5 deletions PCbuild/_testimportmultiple.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
</PropertyGroup>
<ItemDefinitionGroup>
<Link>
<BaseAddress>0x1e1F0000</BaseAddress>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\Modules\_testimportmultiple.c" />
</ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion PCbuild/python.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
<Link>
<SubSystem>Console</SubSystem>
<StackReserveSize>2000000</StackReserveSize>
<BaseAddress>0x1d000000</BaseAddress>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion PCbuild/pythoncore.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
<Link>
<AdditionalDependencies>version.lib;shlwapi.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories);$(PySourcePath)PC\external\$(PlatformToolset)\$(ArchName)</AdditionalLibraryDirectories>
<BaseAddress>0x1e000000</BaseAddress>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion PCbuild/pythonw.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
<ItemDefinitionGroup>
<Link>
<StackReserveSize>2000000</StackReserveSize>
<BaseAddress>0x1d000000</BaseAddress>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion PCbuild/select.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
<ItemDefinitionGroup>
<Link>
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<BaseAddress>0x1D110000</BaseAddress>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down
5 changes: 0 additions & 5 deletions PCbuild/unicodedata.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
</PropertyGroup>
<ItemDefinitionGroup>
<Link>
<BaseAddress>0x1D120000</BaseAddress>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\Modules\unicodedata_db.h" />
<ClInclude Include="..\Modules\unicodename_db.h" />
Expand Down
1 change: 0 additions & 1 deletion PCbuild/xxlimited.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
</ClCompile>
<Link>
<AdditionalDependencies>wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<BaseAddress>0x1D110000</BaseAddress>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down
32 changes: 0 additions & 32 deletions Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,6 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication {
case ID_INSTALL_BUTTON:
SavePageSettings();

if (!WillElevate() && !QueryElevateForCrtInstall()) {
break;
}

hr = BalGetNumericVariable(L"InstallAllUsers", &installAllUsers);
ExitOnFailure(hr, L"Failed to get install scope");

Expand Down Expand Up @@ -332,10 +328,6 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication {
ReleaseStr(targetDir);
}

if (!WillElevate() && !QueryElevateForCrtInstall()) {
break;
}

OnPlan(_command.action);
break;

Expand Down Expand Up @@ -2642,30 +2634,6 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication {
return result;
}

BOOL QueryElevateForCrtInstall() {
// Called to prompt the user that even though they think they won't need
// to elevate, they actually will because of the CRT install.
if (IsCrtInstalled()) {
// CRT is already installed - no need to prompt
return TRUE;
}

LONGLONG elevated;
HRESULT hr = BalGetNumericVariable(L"WixBundleElevated", &elevated);
if (SUCCEEDED(hr) && elevated) {
// Already elevated - no need to prompt
return TRUE;
}

LOC_STRING *locStr;
hr = LocGetString(_wixLoc, L"#(loc.ElevateForCRTInstall)", &locStr);
if (FAILED(hr)) {
BalLogError(hr, "Failed to get ElevateForCRTInstall string");
return FALSE;
}
return ::MessageBoxW(_hWnd, locStr->wzText, _theme->sczCaption, MB_YESNO) != IDNO;
}

HRESULT EvaluateConditions() {
HRESULT hr = S_OK;
BOOL result = FALSE;
Expand Down
1 change: 1 addition & 0 deletions Tools/msi/bundle/bundle.targets
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
<Package Include="..\tcltk\tcltk*.wixproj" />
<Package Include="..\test\test*.wixproj" />
<Package Include="..\tools\tools*.wixproj" />
<Package Include="..\ucrt\ucrt*.wixproj" />
</ItemGroup>

<PropertyGroup>
Expand Down
50 changes: 12 additions & 38 deletions Tools/msi/bundle/packagegroups/crt.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,22 @@
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<PackageGroup Id="crt">
<PackageGroupRef Id="crt_14.0_v6.0" />
<PackageGroupRef Id="crt_14.0_v6.1" />
<PackageGroupRef Id="crt_14.0_v6.2" />
<PackageGroupRef Id="crt_14.0_v6.3" />
</PackageGroup>
</Fragment>

<?foreach ver in v6.0;v6.1;v6.2;v6.3 ?>
<?if "$(var.ver)" = "v6.0" ?>
<?define msuver=6.0 ?>
<?elseif "$(var.ver)" = "v6.1" ?>
<?define msuver=6.1 ?>
<?elseif "$(var.ver)" = "v6.2" ?>
<?define msuver=8-RT ?>
<?elseif "$(var.ver)" = "v6.3" ?>
<?define msuver=8.1 ?>
<?else ?>
<?error unknown version $(var.ver) ?>
<?endif ?>

<Fragment>
<PackageGroup Id="crt_14.0_$(var.ver)">
<MsuPackage Id="crt_14.0_$(var.ver)_x86"
KB="2999226"
SourceFile="!(bindpath.redist)\Windows$(var.msuver)-KB2999226-x86.msu"
DisplayName="!(loc.CRTDescription)"
Description="!(loc.CRTDescription)"
<MsiPackage Id="ucrt_AllUsers"
SourceFile="ucrt.msi"
Compressed="$(var.CompressMSI)"
DownloadUrl="$(var.DownloadUrl)"
InstallCondition="not CRTInstalled and VersionNT = $(var.ver) and not VersionNT64 and (Include_core or Include_exe or Include_launcher or Include_pip) and not LauncherOnly" />

<MsuPackage Id="crt_14.0_$(var.ver)_x64"
KB="2999226"
SourceFile="!(bindpath.redist)\Windows$(var.msuver)-KB2999226-x64.msu"
DisplayName="!(loc.CRTDescription)"
Description="!(loc.CRTDescription)"
ForcePerMachine="yes"
InstallCondition="InstallAllUsers and not CRTInstalled and (Include_core or Include_exe or Include_pip) and not LauncherOnly">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="ucrt_JustForMe"
SourceFile="ucrt.msi"
Compressed="$(var.CompressMSI)"
DownloadUrl="$(var.DownloadUrl)"
InstallCondition="not CRTInstalled and VersionNT64 = $(var.ver) and (Include_core or Include_exe or Include_launcher or Include_pip) and not LauncherOnly" />
ForcePerMachine="no"
InstallCondition="not InstallAllUsers and not CRTInstalled and (Include_core or Include_exe or Include_pip) and not LauncherOnly">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
</PackageGroup>
</Fragment>

<?undef msuver ?>
<?endforeach ?>
</Wix>
6 changes: 3 additions & 3 deletions Tools/msi/exe/exe.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
<Product Id="*" Language="!(loc.LCID)" Name="!(loc.Title)" Version="$(var.Version)" Manufacturer="!(loc.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
<Package InstallerVersion="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />

<PropertyRef Id="UpgradeTable" />
<PropertyRef Id="REGISTRYKEY" />

<Feature Id="DefaultFeature" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
<ComponentGroupRef Id="exe_python" Primary="yes" />
<ComponentGroupRef Id="exe_reg" Primary="yes" />
<ComponentGroupRef Id="exe_txt" />
<ComponentGroupRef Id="exe_icons" />
<ComponentRef Id="OptionalFeature" />
</Feature>

<Feature Id="Shortcuts" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
<ComponentGroupRef Id="exe_python" />
<Component Id="exe_shortcut" Directory="MenuDir" Guid="*">
Expand Down
Loading