summaryrefslogtreecommitdiffstats
path: root/Tools/msi/common.wxs
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@python.org>2022-03-07 17:23:20 (GMT)
committerGitHub <noreply@github.com>2022-03-07 17:23:20 (GMT)
commit136842c91b5783e205e217c4855baa9dadd4ad41 (patch)
tree3e07aae66533ddbc418ae976a1c7800c5867cecd /Tools/msi/common.wxs
parent0ff033b859f29b6230f6d2262f08b31c2ba11921 (diff)
downloadcpython-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/common.wxs')
-rw-r--r--Tools/msi/common.wxs16
1 files changed, 14 insertions, 2 deletions
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 -->