问题
I managed to create bootstrapper for my project that includes .net framework 3.5SP1 with this code:
<ItemGroup>
<BootstrapperFile Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5.SP1</ProductName>
<Install>true</Install>
</BootstrapperFile>
</ItemGroup>
<Target Name="Bootstrapper">
<GenerateBootstrapper
ApplicationFile="SeppelSetup.msi"
ApplicationName="Seppel 1.0"
BootstrapperItems="@(BootstrapperFile)"
OutputPath=".\bin\Debug"
ComponentsLocation="Relative"
Culture="en"
Path="C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Bootstrapper"
/>
</Target>
The problem is that output directory has over 200Mb, wich is much more than I can afford (I want to put installer online for download). Is there a way that allow me to download framework from microsoft's site rather than include all files in installation package?
回答1:
From the Bootstrapper element Remove your ComponentsLocation="Relative" attribute and add following
ComponentsLocation="Homesite"
CopyComponents="true"
回答2:
Your best option is probably to use Wix 3.6. It was nowhere near complete the last time I tried it, but it supports exactly the sort of thing you want, downloading redistributables from the Internet. If you're willing to wait for it to be stable, go with it.
来源:https://stackoverflow.com/questions/5862060/c-msbuild-bootstrapper-with-wix-how-to-download-net-framework-3-5-sp1