wix 如何在线安装.Net Client 4

困扰了很久,网上的方法大多是用burn,后来找到了robmen的博客,看到里面的一篇文章,差点绝望了

Download - redistributables (think .NET Framework and SQL Express) that are larger than the applications 
which use them are unfortunately really common right now. If you are distributing your application over 
the Internet (and how many people today aren't?) shipping those redistributes in your setup is expensive. 
Burn has the ability to only download what the user needs and/or chooses to install. That means if the 
.NET Framework is already installed, no need to download it again. Also, when your product is broken 
up into multiple MSI files it becomes possible to optimize the distribution further. Oh, and did I mention 
Burn will support resume if the download server supports HTTP 1.1? 

要写WPF好幸苦,其实需求就一个,不要这么大的安装包。想了很久,最后只能一个个API去读,终于还是找到了方法:

<Target Name="AfterBuild">
    <GenerateBootstrapper ApplicationFile="$(TargetFileName)" 
         ApplicationName="Landow" 
         BootstrapperItems="@(BootstrapperFile)" 
         ComponentsLocation="HomeSite" 
         CopyComponents="false" 
         OutputPath="$(OutputPath)" 
         Path="$(BootstrapperPath)" 
         ComponentsUrl="http://go.microsoft.com/fwlink/?linkid=182804"/>
</Target>


这里附带一点资料:

<Product> Element (Bootstrapper)

GenerateBootstrapper Task


版本和設定檔 架構 安裝程式檔案名稱 URL
.NET Framework 4.5.1 x86 x64 NDP451-KB2858728-x86-x64-AllOS-ENU.exe http://go.microsoft.com/fwlink/?LinkId=321332
.NET 4.5 Framework x86 x64 dotNetFx45_Full_x86_x64.exe http://go.microsoft.com/fwlink/?LinkId=255995
.NET Framework 3.5 SP1 中,.NET Framework 3.0 SP2,.NET Framework 2.0 SP2 (如果已經安裝.NET Framework 3.0 和 3.5) x86 x64 dotnetfx35.exe http://go.microsoft.com/fwlink/?LinkId=259762
.NET Framework 4 用戶端設定檔 x86 dotNetFx40_Client_x86.exe http://go.microsoft.com/fwlink/?linkid=247966
.NET Framework 4 用戶端設定檔 x86 x64 dotNetFx40_Client_x86_x64.exe http://go.microsoft.com/fwlink/?linkid=247965
.NET Framework 4 完整 x86 dotNetFx40_Full_x86.exe http://go.microsoft.com/fwlink/?linkid=247964
.NET Framework 4 完整 x86 x64 dotNetFx40_Full_x86_x64.exe http://go.microsoft.com/fwlink/?linkid=247962
.NET Framework 2.0 SP2 (當未安裝版本 3.0 和 3.5) x64 NetFx20SP2_x64.exe http://go.microsoft.com/fwlink/?LinkId=259767
.NET Framework 2.0 SP2 (當未安裝版本 3.0 和 3.5) x86 NetFx20SP2_x86.exe http://go.microsoft.com/fwlink/?LinkId=259766



你可能感兴趣的:(WiX)