WiX Bootstrapper

2

I am trying to create an installer for a simple .NET WPF C# app. I am using VS 2013, and WiX 3.10.2. Following the steps in the Wix Tutotial/ .NET/ Bootstrapping I have created a Boostrap.exe which chains .NET web installer and the app Setup.msi.

EDIT: My goal is to understand how to configure the WiX Bootstrap and Setup projects for small updates, minor upgrades, and major upgrades scenarios.

Out of the box, everything seems to work nice when I run a fresh install. However, when I run a fresh built Bootstrap.exe over an already existing installation a duplicate entry appears in the Apps & features and no file is changed in the app target location - contrary to the expectation that the same entry should remain in the Apps & features and the target location should be updated. EDIT: Looks like there may not be a way to change REINSTALLMODE?

If I add a Product Id and then change the version of the Setup (minor upgrade), the Bootstrap fails with User cancelled installation? The log file shows "Error 0x80070642: Failed to perform minor upgrade of MSI package." EDIT: Inside the MSI log a SecureRepair fails with error code 39439E438 (?) probably because the stored hash value does not match the current... but that should be expected in a minor upgrade MSI, right?

Are there recommended configurations between the Boostrapper and Setup WiX projects such that the small update, minor upgrade, and major upgrade use cases can be handled properly, or does the WiX Bootstrapper support ONLY major upgrades?

I will continue to investigate and I'll post updates to my findings;

Any hints are greatly appreciated, Thanks!

Here are the source files which I barely changed from the WiX wizard generated code:

--- Product.wxs ---

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="SetupProject1 1.0.0.0" Language="1033" Version="1.0.0.0" Manufacturer="Acme" UpgradeCode="4c8a8cbf-e3d0-410c-8a8d-7e67eb4e7ff7">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perUser" InstallPrivileges="limited" />

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

    <Feature Id="ProductFeature" Title="SetupProject1" Level="1">
        <ComponentGroupRef Id="ProductComponents" />
    </Feature>
</Product>

<Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="LocalAppDataFolder">
            <Directory Id="AcmeFolder" Name="Acme">
                <Directory Id="INSTALLFOLDER" Name="WpfApplication1" />
            </Directory>
        </Directory>
    </Directory>
</Fragment>

<Fragment>
    <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
        <Component Id="ProductComponent" Guid="8CA0B70F-39DA-4B4B-9104-46C58E26FCF4">
            <CreateFolder/>
            <RemoveFolder Id="RemoveAcmeFolder" Directory="AcmeFolder" On="uninstall"/>
            <RemoveFolder Id="RemoveINSTALLFOLDER" On="uninstall" />
            <RegistryValue Root="HKCU" Key="Software\Acme\WpfApplication1" Name="Version" Type="string" Value="[ProductVersion]" KeyPath="yes" />
            <File Source="$(var.WpfApplication1.TargetPath)" KeyPath="no" />
        </Component>
    </ComponentGroup>
</Fragment>

--- Bundle.wxs ---

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
 xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">

<Bundle Name="Bootstrapper1 1.0.0.0" Version="1.0.0.0" Manufacturer="Acme" UpgradeCode="e1092cbb-9134-42fc-a9f2-652f95f361fd">
    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />

    <Chain>
        <MsiPackage Name="Acme Setup" SourceFile="$(var.SetupProject1.TargetPath)" Vital="yes" />
    </Chain>
</Bundle>

wix
windows-installer
asked on Stack Overflow Jun 21, 2016 by George S. • edited Jun 21, 2016 by George S.

1 Answer

5
  • If you change your executables, increase their version numbers. Windows Installer assumes files with the same versions are the same.

  • To upgrade an .msi package, increase its version number either as part of a major upgrade (typical) or minor upgrade.

  • To upgrade a bundle, increase its version number. By default, Burn keeps bundles with the same version installed.

answered on Stack Overflow Jun 21, 2016 by Bob Arnson

User contributions licensed under CC BY-SA 3.0