如何在 WIX 中的安装标题中显示版本号? [英] How show version number in title of installation in WIX?

查看:22
本文介绍了如何在 WIX 中的安装标题中显示版本号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在标题中显示版本号以及应用程序名称.

目前看来

这是我的 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 对话框.

链接:

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):

  1. 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)
  2. Right click your WiX project in Visual Studio => Add => New Item...
  3. Select WiX v3 in the left menu. Double click Localization file (very common to add a WiX v4 file instead, double check please)
  4. 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>
    

  5. 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 中的安装标题中显示版本号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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