This project is read-only.
Project Description
This is a WiX preprocessor extension that can read the version resources of any file into variables.

While working on a WiX installer for one of my projects I wanted to automatically set the product version based on the version of my executable. After searching the web I found a few solutions (setting an environment variable, using a PowerShell script to edit the wxs file) but they all felt like hacks to me.

I decided to write a WiX preprocessor extension that could read the version number out of my executable as the installer was complied.

The extension supports reading any property in the .NET FileVersionInfo class. This allows a WiX install to automatically read the version information using something like:

    <?define ProductName="$(fileVersion.ProductName($(var.MyApp.TargetPath)))" ?>
    <?define CompanyName="$(fileVersion.CompanyName($(var.MyApp.TargetPath)))" ?>
    <?define ProductVersion="$(fileVersion.ProductVersion($(var.MyApp.TargetPath)))" ?>

        Id="<product ID>" 
        UpgradeCode="<upgrade code>">


Windows Installer XML (WiX) 3.0

Last edited Mar 13, 2009 at 2:55 PM by ckaczor, version 8