Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mRemoteNG/PuTTYNG.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2020-02-11 22:11:02 +0300
committerSimon Tatham <anakin@pobox.com>2020-02-11 22:12:01 +0300
commitf3b2c0f20914d96e8cb84365f78dd78884c67fff (patch)
treeb06512f125682fe8099748babac7e04ceac83bc5 /Buildscr
parent125ddd131c04a2426174914cf933113526363c7a (diff)
Remove white dialog background in MSI user interface.
We received a report that if you enable Windows 10's high-contrast mode, the text in PuTTY's installer UI becomes invisible, because it's displayed in the system default foreground colour against a background of the white right-hand side of our 'msidialog.bmp' image. That's fine when the system default fg is black, but high-contrast mode flips it to white, and now you have white on white text, oops. Some research in the WiX bug tracker suggests that in Windows 10 you don't actually have to use BMP files for your installer images any more: you can use PNG, and PNGs can be transparent. However, someone else reported that that only works in up-to-date versions of Windows. And in fact there's no need to go that far. A more elegant answer is to simply not cover the whole dialog box with our background image in the first place. I've reduced the size of the background image so that it _only_ contains the pretty picture on the left-hand side, and omits the big white rectangle that used to sit under the text. So now the RHS of the dialog is not covered by any image at all, which has the same effect as it being covered with a transparent image, except that it doesn't require transparency support from msiexec. Either way, the background for the text ends up being the system's default dialog-box background, in the absence of any images or controls placed on top of it - so when the high-contrast mode is enabled, it flips to black at the same time as the text flips to white, and everything works as it should. The slight snag is that the pre-cooked WiX UI dialog specifications let you override the background image itself, but not the Width and Height fields in the control specifications that refer to them. So if you just try to drop in a narrow image in the most obvious way, it gets stretched across the whole window. But that's not a show-stopper, because we're not 100% dependent on getting WiX to produce exactly the right output. We already have the technology to postprocess the MSI _after_ it comes out of WiX: we're using it to fiddle the target-platform field for the Windows on Arm installers. So all I had to do was to turn msiplatform.py into a more general msifixup.py, add a second option to change the width of the dialog background image, and run it on the x86 installers as well as the Arm ones.
Diffstat (limited to 'Buildscr')
-rw-r--r--Buildscr21
1 files changed, 15 insertions, 6 deletions
diff --git a/Buildscr b/Buildscr
index 5ab0f145..77a82e50 100644
--- a/Buildscr
+++ b/Buildscr
@@ -152,8 +152,7 @@ in putty do perl -i~ -pe 'y/\015//d;s/$$/\015/' LICENCE
# Some gratuitous theming for the MSI installer UI.
in putty/icons do make -j$(nproc)
-in putty do convert -size 164x312 'gradient:blue-white' -distort SRT -90 -swirl 180 \( -size 329x312 canvas:white \) +append \( icons/putty-48.png -geometry +28+24 \) -composite \( icons/pscp-48.png -geometry +88+96 \) -composite \( icons/puttygen-48.png -geometry +28+168 \) -composite \( icons/pageant-48.png -geometry +88+240 \) -composite windows/msidialog.bmp
-in putty do convert -size 493x58 canvas:white \( icons/putty-48.png -geometry +440+5 \) -composite windows/msibanner.bmp
+in putty do ./windows/make_install_images.sh
mkdir putty/windows/build32
mkdir putty/windows/build64
@@ -200,10 +199,20 @@ in putty/windows with wixonlinux do candle -arch x64 -dRealPlatform=x64 -dDllOk=
in putty/windows with wixonlinux do candle -arch x64 -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 x64 -dRealPlatform=Arm64 -dDllOk=no -dBuilddir=abuild64/ -dWinver="$(Winver)" -dPuttytextver="$(Puttytextver)" installer.wxs && light -ext WixUIExtension -ext WixUtilExtension -sval installer.wixobj -o installera64.msi -spdb
-# Bodge the platform fields for the Windows on Arm installers, since
-# WiX 3 doesn't understand Arm platform names itself.
-in putty/windows do ./msiplatform.py installera32.msi Arm
-in putty/windows do ./msiplatform.py installera64.msi Arm64
+# Change the width field for our dialog background image so that it
+# doesn't stretch across the whole dialog. (WiX's default one does; we
+# replace it with a narrow one so that the text to the right of it
+# shows up on system default background colour, meaning that
+# high-contrast mode doesn't make the text white on white. But that
+# means we also have to modify the width field, and there's nothing in
+# WiX's source syntax to make that happen.)
+#
+# Also bodge the platform fields for the Windows on Arm installers,
+# since WiX 3 doesn't understand Arm platform names itself.
+in putty/windows do ./msifixup.py installer32.msi --dialog-bmp-width=123
+in putty/windows do ./msifixup.py installer64.msi --dialog-bmp-width=123
+in putty/windows do ./msifixup.py installera32.msi --dialog-bmp-width=123 --platform=Arm
+in putty/windows do ./msifixup.py installera64.msi --dialog-bmp-width=123 --platform=Arm64
# 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 installera32.msi installera64.msi