11

I am using 2 500K bitmaps in to display images on my WiX dialogs.

They dramatically increase the size of the installation package, and what is worse - it looks there's no way to package them as a part of a .cab file since they're <binary>-es in the WiX terms.

So, I thught, is there any way to use other file formats for bitmaps or WiX is tethered with BMP? Ideally it would be greate if there's a way to use .png format since it comes with a looseless compression option.

Roger Lipscombe
  • 89,048
  • 55
  • 235
  • 380
user48829
  • 249
  • 4
  • 10

4 Answers4

14

The Windows Installer documentation for the Bitmap control states that the image should be a "bitmap" -- presumably a .BMP file -- or a JPEG.

You have to remember, when working with WiX, that it's based on Windows Installer. This means that any limitations in WiX are often caused by limitations in the underlying Windows Installer implementation.

.BMP files can be RLE-compressed. I don't know if they support any other compression algorithms.

Roger Lipscombe
  • 89,048
  • 55
  • 235
  • 380
  • 1
    I had tried to use RLE-compressd .BMP-s but to do so I had have to decrease color depth to 256 and the results (a picture's quality) were far from satisfactional. Thank you. – user48829 Dec 25 '08 at 11:01
  • @user48829; the interesting thing is that, in the documentation, it seems that the Bitmap control now supports .PNG images on win8. :P – Erti-Chris Eelmaa Nov 16 '14 at 12:20
  • 1
    I would also stay away from `jpeg` or compressed `bmp`. Read [my answer](http://stackoverflow.com/a/38578388/670017) for details. – ahmd0 Jul 25 '16 at 22:33
8

The WiX toolset isn't tethered to BMP and JPG. As you've found you could put any of those other image formats into your package. However, the MSI SDK only documents BMP and JPG support.

Rob Mensching
  • 33,834
  • 5
  • 90
  • 130
  • Obviously, I'm not going to doubt you, Rob. That said: can you clarify this? I was under the impression that the MSI controls were the built-in ones, and that WiX couldn't do much else with them. That said, the OP didn't specifically talk about controls, but... – Roger Lipscombe Dec 25 '08 at 20:54
  • 3
    Roger, I was just trying to separate MSI from WiX. WiX will allow you to store whatever in the Binary table even though MSI will only render BMP and JPG. Why would you want to store a PNG in the Binary table? I don't know but it isn't WiX's fault it won't render in the UI. – Rob Mensching Jan 13 '09 at 01:06
  • 1
    Looks like Windows 8(.1) added support for PNG – Jesan Fafon Jan 22 '15 at 22:51
4

Yes, if you only need to install on Windows 8 or later. From Bitmap Control:

Windows 8 and Windows Server 2012: The image file can be in any standard format supported by the Windows Imaging Component (WIC), including TIFF, JPEG, PNG, GIF, BMP, and HDPhoto. The control does not support animation.

Doug Richardson
  • 10,483
  • 6
  • 51
  • 77
1

As was stated in other answers the image format limitation comes from Microsoft's implementation of MSI, and not from WiX. Although .jpeg seems to be supported starting from Windows 7, and PNG starting from Windows 8, be very careful about the format you use. Your trade-off is the look of your installer.

My experience showed that the only reliable way to ensure that your resulting installer displays your images correctly is to use uncompressed BMPs. And that is it! Yes, I know they balloon the size of the final file, but, hey, like everything else with Microsoft they are ages behind and there's no way around it.

So if you don't want to have your installer to display gray squares on Windows XP or Vista instead of your graphics, don't use anything other than raw .bmp format.

ahmd0
  • 16,633
  • 33
  • 137
  • 233