简体   繁体   中英

c#, MSBuild Bootstrapper with wix, how to download .net framework 4.5

my issue is that I don't know what to put in ItemGroup/BootstrapperFile for .net framework 4.5. Here is my file

<Project ToolsVersion="4.0"
   xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

    <ItemGroup>
        <BootstrapperFile Include="Microsoft.Windows.Installer.4.5" >
           <ProductName>Windows Installer 4.5</ProductName>
        </BootstrapperFile>
        <!--<BootstrapperFile Include="DotNetFX40" >
           <ProductName>Microsoft DotNet Framework 4.5 SP1</ProductName>
        </BootstrapperFile>-->
    </ItemGroup>

    <!-- from http://stackoverflow.com/questions/346175/use-32bit-program-files-directory-in-msbuild
    -->
    <PropertyGroup>
         <ProgramFiles32>$(MSBuildProgramFiles32)</ProgramFiles32> 
         <ProgramFiles32 Condition=" '' == '$(ProgramFiles32)'">$(ProgramFiles%28x86%29)</ProgramFiles32>
         <ProgramFiles32 Condition=" '' == '$(ProgramFiles32)'">$(ProgramFiles)</ProgramFiles32>
    </PropertyGroup>

    <Target Name="SetupExe">
        <GenerateBootstrapper
            ApplicationFile="C:\Projects\MySetup\MySetup\bin\Debug\MySetup.msi"
            ApplicationName="MyApplication"
            Culture="en"
            BootstrapperItems="@(BootstrapperFile)"
            ComponentsLocation="HomeSite"
            Path="$(ProgramFiles32)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\"
            OutputPath="output"/>
    </Target>

</Project>

I've read in the internet that what has to be referenced is a directory in Windows SDKs folder which is C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A But then what is the use of giving a local folder while the bootstrapper should download the dependencies? Anyone knows a reference to use in BootstrapperFile ?

Thank you !

The BootstrapperFile element identifies a package in the Packages subfolder of the @Path folder. The product.xml file under there specifies the files needed and where, if at all, they can be downloaded from. The reason they must exist there at build time is so the setup.exe can contain their checksums to validate at install time.

Downloading is up to the package author (and web site owner, of course). If you author your own, you might find the Bootstrapper Manifest Generator useful (if you can find it on the Internet—all the official links are dead).

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