3

I'm using a WiX bootstrapper to install .NET and my application. The .NET installation is specified in a chain using the statement

<PackageGroupRef Id="NetFx40Redist">

When I uninstall using the bootstrapper, the .NET package is also uninstalled. How can I modify the above statement to tell the bootstrapper not to remove the .NET package?

EDIT: Following is the code I ended up writing to do this. Comments are welcome if there is anything I should do differently.

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

    <Bundle Name="appName" Version="$(var.Version)" Manufacturer="mfr" UpgradeCode="your-GUID"

    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
        <Variable Name="InstallFolder" Type="string" Value="[ProgramFilesFolder]mfrName\appName" />

        <Chain>
            <PackageGroupRef Id="Net4Redist"/>

            <MsiPackage
                    Id="MsiInstaller"
                    Compressed="yes"
                    SourceFile="$(var.SolutionDir)\appName_Installer\bin\$(var.Configuration)\appName_Installer.msi"
                    Permanent="no"
                    Vital="yes">
                <MsiProperty Name="INSTALLLOCATION" Value="[InstallFolder]" />
            </MsiPackage>
        </Chain>
    </Bundle>

    <Fragment>
        <PackageGroup Id="Net4Redist">
            <ExePackage Id="Netfx40Xxx" Cache="no" Compressed="yes" PerMachine="yes"
                 Permanent="yes" Vital="yes" InstallCommand="/q"
                 SourceFile="$(var.SolutionDir)\Bootstrapper\redist\dotNetFx40_Full_x86_x64.exe"
                 InstallCondition="(VersionNT >= v6.0 OR VersionNT64 >= v6.0)"/>
        </PackageGroup>
    </Fragment> 
</Wix>
Scott8501
  • 31
  • 3

2 Answers2

1

Did you try using the "Permanent" attribute in the EXEPackage element?

EXEPackage

Isaiah4110
  • 9,855
  • 1
  • 40
  • 56
0

Glad you solved your issue but, as you mentioned, you do not have any detect condition setup so that is probably why you are seeing .NET processing every time you run your installer. If you add the following registry search and detect condition to your example you should not see that anymore:

<Fragment>
    <util:RegistrySearchRef Id="NETFRAMEWORK40"/>

    <PackageGroup Id="Net4Redist">
        <ExePackage Id="Netfx40Xxx" Cache="no" Compressed="yes" PerMachine="yes"
             Permanent="yes" Vital="yes" InstallCommand="/q"
             SourceFile="$(var.SolutionDir)\Bootstrapper\redist\dotNetFx40_Full_x86_x64.exe"
             DetectCondition="NETFRAMEWORK40"
             InstallCondition="(VersionNT >= v6.0 OR VersionNT64 >= v6.0)"/>
    </PackageGroup>
</Fragment>