2013-07-10 102 views
2

我使用的是来自Windows Installer XML CommonUi Extension的Windows服务对话框。使用WiX扩展自定义字体

我在标题文本背后有一个深色的横幅位图,所以我想更改标题字体的颜色。我尝试添加这对我.wxs:

<TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="8" Blue="255" Red="255" Green="255" /> 

此作品,未经扩展,但现在我使用的扩展我得到这个错误:

The primary key 'WixUI_Font_Title' is duplicated in table 'TextStyle'. Please remove one of the entries or rename a part of the primary key to avoid the collision.

我怎样才能改变字体?


编辑:

<TextStyle Id="My_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" Blue="255" Red="255" Green="255" /> 

,然后添加自定义字符串到.wxl文件,覆盖源文件使用相同的:我在哈克的方式通过添加文字样式,以这样的UI部分解决了这个文字,但也有字体设置。

<String Id="ProgressDlgTitleInstalling">{\My_Font_Title}Installing [ProductName]</String> 
    <String Id="ProgressDlgTitleChanging">{\My_Font_Title}Changing [ProductName]</String> 
    <String Id="ProgressDlgTitleRepairing">{\My_Font_Title}Repairing [ProductName]</String> 
    <String Id="ProgressDlgTitleRemoving">{\My_Font_Title}Removing [ProductName]</String> 

我在找到适当的方式做到这一点的,希望加入悬赏的问题。

回答

1

目前无法覆盖TextStyle元素。要么保持当前的处理方式,要么在MSI后期构建中执行SQL查询以更新WixUI_Font_Title TextStyle条目。

在MSI文档(doc \ msi.chm,如果您已安装WiX)下,在MSI下的Execute SQL Statements上有一个MSI执行SQL的帮助页面。当然,您可以使用MSI API或DTF代替脚本。

你的更新语句应该是这样的:

UPDATE `TextStyle` SET `Color` = 16777215 WHERE `TextStyle` = 'WixUI_Font_Title' 

documentation中有这样一段对Color柱说:

The value put in this column should be computed using the following formula: 65536 * blue + 256 * green + red, where red, green, and blue are each in the range of 0-255.

+0

谢谢你,是一个非常详细的解答。为了在没有安装WiX的情况下阅读任何人的益处,帮助文件中的页面也可在此处在线获取:http://msdn.microsoft.com/en-us/library/windows/desktop/aa368568(v=vs.85 )的.aspx –

相关问题