2014-10-11 36 views
1

我的問題是,我不知道爲.NET Framework 4.5放置ItemGroup/BootstrapperFile。 這裏是我的文件c#,帶有wix的MSBuild引導程序,如何下載.net框架4.5

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

我讀過的互聯網,人們現在所要參考的是Windows的SDK文件夾的目錄是C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A 但後來什麼用的給一個本地文件夾,同時引導程序應該下載依賴關係? 任何人都知道在BootstrapperFile中使用的引用?

謝謝!

回答

2

BootstrapperFile元素標識@Path文件夾的Packages子文件夾中的包。那裏的product.xml文件指定了需要的文件以及在哪裏可以下載它們。它們在構建時必須存在的原因是setup.exe可以包含它們的校驗和以在安裝時進行驗證。

下載取決於軟件包作者(當然是網站所有者)。如果你自己創作,你可能會發現Bootstrapper Manifest Generator很有用(如果你能在互聯網上找到它 - 所有的官方鏈接都已經死了)。

+0

我只是想知道是否有任何參考哪裏可以找到什麼要放在BootstrapperFile作爲包含和ProductName。我認爲它就像maven,所以我們需要確切的名字......我不知道在哪裏可以找到...... – Sofiane 2014-10-30 14:21:20