0

I have a custom MSI dialog in my wxs file:

<Dialog Id="OpDialog" Width="300" Height="250" Title="[ProductName]: Operations">
    ...
</Dialog>

How can I set its background to some image file (bmp/png/...)?

Tar
  • 8,529
  • 9
  • 56
  • 127

1 Answers1

1

Quick Link: Hotlinking (direct link) a single page from WiX's own tutorial (also check the other pages): https://www.firegiant.com/wix/tutorial/user-interface-revisited/tuning-up/

Sample WiX Markup Download: SampleCustomUI

Not sure how this all behaves on high DPI screens.


Generic Trick: The WiX toolkit dark.exe tool can decompile an MSI file (dark.exe -x Output File.msi). You can use the decompiled files to figure out syntax that is poorly documented. I decompiled an MSI and combining it with the samples I linked to, you can try something like this (this does not show how to insert the dialog into a sequence, and I am not sure all constructs are good, but it compiles OK):

<!--<Binary Id="bannerbmp" SourceFile="Banner.bmp" />-->
<Binary Id="imagebmp" SourceFile="Image.bmp" />

<!--<Property Id="BannerBitmap">bannerbmp</Property>-->
<Property Id="ImageBitmap">imagebmp</Property>

<Dialog Id="ServerDlg" Width="370" Height="270" Title="Dialog Title">
  <!--<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="[BannerBitmap]" />-->
  <Control Id="Image" Type="Bitmap" X="0" Y="0" Width="374" Height="234" TabSkip="yes" Disabled="yes" Text="[ImageBitmap]" />

  <..>

</Dialog>
  • Note that the above has a BannerBitmap (that is the one at the top going across the dialog) disabled and the whole dialog is now covered by the main image ImageBitmap.
  • You can toggle the banner on easily if that is what you want to use. Just comment out the large image and enable the top banner.
  • The above does not show proper localization - if you want to use localization files for translation.
  • The above was simplified, I took out the WixVariable entry, see revision history if you want to see.

Documentation: WiX documentation on GUI customization: https://wixtoolset.org/documentation/manual/v3/wixui/wixui_customizations.html

Tutorial: https://www.firegiant.com/wix/tutorial/user-interface-revisited/a-single-dialog/


More Details: Adding a link to a larger description of WiX GUI. Shows various tricks with WiX and MSI GUI.

Samples: Maybe some practical samples?

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
  • I found nothing related to **custom MSI dialog** background image. I learned a lot about styling text, which was very beneficial (and took advantage of), but nothing about background. Again - these links only tell you how to change the **default dialogs** background, not the **custom** dialogs. – Tar Sep 20 '19 at 15:22
  • OK, it was a bit rushed last night, have a quick look at the updates please. – Stein Åsmul Sep 20 '19 at 16:52