How show version number in title of installation in WIX?
Asked Answered
L

2

6

I need to display the version number in the title along with the application name.

Currently, it looks like

enter image description here

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?

Littleton answered 18/3, 2019 at 12:36 Comment(3)
Not sure, that you can do using snippet above. MSI displays ProductName in standard dialogs. Probably, you'll need to create your own wix UI dialogs and put information on itPeppi
Thanks @PavelAnikhouski Is there any link/sample for this?Littleton
Try to follow wixui documentation wixtoolset.org/documentation/manual/v3/wixuiPeppi
C
8

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

Sample WiX Title Change

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:

Cortes answered 18/3, 2019 at 20:33 Comment(0)
C
3

WiX UI extension doesn't allow this type of customization. Your two chances would be

1) define Name="Test Application $(var.ProductVersion)" (Side effect. version listed in programs and features twice

2) Stop using the WiXUI extension and instead clone all the code from https://github.com/wixtoolset/wix3/tree/develop/src/ext/UIExtension/wixlib into your project.

Corespondent answered 18/3, 2019 at 17:43 Comment(5)
I've had some luck with localization files, but I am not sure if it is an "accepted approach". I have also tried to add items to existing dialogs, and I think I saw someone succeed, but I can't find it again.Phone
It's pretty easy to add to the UI but very difficult to change something if a variation point override isn't already built in.Corespondent
MSI GUI: total overkill, total anti-pattern. WiX does pretty well considering though. I wonder how limited the GUI could have been and been better? Just a few controls: edit, label, combo, checkbox, button and some simple events that worked would have done the trick. End of rant.Phone
It's only overkill if everything is a micropackage and divorced from configuration. I have many installs with nothing more the Welcome, Ready, Installing, Done but I also have ones that need more. I generally find MSI UI acceptable for my needs.Corespondent
I have always hated the problems with the events, but that is a bigger discussion. I wonder what will come next.Phone

© 2022 - 2024 — McMap. All rights reserved.