c#, MSBuild Bootstrapper with wix, how to download

2019-04-09 04:45发布

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?

2条回答
爷的心禁止访问
2楼-- · 2019-04-09 05:30

From the Bootstrapper element Remove your ComponentsLocation="Relative" attribute and add following

ComponentsLocation="Homesite"

CopyComponents="true"

查看更多
时光不老,我们不散
3楼-- · 2019-04-09 05:41

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.

查看更多
登录 后发表回答