summaryrefslogtreecommitdiffstats
path: root/Tools/msi
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@python.org>2022-03-07 17:23:11 (GMT)
committerGitHub <noreply@github.com>2022-03-07 17:23:11 (GMT)
commit77446d2aa56e9e3262d9d2247342bbbb0ff5e907 (patch)
tree8c36fab1f209dd9f354394bb28e4037250f20356 /Tools/msi
parentca9689f8dac01d27e041e1dbbdae146746d48ab3 (diff)
downloadcpython-77446d2aa56e9e3262d9d2247342bbbb0ff5e907.zip
cpython-77446d2aa56e9e3262d9d2247342bbbb0ff5e907.tar.gz
cpython-77446d2aa56e9e3262d9d2247342bbbb0ff5e907.tar.bz2
bpo-46948: Fix CVE-2022-26488 by ensuring the Windows Installer correctly uses the install path during repair (GH-31726)
Diffstat (limited to 'Tools/msi')
-rw-r--r--Tools/msi/appendpath/appendpath.wxs1
-rw-r--r--Tools/msi/bundle/bundle.wxs2
-rw-r--r--Tools/msi/common.wxs16
-rw-r--r--Tools/msi/dev/dev.wxs1
-rw-r--r--Tools/msi/doc/doc.wxs1
-rw-r--r--Tools/msi/lib/lib.wxs1
-rw-r--r--Tools/msi/path/path.wxs3
-rw-r--r--Tools/msi/tcltk/tcltk.wxs1
-rw-r--r--Tools/msi/test/test.wxs1
-rw-r--r--Tools/msi/tools/tools.wxs1
-rw-r--r--Tools/msi/ucrt/ucrt.wxs1
11 files changed, 25 insertions, 4 deletions
diff --git a/Tools/msi/appendpath/appendpath.wxs b/Tools/msi/appendpath/appendpath.wxs
index e8d7a9d..bba186c 100644
--- a/Tools/msi/appendpath/appendpath.wxs
+++ b/Tools/msi/appendpath/appendpath.wxs
@@ -3,6 +3,7 @@
<Product Id="*" Language="!(loc.LCID)" Name="!(loc.Title)" Version="$(var.Version)" Manufacturer="!(loc.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
<Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
+ <PropertyRef Id="DetectTargetDir" />
<PropertyRef Id="UpgradeTable" />
<PropertyRef Id="REGISTRYKEY" />
diff --git a/Tools/msi/bundle/bundle.wxs b/Tools/msi/bundle/bundle.wxs
index 0683f87..ac4b7a6 100644
--- a/Tools/msi/bundle/bundle.wxs
+++ b/Tools/msi/bundle/bundle.wxs
@@ -108,8 +108,8 @@
<PackageGroupRef Id="crt" />
<?endif ?>
<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 cfc4c44..15a0836 100644
--- a/Tools/msi/dev/dev.wxs
+++ b/Tools/msi/dev/dev.wxs
@@ -4,6 +4,7 @@
<Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
<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 d05936f..1d7706b 100644
--- a/Tools/msi/doc/doc.wxs
+++ b/Tools/msi/doc/doc.wxs
@@ -4,6 +4,7 @@
<Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
<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 5c67420..e417e31 100644
--- a/Tools/msi/lib/lib.wxs
+++ b/Tools/msi/lib/lib.wxs
@@ -4,6 +4,7 @@
<Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
<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 496f9d0..3285439 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="500" Compressed="yes" InstallScope="perUser" />
-
+
+ <PropertyRef Id="DetectTargetDir" />
<PropertyRef Id="UpgradeTable" />
<PropertyRef Id="REGISTRYKEY" />
diff --git a/Tools/msi/tcltk/tcltk.wxs b/Tools/msi/tcltk/tcltk.wxs
index fdd6da3..bad56d5 100644
--- a/Tools/msi/tcltk/tcltk.wxs
+++ b/Tools/msi/tcltk/tcltk.wxs
@@ -4,6 +4,7 @@
<Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
<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 bf601f4..9e497e7 100644
--- a/Tools/msi/test/test.wxs
+++ b/Tools/msi/test/test.wxs
@@ -4,6 +4,7 @@
<Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
<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 bb6436c..c06b3c2 100644
--- a/Tools/msi/tools/tools.wxs
+++ b/Tools/msi/tools/tools.wxs
@@ -4,6 +4,7 @@
<Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
<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 525130c..e9e2a9a 100644
--- a/Tools/msi/ucrt/ucrt.wxs
+++ b/Tools/msi/ucrt/ucrt.wxs
@@ -4,6 +4,7 @@
<Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
+ <PropertyRef Id="DetectTargetDir" />
<PropertyRef Id="UpgradeTable" />
<PropertyRef Id="REGISTRYKEY" />