如何将图像背景添加到自定义 MSI 对话框? [英] How to add image background to custom MSI dialog?
问题描述
我的 wxs
文件中有一个自定义的 MSI 对话框:
I have a custom MSI dialog in my wxs
file:
<Dialog Id="OpDialog" Width="300" Height="250" Title="[ProductName]: Operations">
...
</Dialog>
如何将其背景设置为某个图像文件 (bmp/png/...)?
How can I set its background to some image file (bmp/png/...)?
推荐答案
快速链接:从 WiX 自己的教程中盗链(直接链接)单个页面(另请查看其他页面):https://www.firegiant.com/wix/tutorial/user-interface-revisited/tuning-up/
示例 WiX 标记下载:SampleCustomUI
Sample WiX Markup Download: SampleCustomUI
不确定这一切在高 DPI 屏幕上的表现如何.
Not sure how this all behaves on high DPI screens.
<小时>
Generic Trick:WiX 工具包 dark.exe
工具可以反编译 MSI 文件(dark.exe -x 输出文件.msi
).您可以使用反编译的文件来找出文档不足的语法.我反编译了一个 MSI 并将它与我链接到的样本结合起来,你可以尝试这样的事情(这并没有显示如何将对话框插入到一个序列中,我不确定所有的结构都很好,但它编译正常):
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>
- 请注意,上面的 BannerBitmap(即穿过对话框顶部的那个)被禁用,整个对话框现在被主图像 ImageBitmap 覆盖.
- 如果您想使用横幅,您可以轻松地打开横幅.只需注释掉大图并启用顶部横幅即可.
- 以上未显示正确的本地化 - 如果您想使用本地化文件进行翻译.
- 上面简化了,我把WixVariable条目取出来了,如果你想看,可以查看修订历史.
- 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.
- https://helgeklein.com/blog/2014/09/real-world-example-wix-msi-application-installer
- 在github上找到了一个相当随机的样本com - .
文档:关于 GUI 自定义的 WiX 文档:https://wixtoolset.org/documentation/manual/v3/wixui/wixui_customizations.html
教程:https://www.firegiant.com/wix/tutorial/user-interface-revisited/a-single-dialog/
更多详细信息:添加指向 WiX GUI 更详细说明的链接.展示了 WiX 和 MSI GUI 的各种技巧.
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?
这篇关于如何将图像背景添加到自定义 MSI 对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!