简体   繁体   中英

How can a Wix Burn MBA show .Net Framework installation Progress?

My Wix/Burn bundle is installing .Net 4.6.1 on Windows 7, currently the .NET installer fires and shows its own UI window (two progress bars) over my Burn Setup Window.

Is there a way to suppress the .Net installer UI and pipe the messages to the Burn MBA installer UI?

My code:

<Bundle Name="A Test Application" Version="1.0.0.0" Manufacturer="TM" UpgradeCode="{26B5D0A5-96E9-477D-8FE1-1DA027D534F8}">    

    <BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost">
      <Payload SourceFile="..\TestBA\BootstrapperCore.config"/>
      <Payload SourceFile="..\TestBA\bin\Release\TestBA.dll"/>
      <Payload SourceFile="..\TestBA\bin\Release\GalaSoft.MvvmLight.dll"/>
      <Payload SourceFile="C:\Program Files (x86)\WiX Toolset v3.10\SDK\Microsoft.Deployment.WindowsInstaller.dll"/>
    </BootstrapperApplicationRef>

    <Chain DisableSystemRestore="yes">
      <PackageGroupRef Id='Netfx461Full' />
      <MsiPackage SourceFile="..\DummyInstaller\bin\Release\DummyInstaller.msi" Id="DummyInstallationPackageId" Cache="yes" Visible="no"/>
    </Chain>

  </Bundle>

  <Fragment>
    <WixVariable Id="WixMbaPrereqPackageId" Value="Netfx461Full" />
    <WixVariable Id="WixMbaPrereqLicenseUrl" Value="NetfxLicense.rtf" />

    <util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion" Value="CurrentVersion" Variable="WIN_Version" />

    <util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full" Value="Version" Variable="var_Netfx4" />
    <util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full" Value="Version" Variable="var_Netfx4x64" Win64="yes" />

    <util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full" Value="Release" Variable="var_Netfx4Release" />
    <util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full" Value="Release" Variable="var_Netfx4x64Release" Win64="yes" />

    <PackageGroup Id="Netfx461Full">
      <ExePackage Id="Net461" Name="Microsoft .NET Framework 4.6.1 Setup" Cache="no" PerMachine="yes" Permanent="yes" Vital="yes"
        Compressed="yes"  
        InstallCommand="/q"
        SourceFile="C:\Users\Martin\Documents\.Net Frameworks\NDP461-KB3102436-x86-x64-AllOS-ENU.exe"
        DetectCondition="(var_Netfx4x64 &lt;&lt; &quot;4.6&quot;) OR (var_Netfx4x64 &lt;&lt; &quot;4.6&quot;)"
        InstallCondition="(VersionNT &lt; v6.0 OR VersionNT64 &lt; v6.0) AND (NOT (var_Netfx4 OR var_Netfx4x64))" />
    </PackageGroup>
  </Fragment>

BootstrapperCore.Config

<configuration>
  <configSections>
    <sectionGroup name="wix.bootstrapper" type="Microsoft.Tools.WindowsInstallerXml.Bootstrapper.BootstrapperSectionGroup, BootstrapperCore">
      <section name="host" type="Microsoft.Tools.WindowsInstallerXml.Bootstrapper.HostSection, BootstrapperCore" />
    </sectionGroup>
  </configSections>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <!--<supportedRuntime version="v2.0.50727" />-->
    <supportedRuntime version="v4.0" />
    <!--<supportedRuntime version="v4.6"/>-->
  </startup>
  <wix.bootstrapper>
    <host assemblyName="TestBA">
      <!--<supportedFramework version="v4.6" />-->
      <supportedFramework version="v4\Full" />
      <supportedFramework version="v4\Client" />
      <!--<supportedFramework version="v3.5" />-->
    </host>
  </wix.bootstrapper>
</configuration>

My intention is to have one user window experience which installs the .Net 4.6.1 (if required) and then my application, with one progress bar and informative status messages

Are you sure it's offline installer? Probably you are using online installer. This is the right one: https://www.microsoft.com/ru-ru/download/details.aspx?id=49982

My example of ExePackage working in one window:

<ExePackage Id="NetFx46Redist" DisplayName="Microsoft .NET Framework 4.6.1" Compressed="$(var.IsCompressed)" Cache="yes"
                        bal:PrereqSupportPackage="yes"
                        PerMachine="yes" Permanent="yes" Protocol="netfx4" Vital="yes" SourceFile="$(var.PRMSourceDir)NDP461-KB3102436-x86-x64-AllOS-ENU.exe"
                        InstallCommand="/q /norestart /ChainingPackage &quot[WixBundleName]&quot;" RepairCommand="/q /norestart /repair /ChainingPackage &quot;[WixBundleName]&quot;"
                        UninstallCommand="/uninstall /q /norestart /ChainingPackage &quot;[WixBundleName]&quot;"
                        DetectCondition="(WIX_IS_NETFRAMEWORK_46_OR_LATER_INSTALLED=1)" /> 

Don't use this DetectCondition, will not work.

Btw, something is completely wrong with your detect condition. Check the instruction: https://msdn.microsoft.com/en-us/library/hh925568(v=vs.110).aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM