Aligning WiX Installer Versions with Real-Time Build Numbers - A How-To Guide

Aligning WiX Installer Versions with Real-Time Build Numbers - A How-To Guide

Donald Lv12

Aligning WiX Installer Versions with Real-Time Build Numbers - A How-To Guide

Versus

Inno SetupInno SetupWiX ToolsetWiX ToolsetInstallShieldInstallShieldMSIX Packaging ToolMSIX Packaging Tool

icon subscribe mail

Check your inbox and confirm the
subscription

Exclusive NewsletterExclusive Newsletter

Exclusive NewsletterExclusive Newsletter

Get the latest WiX insights direct to your inbox. Subscribe now!

Disclaimer: This post includes affiliate links

If you click on a link and make a purchase, I may receive a commission at no extra cost to you.

How To Set WiX Installer Version to the Current Build Version

Written by Radu Popescu · June 7th, 2021

Do you need your installer to keep its current build version? In this article, will go through all the steps you need to set your WiX installer version to the current build version.

https://techidaily.com

Start with Your Base Application

We will use a hypothetical scenario using WiX Toolset version 3.11.2 to help illustrate how to set a WiX installer version to the current build version.

For this example, the first thing we have to do is create a sample basic application containing an executable file called “CMtrace.exe” and a text file called “guide.txt” that includes the information shown below.

Text file

It is important to look inside the WiX installer project code since it will be the one modified through the updating version process.

Copy

https://techidaily.com

Using Binder Variables to Pass the Product Version of the Current Build Version

If we take a look in our code, we see that the <Product […] Version=”1.0.0.0”> and the version value is hardcoded. What we want to achieve is to update the version of our main executable file to the actual Product Version.

Doing that is pretty simple, we just need to use Binder Variables.

Binder Variables are properties that are not available until the linker is about to generate or bind the final output. The supported binder variables are All Versioned Files, Assemblies, Properties, Package Properties, Localization Variables, and_Custom Binder Variables_.

NoteFor an in-depth description of supported binder variables and examples, you can consult this article .

https://techidaily.com

First, we have to pass the version of our CMTrace.exe file to our Product. For that, we need to take a look at our file declaration section.

Copy

For this example, we are using the “All Versioned Files” “bind.fileVersion.FileID” binder variable, where FileID is the value of our CMtrace.exe File Id and is equal to “File1”.

Now, all we need to do is replace the hard coded version from the <Product […] Version=”1.0.0.0”> section, with the following syntax:

<Product […] Version=”!(bind.FileVersion.File1)”

Copy

This is how our code should look like:

Copy

And, that’s it! You can now set the WiX Installer version to the current build version.

For more useful guides and tutorials, make sure to check ourdedicated page to the WiX open-source technology , where you can find everything from the basic principles of the WiX Toolset to more advanced tips for developers and IT Pros.

Advanced Installer #1 alternative to the WiX Toolset

We decided to focus on our main goal to save precious time of our developers.

HANS-LEO TEULINGS
PHD – CEO, NEUROSCRIPT, LLC

You might find useful:

https://techidaily.com

Get the most from packaging with Advanced Installer

Try the 30-day fully-featured edition absolutely free!

Download Free Trial

No credit card required

Also read:

  • Title: Aligning WiX Installer Versions with Real-Time Build Numbers - A How-To Guide
  • Author: Donald
  • Created at : 2024-09-28 16:39:21
  • Updated at : 2024-10-03 17:35:43
  • Link: https://some-tips.techidaily.com/aligning-wix-installer-versions-with-real-time-build-numbers-a-how-to-guide/
  • License: This work is licensed under CC BY-NC-SA 4.0.