如何在WIX中的安装标题中显示版本号? [英] How show version number in title of installation in WIX?
问题描述
我需要在标题中显示版本号以及应用程序名称.
I need to display the version number in the title along with the application name.
当前看起来像
这是我的wix片段:
<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">
我们如何在Wix中实现这一目标?
How we can accomplish this in Wix?
推荐答案
本地化覆盖 :您可以尝试添加本地化文件,然后覆盖 WelcomeDlgTitle
字符串( WiX GUI字符串列表/字符串标识符列表可在此处找到 (英语):
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):
- 请注意,这是假设 Mondo对话框集的:
- 添加到WiX标记:
<UIRef Id="WixUI_Mondo" />
- 添加对
%ProgramFiles(x86)%\WiX Toolset v3.11\bin\WixUIExtension.dll
的引用
- Visual Studio中的WiX Hello World示例(带有底部注释的WiX标记通常足以使开发人员掌握要点的东西)
- 添加到WiX标记:
- Note that this assumes the Mondo dialog set:
- Add to WiX markup:
<UIRef Id="WixUI_Mondo" />
- Add reference to
%ProgramFiles(x86)%\WiX Toolset v3.11\bin\WixUIExtension.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:
将以下字符串添加到本地化文件:
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 :我对 WiX GUI 感到很困惑,因此我写了这个小概述和清单"以更好地记住(使用类似的方法来更改对话框条目的样式):
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源: (语言字符串和对话框源)
- WiX UI Sources: (languages strings and dialog sources)
- https://github.com/wixtoolset/wix3/tree/develop/src/ext/UIExtension/wixlib
这篇关于如何在WIX中的安装标题中显示版本号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
- WiX UI Sources: (languages strings and dialog sources)