From ec850f4d98ea4ce33bfba9ebd790376aaaaf7a71 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Thu, 31 May 2018 19:31:20 +0100 Subject: [PATCH] Build MSI installers for Arm Windows. I expected this to be nightmarish because WiX 3 doesn't know about the Windows on Arm platform at all. Fortunately, it turns out that it doesn't have to: testing on a borrowed machine I find that Windows on Arm's msiexec.exe is quite happy to take MSIs whose platform field in the _SummaryInformation table says "Intel". In fact, that seemed to be _all_ that my test machine would accept: I tried taking the MSI apart with msidump, putting some other value in there (e.g. "Arm64" or "Arm") and rebuilding it with msibuild, and all I got was messages from msiexec saying "This installation package is not supported by this processor type." So in fact I just give WiX the same -arch x86 option that I give it for the real 32-bit x86 Windows installer, but then I point it at the Arm binaries, and that seems to produce a viable MSI. There is the unfortunate effect that msiexec forcibly sets the default install location to 'Program Files (x86)' no matter how I strive to make it set it any other way, but that's only cosmetic: the programs _run_ just fine no matter which Program Files directory they're installed into (and I know this won't be the first piece of software that installs itself into the wrong one). Perhaps some day we can find a way to do that part better. On general principles of caution (and of not really wanting to force Arm machines to emulate x86 code at all), the Arm versions of the installers have the new DllOk=no flag, so they're pure MSI with no embedded DLLs. --- Buildscr | 12 ++++++--- windows/installer.wxs | 60 +++++++++++++++++++++++++++++++++++++------ 2 files changed, 61 insertions(+), 11 deletions(-) diff --git a/Buildscr b/Buildscr index d326da8b..5f67d065 100644 --- a/Buildscr +++ b/Buildscr @@ -88,6 +88,8 @@ ifneq "$(SNAPSHOT)" "" set Isuffix $(Date)-installer ifeq "$(RELEASE)$(PRERELEASE)$(SNAPSHOT)" "" set Isuffix custom-$(Date)-installer set Ifilename32 putty-$(Isuffix) set Ifilename64 putty-64bit-$(Isuffix) +set Ifilenamea32 putty-arm32-$(Isuffix) +set Ifilenamea64 putty-arm64-$(Isuffix) # Set up the version string for the Windows installer. ifneq "$(RELEASE)" "" set Iversion $(RELEASE) @@ -195,11 +197,13 @@ in putty/windows do make -f Makefile.clangcl BUILDDIR=buildold/ cleantestprogs ifneq "$(cross_winsigncode)" "" in putty/windows do $(cross_winsigncode) -N -i https://www.chiark.greenend.org.uk/~sgtatham/putty/ build*/*.exe abuild*/*.exe # Build a WiX MSI installer, for each of build32 and build64. -in putty/windows with wixonlinux do candle -arch x86 -dWin64=no -dDllOk=yes -dBuilddir=build32/ -dWinver="$(Winver)" -dPuttytextver="$(Puttytextver)" installer.wxs && light -ext WixUIExtension -ext WixUtilExtension -sval installer.wixobj -o installer32.msi -spdb -in putty/windows with wixonlinux do candle -arch x64 -dWin64=yes -dDllOk=yes -dBuilddir=build64/ -dWinver="$(Winver)" -dPuttytextver="$(Puttytextver)" installer.wxs && light -ext WixUIExtension -ext WixUtilExtension -sval installer.wixobj -o installer64.msi -spdb +in putty/windows with wixonlinux do candle -arch x86 -dRealPlatform=x86 -dDllOk=yes -dBuilddir=build32/ -dWinver="$(Winver)" -dPuttytextver="$(Puttytextver)" installer.wxs && light -ext WixUIExtension -ext WixUtilExtension -sval installer.wixobj -o installer32.msi -spdb +in putty/windows with wixonlinux do candle -arch x64 -dRealPlatform=x64 -dDllOk=yes -dBuilddir=build64/ -dWinver="$(Winver)" -dPuttytextver="$(Puttytextver)" installer.wxs && light -ext WixUIExtension -ext WixUtilExtension -sval installer.wixobj -o installer64.msi -spdb +in putty/windows with wixonlinux do candle -arch x86 -dRealPlatform=Arm -dDllOk=no -dBuilddir=abuild32/ -dWinver="$(Winver)" -dPuttytextver="$(Puttytextver)" installer.wxs && light -ext WixUIExtension -ext WixUtilExtension -sval installer.wixobj -o installera32.msi -spdb +in putty/windows with wixonlinux do candle -arch x86 -dRealPlatform=Arm64 -dDllOk=no -dBuilddir=abuild64/ -dWinver="$(Winver)" -dPuttytextver="$(Puttytextver)" installer.wxs && light -ext WixUIExtension -ext WixUtilExtension -sval installer.wixobj -o installera64.msi -spdb # Sign the Windows installers. -ifneq "$(cross_winsigncode)" "" in putty/windows do $(cross_winsigncode) -i https://www.chiark.greenend.org.uk/~sgtatham/putty/ -n "PuTTY Installer" installer32.msi installer64.msi +ifneq "$(cross_winsigncode)" "" in putty/windows do $(cross_winsigncode) -i https://www.chiark.greenend.org.uk/~sgtatham/putty/ -n "PuTTY Installer" installer32.msi installer64.msi installera32.msi installera64.msi in putty/doc do make mostlyclean in putty/doc do make $(Docmakever) -j$(nproc) @@ -219,6 +223,8 @@ deliver putty/windows/build64/*.exe putty/w64/$@ deliver putty/windows/build64/putty.zip putty/w64/$@ deliver putty/windows/installer32.msi putty/w32/$(Ifilename32).msi deliver putty/windows/installer64.msi putty/w64/$(Ifilename64).msi +deliver putty/windows/installera32.msi putty/wa32/$(Ifilenamea32).msi +deliver putty/windows/installera64.msi putty/wa64/$(Ifilenamea64).msi deliver putty/windows/abuild32/*.exe putty/wa32/$@ deliver putty/windows/abuild32/putty.zip putty/wa32/$@ deliver putty/windows/abuild64/*.exe putty/wa64/$@ diff --git a/windows/installer.wxs b/windows/installer.wxs index 8ef1d44a..47da2c9e 100644 --- a/windows/installer.wxs +++ b/windows/installer.wxs @@ -2,11 +2,24 @@ - + - + + + + + + + + + + + + + + @@ -22,11 +35,8 @@ - - - - - + + @@ -42,6 +52,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -63,7 +107,7 @@ Buildscr. -->