将文本颜色更改为 Wix 对话框 [英] Changing text color to Wix dialogs

查看:19
本文介绍了将文本颜色更改为 Wix 对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是使用 Wix 创建安装程序的新手,我设法完成了所有工作,并且安装程序按预期工作.我遇到的唯一问题是,我为 WixUI_Minimal 对话框使用了背景和横幅图像,这些图像是深色图像,因此由于文本颜色为黑色,现在显示了一些文本.

我想知道如何根据需要将每个对话框上的文本颜色更改为另一种颜色.在许可协议的第一个屏幕中,我希望它是橙色的,在顶部横幅的安装过程中,我希望它是白色的.我怎样才能做到这一点?

解决方案

WiX 默认 GUI-Sets:默认 WiX MSI GUI 包含在 DLL WixUIExtension.dll.通常,您只需在 WiX 项目中添加对此文件的引用并指定

为了方便:

<小时>

写完上面的发现这个,在没有截图的更紧凑的形式下本质上是一样的:在标准 Wix 对话框中自定义文本

I'm new to creating installers using Wix, I managed to get it all done and the installer is working as expected. The only issue I'm having is that I'm using a background and banner image for the WixUI_Minimal dialogs and these are dark color images so some of the text is now showing since the color of the text is black.

I will like to know how to change the text color to another color on each of the dialogs depending on the needs. In the first screen where is the license agreement I want it to be orange and in the installation process in the top banner I want it to be white. How can I achieve this ?

解决方案

WiX Default GUI-Sets: The default WiX MSI GUIs are included from the DLL WixUIExtension.dll. Normally you just add a reference to this file in your WiX project and specify a default WiX GUI set such as <UIRef Id="WixUI_Mondo" /> or <UIRef Id="WixUI_Minimal" /> - and that is good enough. The WixUIExtension.dll file can be found in the main WiX installation directory under %ProgramFiles(X86)%.

1) Built-In WiX Dialog Customization: There are some ways to slightly change these WiX setup dialogs. The overall method is described here: Customizing Built-in WixUI Dialog Sets. I think it should suffice for your purpose. Possible tweaks: 1) Specifying a product-specific license agreement file. 2) Specifying product-specific setup UI bitmaps. 3) Adding an optional checkbox and optional text to the ExitDlg. 4) Customizing the text displayed in built-in dialogs. 5) Changing the UI sequence of a built-in dialog set. 6) Inserting a custom dialog into a built-in dialog set.

2) Change Default Dialogs - Advanced Dialogs: Beyond customizing the dialogs slightly by the method described above, you sometimes need large scale changes. Then you need to copy the dialog source files to your project folder, and then permute them to their needs. This is somewhat involved, but not rocket science. You simply copy the WiX dialog source files to your project folder. I don't think this is necessary for your purpose. I will try to dig up a link which describes the procedure.

3) External GUI: Just for the record, a mention of the fact that you can effectively replace the built-in MSI GUI with your own by means of the MsiSetExternalUI function. The WiX bootstrapper uses this to allow users to implement their own setup GUI.


Suggested Approach: For your purpose, I would add a localization file to your project (unless you have one already): Right Click WiX Project => Add => New Item... => Make sure WiX 3 is selected in the left pane => Double click "Localization File". In the WiX localization file, override the string you want to override. Here is the WelcomeEulaDlg's "Title" string specified in your new WiX localization file (*.wxl):

<String Id="WelcomeEulaDlgTitle">{Test}This is my custom string3!</String>

In your project file:

<UI>
  <UIRef Id="WixUI_Minimal" />
  <TextStyle Id="Test" FaceName="Arial" Blue="255" Size="12" Strike="yes" />
</UI>

The clue to set color is the TextStyle element. You manipulate the Red, Blue and Green attributes to get the color you want. The dialog in question can be found in the WiX git repository here: WelcomeEulaDlgTitle. Then you reference the TextStyle - in this case Test - in your localized string, using this funny notation: {Test}. See the string above. Update and add TextStyle identifiers as appropriate. Here is the actual dialog once compiled:

For convenience:


Found this after writing the above, it is essentially the same in a more compact form without screenshots: Customizing text in the standard Wix dialogs

这篇关于将文本颜色更改为 Wix 对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆