是否可以将 .png 图像用于 WiX 位图
我使用 2 500K 位图在 WiX 对话框上显示图像。
它们极大地增加了安装包的大小,更糟糕的是 - 看起来没有办法将它们打包为 .cab 文件的一部分,因为它们是
-es WiX 条款。
所以,我想,有没有办法使用其他文件格式作为位图,或者 WiX 与 BMP 绑定在一起? 理想情况下,如果有办法使用 .png 格式那就太好了,因为它带有松散压缩选项。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
位图控件 的 Windows Installer 文档指出图像应该是“位图”——大概是 .BMP 文件——或 JPEG。
您必须记住,在使用 WiX 时,它是基于 Windows Installer 的。 这意味着 WiX 中的任何限制通常都是由底层 Windows Installer 实现的限制引起的。
.BMP 文件可以进行 RLE 压缩。 我不知道他们是否支持任何其他压缩算法。
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.
WiX 工具集不受 BMP 和 JPG 的束缚。 正如您所发现的,您可以将任何其他图像格式放入您的包中。 但是,MSI SDK 仅记录了 BMP 和 JPG 支持。
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.
是的,如果您只需要在 Windows 8 或更高版本上安装。 来自位图控件:
Yes, if you only need to install on Windows 8 or later. From Bitmap Control:
正如其他答案中所述,图像格式限制来自 Microsoft 的 MSI 实现,而不是来自 WiX。 虽然从 Windows 7 开始似乎支持
.jpeg
,从 Windows 8 开始支持PNG
,但请务必小心您使用的格式。 您的权衡是安装程序的外观。我的经验表明,确保最终安装程序正确显示图像的唯一可靠方法是使用未压缩的
BMP
。 就是这样! 是的,我知道他们会扩大最终文件的大小,但是,嘿,就像微软的其他事情一样,他们已经落后了很多年,而且没有办法解决这个问题。因此,如果您不希望安装程序在 Windows XP 或 Vista 上显示灰色方块而不是图形,请不要使用原始
.bmp
格式以外的任何格式。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, andPNG
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.