2016-02-12 53 views
0

我的Wix/Burn軟件包在Windows 7上安裝.Net 4.6.1,當前.NET安裝程序會在我的刻錄設置窗口中觸發並顯示自己的UI窗口(兩個進度條)。Wix Burn MBA如何展示.Net Framework安裝進度?

是否有辦法抑制.Net安裝程序用戶界面並將消息傳遞到Burn MBA安裝程序UI?

我的代碼:

<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> 

我的本意是具有安裝.NET 4.6.1(如果需要)一個用戶體驗的窗口,然後我的應用程序,帶有一個進度條和信息狀態消息

回答

0

您確定它是離線安裝程序嗎?可能你正在使用在線安裝程序。 這是正確的: https://www.microsoft.com/ru-ru/download/details.aspx?id=49982

我在一個窗口工作ExePackage的例子:

<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)" /> 

不要使用此DetectCondition,將無法正常工作。

順便說一句,你的檢測條件是完全錯誤的。 查看說明書: https://msdn.microsoft.com/en-us/library/hh925568(v=vs.110).aspx