问题描述
我需要在标题中显示版本号以及应用程序名称.
目前看来
这是我的 wix 片段:
<Product Id="$(var.ProductId)" Name="Test Application" Language="1033" Version="$(var.ProductVersion)" Manufacturer="Test1111 Inc"UpgradeCode="C9BC6B42-FCAF-4E96-8F8F-E9D0AC4F393B">
如果我更改它(在名称属性中附加版本号),它将在标题、欢迎文本/描述的所有位置显示版本号,但我只想更改标题.
<Product Id="$(var.ProductId)" Name="测试应用程序 $(var.ProductVersion)" Language="1033" Version="$(var.ProductVersion)" Manufacturer="Test1111公司"UpgradeCode="C9BC6B42-FCAF-4E96-8F8F-E9D0AC4F393B">
我们如何在 Wix 中实现这一点?
Localization Override:可以尝试添加一个本地化文件,然后覆盖WelcomeDlgTitle
字符串(
WiX GUI:我自己对 WiX GUI 感到很困惑,因此我写了这个小概述和检查清单"以便更好地记住(使用类似的方法来更改对话框条目的样式):将文本颜色更改为 Wix 对话框.
链接:
- WiX UI 来源:(语言字符串和对话来源)
- https://github.com/wixtoolset/wix3/树/开发/src/ext/UIExtension/wixlib
- WiX UI 英文字符串:
- https://github.com/wixtoolset/wix3/blob/develop/src/ext/UIExtension/wixlib/WixUI_en-us.wxl
- WiX UI 挪威语字符串:
- https://github.com/wixtoolset/wix3/blob/develop/src/ext/UIExtension/wixlib/WixUI_nb-NO.wxl
- 有很多这样的语言文件,使用上面的链接查看完整列表
I need to display the version number in the title along with the application name.
Currently, it looks like
Here is my wix snippet:
<Product Id="$(var.ProductId)" Name="Test Application" Language="1033" Version="$(var.ProductVersion)" Manufacturer="Test1111 Inc"
UpgradeCode="C9BC6B42-FCAF-4E96-8F8F-E9D0AC4F393B">
If I change it (append version number in the Name attribute) as below, it will display the version number in all the places Title, Welcome text/description but I just want to change in Title.
<Product Id="$(var.ProductId)" Name="Test Application $(var.ProductVersion)" Language="1033" Version="$(var.ProductVersion)" Manufacturer="Test1111 Inc"
UpgradeCode="C9BC6B42-FCAF-4E96-8F8F-E9D0AC4F393B">
How we can accomplish this in Wix?
Localization Override: You can try to add a localization file and then override the WelcomeDlgTitle
string (the WiX GUI string list / list of string identifiers can be found here (for English):
- Note that this assumes the Mondo dialog set:
- Add to WiX markup:
<UIRef Id="WixUI_Mondo" />
- Add reference to
%ProgramFiles(x86)%WiX Toolset v3.11inWixUIExtension.dll
- WiX Hello World Sample in Visual Studio (WiX markup with comments towards bottom is usually enough for developers to get the gist of things)
- Add to WiX markup:
- Right click your WiX project in Visual Studio
=>
Add=>
New Item... - Select
WiX v3
in the left menu. Double clickLocalization file
(very common to add a WiX v4 file instead, double check please) Add the string below to the localization file:
<?xml version="1.0" encoding="utf-8"?> <WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization"> <String Id="WelcomeDlgTitle">{WixUI_Font_Bigger}Welcome to the [ProductName] [ProductVersion] Setup Wizard</String> </WixLocalization>
Compile and test
Sample Dialog:
WiX GUI: I am quite confused myself with WiX GUI, hence I wrote this little overview and "check list" to remember better (uses a similar approach to change the style of a dialog entry): Changing text color to Wix dialogs.
Links:
- WiX UI Sources: (languages strings and dialog sources)
- https://github.com/wixtoolset/wix3/tree/develop/src/ext/UIExtension/wixlib
- WiX UI English Strings:
- https://github.com/wixtoolset/wix3/blob/develop/src/ext/UIExtension/wixlib/WixUI_en-us.wxl
- WiX UI Norwegian Strings:
- https://github.com/wixtoolset/wix3/blob/develop/src/ext/UIExtension/wixlib/WixUI_nb-NO.wxl
- There are many such language files, use above link for full list
这篇关于如何在 WIX 中的安装标题中显示版本号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!