Open DaveTryon opened 5 years ago
Windows platforms downlevel from Windows 8 and Windows Server 2012 (e.g. Windows 7) do not support transparency in image files, so simply replacing these files with PNGs with transparency won't help until we drop support for Win7.
We can't break Windows 7 compatibility and there's a workaround in that you can always specify your own bitmap. For WiX v4, the best fix is probably to redo the dialog authoring to avoid having the big bitmap cover the whole dialog.
I wonder if WiXUI could have two sets of images for <=win7 and >win7. Kinda like how we had to have dual dialogs when Windows introduced the hyperlink control (<5.0 >=5.0)
I ran across this same problem myself this week, and solved it a different way.
There's no actual need to make the dialog background image partially transparent. All you have to do is to not make it cover the whole dialog box. Instead of having a 493×312 image of which only the leftmost 164 pixels contain anything interesting, just make the image 164×312 in the first place, and adjust the Width
attribute in the Control
element that puts it on the dialog so as not to try to stretch it to the full width. Then the system-standard dialog background colour is visible under the text, in a way that doesn't depend on support for fancy bitmap image features.
Investigate UI compiler extension and different layouts to avoid "full-screen" images.
@sgtatham your solution really works! thanks!
@sgtatham / @Manishd79 any help would be most appreciated here. Currently, I set my images like this:
<WixVariable Id="WixUIDialogBmp" Value="{vendor_branding_dialog}" />
<WixVariable Id="WixUIBannerBmp" Value="{vendor_branding_banner}" />
How would I adjust the Width
attribute? If it helps the wxs template that I use is here
@gdams, I'm afraid I cheat a bit here. I don't write WiX input describing my dialog box with a background image covering only part of it, because the dialog template is in the WiX standard library and I'd rather not take an entire copy of it just to modify that one detail.
Instead, I modify the MSI file after it's gone through WiX, by unpacking it and repacking it using GNOME msitools, and in between, editing the MSI database tables while they're in the reasonably convenient .idt
format consisting of textual tab-separated-values.
Here's a link to my fixup script in git. It's doing another job too (editing the platform field in SummaryInformation), but the important part starts at line 42, where it identifies a line in Control.idt
that mentions WixUI_Bmp_Dialog
, and edits the width field.
So my approach is to define WixUIDialogBmp
in my .wxs
source file, just like you, but I define it to an image that's only wide enough to cover the left side of the dialog box. And then I use that script after WiX has run, to adjust the width field to match.
I think that in the WiX source code the thing that gives rise to that database record is something like this
<Control Id="Bitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="234" TabSkip="no" Text="!(loc.WelcomeDlgBitmap)" />
(where WelcomeDlgBitmap
is defined elsewhere to WixUI_Bmp_Dialog
, which is in turn defined to WixUIDialogBmp
which the user has defined in their script). So if I were including my own custom dialog definition, I'd expect to be able to edit that Control
line directly to specify the width of my bitmap. But in fact I'm using the standard WelcomeDlg
from the Wix UI extension, and tweaking it after compilation.
Oh yes, that works too, although I'd never have thought to look for it there!
To spell it out in full in case @gdams or anyone else finds it useful, I was able to get the same effect as my Python/msitools postprocessing of the Control
table by making this file installer.wxl
:
<?xml version="1.0" encoding="utf-8"?>
<WixLocalization xmlns="http://schemas.microsoft.com/wix/2006/localization">
<UI Dialog="ExitDialog" Control="Bitmap" Width="123" />
<UI Dialog="FatalError" Control="Bitmap" Width="123" />
<UI Dialog="MaintenanceWelcomeDlg" Control="Bitmap" Width="123" />
<UI Dialog="PrepareDlg" Control="Bitmap" Width="123" />
<UI Dialog="ResumeDlg" Control="Bitmap" Width="123" />
<UI Dialog="UserExit" Control="Bitmap" Width="123" />
<UI Dialog="WelcomeDlg" Control="Bitmap" Width="123" />
</WixLocalization>
and adding -loc installer.wxl
to my light
command line.
Thanks for the tip. But I think I'll stick with my Python script now I have it, because it doesn't require me to mention every individual dialog box by name – I can tell the script to just find any use of WixUI_Bmp_Dialog
and adjust them all the same way, and then if I change the set of dialogs used in the installer, I don't have to remember to update it somewhere else too.
In particular, if anyone else copy-pastes this, then they'll have to make sure their list of WixUI dialogs is complete for their particular installer!
Hi @barnson, could you please provide the tentative ETA for fixing this issue?
@msftedad this should answer your question. https://github.com/orgs/wixtoolset/discussions/7446
Hi @barnson, Is there any update on this issue
@msftedat FYI. You can see at the top of this page that the issue is not assigned to anyone and is tagged as "up for grabs" which means nothing is being done on it.
Please provide answers to the following questions to help us narrow down, reproduce, and fix the problem. Fill out one section and delete the others.
Triage
Issues are triaged at online meetings, generally held alternate Tuesdays at 9:30 a.m. Pacific time (UTC-7/UTC-8). Meeting requests are sent to the wix-devs mailing list.
Discussions and support
Note that discussions are best held on the mailing lists, not in issues. Please do not open issues requesting support or debugging help; first start a thread on the wix-users mailing list and open an issue if the discussion suggests a bug in the WiX Toolset or that a feature request is appropriate.
Bugs
If this issue is a bug:
Which version of WiX are you building with? WiX Toolset v3.11.1.2318
Which version of Visual Studio are you building with (if any)? VS 2017, version 15.9.6
Which version of the WiX Toolset Visual Studio Extension are you building with (if any)? N/A
Which version of .NET are you building with? 4.7.1
If the problem occurs when installing your packages built with WiX, what is the version of Windows the package is running on? Windows 10 (but will occur on others, as well)
Describe the problem and the steps to reproduce it. 1) Build any WiX project using the default background bitmap 2) Run the MSI in one of the OS's High Contrast themes that are based on black 3) Try to read the text in the dialog--it's light text on a white background, so it's almost impossible.
This issue has been reported several times, but never fixed. There seems to be an assumption that it's a windows bug, but that is incorrect. The real problem here is that the bitmap used for the dialog background (see WixUI_Bmp_Dialog.jpg, attached) has an opaque white background. This background gets drawn over the default window color, meaning that the window color is effectively ignored. The fix is to replace the current bitmap with bitmap of the same size, but with a transparent dialog background (see Transparent.jpg, attached). I've successfully used this in my local build by adding
<WixVariable Id="WixUIDialogBmp" Value="Resources\Transparent.png" />
in my wxs file, but that wouldn't be necessary if the default bitmap were transparent to begin with.