将文本颜色更改为Wix对话框 [英] Changing text color to Wix dialogs
问题描述
我是使用Wix创建安装程序的新手,我设法完成了所有工作,并且安装程序正在按预期运行.我唯一遇到的问题是,我为WixUI_Minimal对话框使用了背景和横幅图像,这些图像是深色图像,因此由于文本的颜色是黑色,所以现在正在显示某些文本.
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默认GUI设置 :DLL 中包含默认的WiX MSI GUI. WixUIExtension.dll
.通常,您只需在WiX项目中添加对此文件的引用,然后指定 默认的WiX GUI集 (例如 <UIRef Id="WixUI_Mondo" />
或 <UIRef Id="WixUI_Minimal" />
)-足够了.可以在%ProgramFiles(X86)%下的WiX主安装目录中找到 WixUIExtension.dll
文件.
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)内置的WiX对话框自定义 :有一些方法可以略微更改这些WiX设置对话框.此处描述了整个方法: 自定义内置WixUI对话框集 .我认为这足以满足您的目的.可能的调整:1)指定特定于产品的许可协议文件. 2)指定特定于产品的设置UI位图. 3)在ExitDlg中添加一个可选的复选框和可选的文本. 4)自定义内置对话框中显示的文本. 5)更改内置对话框集的UI顺序. 6)将自定义对话框插入内置对话框集.
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)更改默认对话框-高级对话框 :除了通过上述方法对对话框进行一些自定义外,有时还需要进行大规模更改.然后,您需要将对话框源文件复制到您的项目文件夹中,然后根据需要对其进行置换.这有点涉及,但火箭科学没有涉及. 您只需将WiX对话框源文件复制到项目文件夹中一个>.我认为这对于您的目的不是必需的.我将尝试找出一个描述该过程的链接.
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.
- 单个新MSI的详细自定义WiX对话框.
- 真的找不到很好的方法链接.
- 这可以了,但是我必须删除一个过时的链接.也许检查底部的github.com链接?
- WiX创作者Rob Mensching的建议是基于现有对话框.只需复制并更改它,为其赋予新的名称和身份即可.
- 最后记住了尼尔·斯利特霍尔姆的博客条目.
- Detailed customization of a single, new MSI dialog using WiX.
- Couldn't really find a good how-to link.
- This one is OK, but I had to remove an obsolete link. Maybe check the github.com link at the bottom?
- WiX creator Rob Mensching's advice is to base yourself on an existing dialog. Just copy it and change it, giving it a new name and identity.
- Finally remembered Neil Sleightholm's blog entry.
3)外部GUI :记录一下,您可以通过以下方式有效地使用自己的内置MSI GUI替换内置的MSI GUI: MsiSetExternalUI函数. WiX引导程序使用它来允许用户实施自己的设置GUI.
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.
- 此答案中的示例 (略过所有答案?).
- WiX的刻录功能 (引导程序等),可以使用这样的外部GUI.我认为,请检查该链接以获取有关Burn和外部UI的相当不错的解释. Bootstrapper应用程序.
- 如何使用WiX,高级安装程序和Installshield都允许外部GUI具有比内置MSI GUI更高级的功能. 更多相同内容.
- Examples in this answer (skim all answers?).
- WiX's Burn feature (bootstrapper and more), can use such an external GUI. Check that link for a fairly decent explanation of Burn and external UI - I think. The Bootstrapper Application.
- How WiX, Advanced Installer & Installshield all allow external GUIs with more advanced features than the built-in MSI GUI. More on the same.
建议的方法 :出于您的目的,我会向您的项目中添加一个本地化文件(除非您已经有一个本地化文件):
Right Click WiX Project
=>Add
=>New Item...
=>确保在左窗格中选择了WiX 3
=>Double click "Localization File"
.在WiX本地化文件中,覆盖要覆盖的字符串.这是在新的WiX本地化文件(*.wxl
)中指定的WelcomeEulaDlg's
"Title"
字符串: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 sureWiX 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 theWelcomeEulaDlg's
"Title"
string specified in your new WiX localization file (*.wxl
):<String Id="WelcomeEulaDlgTitle">{\Test}This is my custom string3!</String>
在您的项目文件中:
<UI> <UIRef Id="WixUI_Minimal" /> <TextStyle Id="Test" FaceName="Arial" Blue="255" Size="12" Strike="yes" /> </UI>
设置颜色的线索是
TextStyle element
.您可以操纵Red
,Blue
和Green
属性以获得所需的颜色.可以在以下WiX git存储库中找到有问题的对话框:The clue to set color is the
TextStyle element
. You manipulate theRed
,Blue
andGreen
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 addTextStyle
identifiers as appropriate. Here is the actual dialog once compiled:为方便起见 :
For convenience:
- WiX GUI设置和文件(所有文件).
- WixUI_Minimal.wxs /a>.
- 和所有可本地化的字符串WiX GUI . 在内置对话框中自定义文本"下引用的
WixUI_en-us.wxl
文件/v3/wixui/wixui_customizations.html"rel =" nofollow noreferrer> WiX对话框自定义文档.
- The WiX GUI sets and files (all files).
- The WixUI_Minimal.wxs dialog set.
- And all the localizable strings for the WiX GUI. The
WixUI_en-us.wxl
file referred to under "Customizing the text in built-in dialogs" in the WiX Dialog Customization Documentation.
在编写完上面的代码后发现了这一点,但在没有屏幕截图的情况下,它的形式更加紧凑:
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屋!