当前位置: 动力学知识库 > 问答 > 编程问答 >

Why do my MSI images look corrupted when using WiX?

问题描述:

I'm setting a custom banner and dialog image for my WiX generated MSI.

<WixVariable Id="WixUIBannerBmp" Value="./build/msi/InstallerBanner.jpg" />

<WixVariable Id="WixUIDialogBmp" Value="./build/msi/InstallerDialog.jpg" />

For some reason, the image becomes corrupted when built into the MSI. I've added the two images to my question for easy comparison. I've tried BMP and JPEG with a whole range of compression types - and they all look exactly the same. I can verify that I'm using exactly the correct image dimensions (500 by 63 pixels).

Here's the original image:

Original image http://img193.imageshack.us/img193/7016/installerbanner.jpg

And here's what it looks like in the MSI:

Image in use - 1 http://img26.imageshack.us/img26/2996/bannerinuse.jpg

Update:

Thanks for your answers, I got the wrong dimensions from a tutorial, that's actually very out dated and (apparently) very inaccurate. Never the less, it's a good hacking resource. I'll stick to the manual in future!

网友答案:

Your image is too big dimension-wise. Banner Images must be 493 × 58 and your image is 500 × 63, causing it to be resized.

See Customizing Built-in WixUI Dialog Sets

By the way: nice to see Synergy2 is finally getting an update!

网友答案:

Andrew's right. It's covered in wix.chm.

Those are the wrong dimensions. From the relevant wix documentation topic:

Replacing the default bitmaps

The WixUI dialog library includes default bitmaps for the background of the welcome and completion dialogs and the top banner of the other dialogs. You can replace those bitmaps with your own for product branding purposes. To replace default bitmaps, specify WiX variable values with the file names of your bitmaps, just like when replacing the default license text.

Variable name / Description / Dimensions:

  • WixUIBannerBmp / Top banner / 493 × 58
  • WixUIDialogBmp / Background bitmap used on the welcome and completion dialogs / 493 × 312
  • WixUIExclamationIco / Exclamation icon on the WaitForCostingDlg / 32 × 32
  • WixUIInfoIco / Information icon on the cancel and error dialogs / 32 × 32
  • WixUINewIco / Button glyph on the / BrowseDlg 16 × 16
  • WixUIUpIco / Button glyph on the BrowseDlg / 16 × 16
网友答案:

Using WiX ver. 3.7.1224.0 (Dec'12), I have to create an image 616 × 390 to fill the dialog and avoid stretching. The clear zone to the left of the dialog text is 234 pixels wide.

The banner is still 493 × 58.

网友答案:

I found that to customize the WixUIDialogBmp for WiX 3.5, the dimensions must be 493x312 pixels. So, to make the banner only appear in the left 164 pixels of the dialog box, fill the right 329 pixels with white pixels. Then it should display correctly.

分享给朋友:
您可能感兴趣的文章:
随机阅读: