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/common.wxs | |
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/common.wxs')
-rw-r--r-- | Tools/msi/common.wxs | 16 |
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 --> |