diff options
author | Steve Dower <steve.dower@python.org> | 2022-03-07 17:23:20 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-07 17:23:20 (GMT) |
commit | 136842c91b5783e205e217c4855baa9dadd4ad41 (patch) | |
tree | 3e07aae66533ddbc418ae976a1c7800c5867cecd /Tools/msi | |
parent | 0ff033b859f29b6230f6d2262f08b31c2ba11921 (diff) | |
download | cpython-136842c91b5783e205e217c4855baa9dadd4ad41.zip cpython-136842c91b5783e205e217c4855baa9dadd4ad41.tar.gz cpython-136842c91b5783e205e217c4855baa9dadd4ad41.tar.bz2 |
bpo-46948: Fix CVE-2022-26488 by ensuring the Windows Installer correctly uses the install path during repair (GH-31727)
Diffstat (limited to 'Tools/msi')
-rw-r--r-- | Tools/msi/bundle/bundle.wxs | 2 | ||||
-rw-r--r-- | Tools/msi/common.wxs | 16 | ||||
-rw-r--r-- | Tools/msi/dev/dev.wxs | 1 | ||||
-rw-r--r-- | Tools/msi/doc/doc.wxs | 1 | ||||
-rw-r--r-- | Tools/msi/lib/lib.wxs | 1 | ||||
-rw-r--r-- | Tools/msi/path/path.wxs | 3 | ||||
-rw-r--r-- | Tools/msi/tcltk/tcltk.wxs | 1 | ||||
-rw-r--r-- | Tools/msi/test/test.wxs | 1 | ||||
-rw-r--r-- | Tools/msi/tools/tools.wxs | 1 | ||||
-rw-r--r-- | Tools/msi/ucrt/ucrt.wxs | 1 |
10 files changed, 24 insertions, 4 deletions
diff --git a/Tools/msi/bundle/bundle.wxs b/Tools/msi/bundle/bundle.wxs index e2f8718..0c28db6 100644 --- a/Tools/msi/bundle/bundle.wxs +++ b/Tools/msi/bundle/bundle.wxs @@ -95,8 +95,8 @@ <Chain ParallelCache="yes"> <PackageGroupRef Id="crt" /> <PackageGroupRef Id="core" /> - <PackageGroupRef Id="dev" /> <PackageGroupRef Id="exe" /> + <PackageGroupRef Id="dev" /> <PackageGroupRef Id="lib" /> <PackageGroupRef Id="test" /> <PackageGroupRef Id="doc" /> diff --git a/Tools/msi/common.wxs b/Tools/msi/common.wxs index 398d94a..d8f3cde 100644 --- a/Tools/msi/common.wxs +++ b/Tools/msi/common.wxs @@ -53,11 +53,23 @@ </Fragment> <Fragment> - <?ifdef InstallDirectoryGuidSeed ?> <Directory Id="TARGETDIR" Name="SourceDir"> + <?ifdef InstallDirectoryGuidSeed ?> <Directory Id="InstallDirectory" ComponentGuidGenerationSeed="$(var.InstallDirectoryGuidSeed)" /> + <?endif ?> </Directory> - <?endif ?> + </Fragment> + + <Fragment> + <!-- Locate TARGETDIR automatically assuming we have executables installed --> + <Property Id="TARGETDIR"> + <ComponentSearch Id="PythonExe_Directory" Guid="$(var.PythonExeComponentGuid)"> + <DirectorySearch Id="PythonExe_Directory" AssignToProperty="yes" Path="."> + <FileSearch Id="PythonExe_DirectoryFile" Name="python.exe" /> + </DirectorySearch> + </ComponentSearch> + </Property> + <Property Id="DetectTargetDir" Value="1" /> </Fragment> <!-- Top-level directories --> diff --git a/Tools/msi/dev/dev.wxs b/Tools/msi/dev/dev.wxs index 23a710d..2ddeb31 100644 --- a/Tools/msi/dev/dev.wxs +++ b/Tools/msi/dev/dev.wxs @@ -4,6 +4,7 @@ <Package InstallerVersion="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" /> <MediaTemplate EmbedCab="yes" CompressionLevel="high" /> + <PropertyRef Id="DetectTargetDir" /> <PropertyRef Id="UpgradeTable" /> <Feature Id="DefaultFeature" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)"> diff --git a/Tools/msi/doc/doc.wxs b/Tools/msi/doc/doc.wxs index cd1a68c..cc5bdb4 100644 --- a/Tools/msi/doc/doc.wxs +++ b/Tools/msi/doc/doc.wxs @@ -4,6 +4,7 @@ <Package InstallerVersion="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" /> <MediaTemplate EmbedCab="yes" CompressionLevel="high" /> + <PropertyRef Id="DetectTargetDir" /> <PropertyRef Id="UpgradeTable" /> <PropertyRef Id="REGISTRYKEY" /> diff --git a/Tools/msi/lib/lib.wxs b/Tools/msi/lib/lib.wxs index 2a3b9ec..b38cd91 100644 --- a/Tools/msi/lib/lib.wxs +++ b/Tools/msi/lib/lib.wxs @@ -4,6 +4,7 @@ <Package InstallerVersion="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" /> <MediaTemplate EmbedCab="yes" CompressionLevel="high" /> + <PropertyRef Id="DetectTargetDir" /> <PropertyRef Id="UpgradeTable" /> <PropertyRef Id="REGISTRYKEY" /> diff --git a/Tools/msi/path/path.wxs b/Tools/msi/path/path.wxs index 8b37936..017b812 100644 --- a/Tools/msi/path/path.wxs +++ b/Tools/msi/path/path.wxs @@ -2,7 +2,8 @@ <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <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)" /> - + + <PropertyRef Id="DetectTargetDir" /> <PropertyRef Id="UpgradeTable" /> <PropertyRef Id="REGISTRYKEY" /> diff --git a/Tools/msi/tcltk/tcltk.wxs b/Tools/msi/tcltk/tcltk.wxs index eeae8e8..bbf6ac7 100644 --- a/Tools/msi/tcltk/tcltk.wxs +++ b/Tools/msi/tcltk/tcltk.wxs @@ -4,6 +4,7 @@ <Package InstallerVersion="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" /> <MediaTemplate EmbedCab="yes" CompressionLevel="high" /> + <PropertyRef Id="DetectTargetDir" /> <PropertyRef Id="UpgradeTable" /> <PropertyRef Id="REGISTRYKEY" /> diff --git a/Tools/msi/test/test.wxs b/Tools/msi/test/test.wxs index f2ed64f..e8f514a 100644 --- a/Tools/msi/test/test.wxs +++ b/Tools/msi/test/test.wxs @@ -4,6 +4,7 @@ <Package InstallerVersion="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" /> <MediaTemplate EmbedCab="yes" CompressionLevel="high" /> + <PropertyRef Id="DetectTargetDir" /> <PropertyRef Id="UpgradeTable" /> <PropertyRef Id="REGISTRYKEY" /> diff --git a/Tools/msi/tools/tools.wxs b/Tools/msi/tools/tools.wxs index 7a805d0..133a743 100644 --- a/Tools/msi/tools/tools.wxs +++ b/Tools/msi/tools/tools.wxs @@ -4,6 +4,7 @@ <Package InstallerVersion="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" /> <MediaTemplate EmbedCab="yes" CompressionLevel="high" /> + <PropertyRef Id="DetectTargetDir" /> <PropertyRef Id="UpgradeTable" /> <Feature Id="DefaultFeature" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)"> diff --git a/Tools/msi/ucrt/ucrt.wxs b/Tools/msi/ucrt/ucrt.wxs index 76e5682..94fd3f0 100644 --- a/Tools/msi/ucrt/ucrt.wxs +++ b/Tools/msi/ucrt/ucrt.wxs @@ -4,6 +4,7 @@ <Package InstallerVersion="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" /> <MediaTemplate EmbedCab="yes" CompressionLevel="high" /> + <PropertyRef Id="DetectTargetDir" /> <PropertyRef Id="UpgradeTable" /> <PropertyRef Id="REGISTRYKEY" /> |