WIX: Howto set the name of the msi output file dynamically

Viewed 31331

I want to include some dynamic part in the filename of the msi file my wix projects produce. This dynamic part should be controlled by variables which are part of my wix project and are declared like this:

<?define ProductVersion="7.1.0.1" ?>

Does anybody know about a way of sending that value of that wix variable to the linker to use it as a part of the output filename?

By the way: I'm using Wix3

8 Answers

Open *.wixproj (example: Setup.wixproj)

Go to the end of the file.

$(Configuration) = Debug| Release …

Set path of your application on AssemblyFiles.

<Target Name="BeforeBuild">
    <GetAssemblyIdentity AssemblyFiles="..\App\bin\$(Configuration)\App.exe">
      <Output TaskParameter="Assemblies" ItemName="AsmInfo" />
    </GetAssemblyIdentity>
    <CreateProperty Value="$(SolutionName)_%(AsmInfo.Version)_$(Configuration)">
      <Output TaskParameter="Value" PropertyName="TargetName" />
    </CreateProperty>
</Target>

Output = App_1.0.0.0_Debug.msi

Related