2
votes

I'm somewhat new to Wix. I created a bootstrapper to check and install .NET version 4 framework if it doesn't exist. In my msi package, I'm using WixUI_minimal installer interface. When I run the bootstrapper.exe, the standard bootstrapper UI shows instead of the WixUI_minimal. Is there a way to have WixUI_minimal present and have .NET framework install in the background without showing the bootstrapper UI? What options do I have here? Any tips would be appreciated. Thanks.

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
  xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
  <Bundle Name="BootstrapperRedist" Version="1.0.0.0" Manufacturer="Testment Technologies" UpgradeCode="3f40cdd1-640d-4fe6-8edb-17a308d8f227">
        <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
        <Chain>
      <PackageGroupRef Id="NetFx40ClientRedist"/>
      <MsiPackage Id="MyApplication" SourceFile="$(var.MicroSynSetupProject.TargetPath)"/>
        </Chain>
    </Bundle>
  <Fragment>
    <!-- Check for .NET 4.0 -->
    <util:RegistrySearch Root="HKLM"
                         Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full"
                         Value="Version"
                         Variable="Netfx4FullVersion" />
    <util:RegistrySearch Root="HKLM"
                         Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full"
                         Value="Version"
                         Variable="Netfx4x64FullVersion"
                         Win64="yes" />
    <PackageGroup Id="Netfx4Full">
      <ExePackage Id="Netfx4Full"
                  DisplayName="Microsoft .NET Framework 4.0"
                  DownloadUrl="http://download.microsoft.com/download/5/6/2/562A10F9-C9F4-4313-A044-9C94E0A8FAC8/dotNetFx40_Client_x86_x64.exe"
                  Compressed="no"
                  Cache="yes"
                  PerMachine="yes"
                  Permanent="yes"
                  Protocol="netfx4"
                  Vital="yes"
                  SourceFile=".\dotNetFx40_Full_x86_x64.exe"
                  InstallCommand="/passive /norestart"
                  DetectCondition="Netfx4FullVersion AND (NOT VersionNT64 OR Netfx4x64FullVersion)" />
    </PackageGroup>
  </Fragment>
</Wix>

I decided to change the bootstrapper application UI to include my license, a logo and a theme. This was done by including the WixBalExtension as a reference. This seems like the simplest way to go for the moment in having one unified install UI. The new bootstrapper listing is below.

    <?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
  xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
  xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
  <!--Version="1.0.0.0"-->
  <Bundle Name="BootstrapperRedist"
          Version="!(bind.packageVersion.MicroSyn)"
          UpgradeCode="3f40cdd1-640d-4fe6-8edb-17a308d8f227" 
          IconSourceFile=".\MS.ico">

    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense">
      <bal:WixStandardBootstrapperApplication
        LicenseFile=".\license.rtf"
        ThemeFile=".\RtfTheme.xml"
        LogoFile=".\MS_64x64.bmp"/>
    </BootstrapperApplicationRef>

        <Chain>
      <PackageGroupRef Id="NetFx40ClientRedist"/>
      <MsiPackage Id="MicroSyn" 
                  SourceFile="$(var.MicroSynSetupProject.TargetPath)" 
                  DisplayInternalUI="no"/>
        </Chain>
    </Bundle>
  <Fragment>
    <!-- Check for .NET 4.0 -->
    <util:RegistrySearch Root="HKLM"
                         Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full"
                         Value="Version"
                         Variable="Netfx4FullVersion" />
    <util:RegistrySearch Root="HKLM"
                         Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full"
                         Value="Version"
                         Variable="Netfx4x64FullVersion"
                         Win64="yes" />
    <PackageGroup Id="Netfx4Full">
      <ExePackage Id="Netfx4Full"
                  DisplayName="Microsoft .NET Framework 4.0"
                  DownloadUrl="http://download.microsoft.com/download/5/6/2/562A10F9-C9F4-4313-A044-9C94E0A8FAC8/dotNetFx40_Client_x86_x64.exe"
                  Compressed="no"
                  Cache="yes"
                  PerMachine="yes"
                  Permanent="yes"
                  Vital="yes"
                  SourceFile=".\dotNetFx40_Full_x86_x64.exe"
                  InstallCommand="/passive /norestart"
                  DetectCondition="Netfx4FullVersion AND (NOT VersionNT64 OR Netfx4x64FullVersion)"/>
    </PackageGroup>
  </Fragment>
</Wix>
1
It is possible to just check for the presence of the correct .NET framework and then abort the setup unless it is installed - then you can make do with the MSI alone and not run with a setup.exe. You might need the setup.exe for other prerequisite setups though - in which case you can show the internal GUI for the MSI as explained by others below. - Stein Åsmul
The rationale is that the .NET runtime is so ubiquitous now that it is almost silly to bundle it with your setup - particularly since that will not install the latest security hotfixes (why bloat your setup with outdated junk?). Corporations will have their own .NET runtime deployment mechanism, and home and small office users can run Windows Update the regular way, or be provided with a download link. Problem solved? - Stein Åsmul

1 Answers

1
votes

On your MSI package you would need to set the attribute DisplaysInternalUI to Yes.

From the documentation:

Specifies whether the bundle will show the UI authored into the msi package. The default is "no" which means all information is routed to the bootstrapper application to provide a unified installation experience. If "yes" is specified the UI authored into the msi package will be displayed on top of any bootstrapper application UI.

http://wixtoolset.org/documentation/manual/v3/xsd/wix/msipackage.html