wixtoolset / issues

WiX Toolset Issues Tracker
http://wixtoolset.org/
129 stars 36 forks source link

Default dialog background doesn't respect high contrast colors #5961

Open DaveTryon opened 5 years ago

DaveTryon commented 5 years ago

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:

BMurri commented 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.

barnson commented 5 years ago

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.

chrpai commented 5 years ago

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)

sgtatham commented 4 years ago

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.

barnson commented 3 years ago

Investigate UI compiler extension and different layouts to avoid "full-screen" images.

Manishd79 commented 2 years ago

@sgtatham your solution really works! thanks!

gdams commented 1 year ago

@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

sgtatham commented 1 year ago

@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.

barnson commented 1 year ago

https://www.joyofsetup.com/2012/07/14/localizing-more-than-strings-in-wix-v3-6/

sgtatham commented 1 year ago

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!

msftedad commented 10 months ago

Hi @barnson, could you please provide the tentative ETA for fixing this issue?

chrpai commented 10 months ago

@msftedad this should answer your question. https://github.com/orgs/wixtoolset/discussions/7446

msftedad commented 8 months ago

Hi @barnson, Is there any update on this issue

wmanning commented 8 months ago

@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.