1

I should start by clarifying that I am a complete novice and unfamiliar with Wix, so I am relying on looking at other examples.

I have an installer that is working fine but the filename for the MSI needs to change.

My 'Product' section looks roughly like this:

<Product Id="*" Name="MyShellExtension" Language="1033" Version="1.0.0.0" Manufacturer="ACME Inc" UpgradeCode="???????-????-????-????-??????????">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
    <MediaTemplate />

    <Feature Id="ProductFeature" Title="MyShellExtension" Level="1">
        <ComponentGroupRef Id="ProductComponents" />
    </Feature>
    <CustomActionRef Id="InstallShell"/>
    
</Product>

I found this posting but it's quite old and refers to a property called 'OutputName' that does not appear to be supported in Wix v3.11 which is what I have. WIX: Howto set the name of the msi output file dynamically

BTW when I installed "The latest version" of Wix I found that it had installed 3.11. I'm guessing it's because I'm running Visual Studio 2019 but if that's not the case and it's both possible and recommended to run more recent versions with VS 2019, please advise on where I might have gone wrong with the installation of Wix.

I found that I could right-click the project in Visual Studio and manually set the name there, which solved my initial problem, but I would like to add the version number of the component I'm installing to the filename.

I'm very new to all of this so it would be really helpful to have an example that I can paste in and modify.

Max Headroom
  • 151
  • 7

1 Answers1

1

The OutPut name property is in a .wixproj MSBuild file if your using VisualStudio / Votive / MSBuild. If your calling candle and light it's not used. You just pass in the parameter to set the output file name.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
  • So I can now see that I can manually edit the .wixproj file to add a version string to the OutPutName; thanks Christopher. This is arguably good enough, as I'm hoping not to have many versions, but it seems odd that there isn't an automated way to use the version of the project in Visual Studio to name the MSI. – Max Headroom Apr 19 '22 at 10:53
  • 1
    You can use an MSBuild property such as $(MSIProductVersion) and pass that in during the build. Please see my IsWiX tutorial https://github.com/iswix-llc/iswix-tutorials/tree/master/desktop-application final topic 'Build considerations' for more detail. – Christopher Painter Apr 19 '22 at 12:46
  • 1
    Really at this point this isn't really a WiX question but rather an MSBuild / Build Automation question. You can pass a version into the build and use it to establish your ProductVersion property and filename or you can use an external script to rename the MSI after it's build. I've answered the WiX part of the question and tried to give you suggestions for the other part. – Christopher Painter Apr 19 '22 at 12:51
  • Many thanks Christopher, that's really helpful. – Max Headroom Apr 19 '22 at 14:07