Open SebTV opened 1 month ago
Addition: The same applies to the redist-1 path in the same file. My guess is that buildrelease.bat and wix.props (unlike get_externals.bat) do not check whether EXTERNALS_DIR is set and calculate different paths. All scripts should come to the same final results
get_externals.bat
in Tools/msi
should add the windows-installer
directory to the path regardless of where it came from.
Then this is the correct fix when EXTERNAL_DIRS is in use
--- Python-3.12.2/Tools/msi/get_externals.bat.org 2024-05-10 21:32:11.211387400 +0200
+++ Python-3.12.2/Tools/msi/get_externals.bat 2024-05-10 21:34:43.038714100 +0200
@@ -4,7 +4,11 @@
set HERE=%~dp0
if "%PCBUILD%"=="" (set PCBUILD=%HERE%..\..\PCbuild\)
-if "%EXTERNALS_DIR%"=="" (set EXTERNALS_DIR=%HERE%..\..\externals\windows-installer)
+if "%EXTERNALS_DIR%"=="" (
+ set EXTERNALS_DIR=%HERE%..\..\externals\windows-installer
+) else (
+ set EXTERNALS_DIR=%EXTERNALS_DIR%\windows-installer
+)
if "%NUGET%"=="" (set NUGET=%EXTERNALS_DIR%\..\nuget.exe)
if "%NUGET_URL%"=="" (set NUGET_URL=https://aka.ms/nugetclidl)
It should also be noted that EXTERNALS_DIR cannot be a UNC Path. light.exe cannot load WixUtilExtension.dll from an UNC Path.
light.exe : error LGHT0001 : The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
Exception Type: System.IO.FileNotFoundException
for the pip.wixproj
Correct, that's the fix, and we can make it in our repository, so the issue can stay open until someone makes a PR.
Bug report
Bug description:
On Windows try to build Python+Installer using
tools\msi\buildrelease.bat
: Useget_externals.bat
to offline-cache packages SetEXTERNALS_DIR
startbuildrelease.bat
Result <...>Python-3.12.2\Tools\msi\launcher\launcher.wixproj" (default target) (1) -> <...>Python-3.12.2\Tools\msi\msi.targets(78,5): error MSB4019: The imported project "C:\Wix.targets" was not found. Confirm that the expression in the Import declaration "\Wix.targets" is correct, and that the file exists on disk. [<...>Python-3.12.2\Tools\msi\launcher\launcher.wixproj]Note that
get_externals.bat
puts wix-314 into the root ofEXTERNALS_DIR
whilePython-3.12.2/Tools/msi/wix.props
expects a subdirectorywindows-installer
.See the better workaround below. Deleting this patch as it goes into the wrong direction
CPython versions tested on:
3.12
Operating systems tested on:
Windows