我有一个WiX安装程序项目,如果需要,可以使用Bootstrapper任务安装.net。但它似乎在PostBuildEvent之后运行,我需要它在它之前运行。
有人可以解释一下。
相关代码是:
<ItemGroup>
<BootstrapperFile Include=".NETFramework,Version=v4.0,Profile=Client">
<ProductName>.NET Framework 4.0 Client</ProductName>
</BootstrapperFile>
<BootstrapperFile Include="Microsoft.Windows.Installer.4.5">
<ProductName>Windows Installer 4.5</ProductName>
</BootstrapperFile>
</ItemGroup>
<Target Name="Bootstrapper" Inputs="$(OutDir)$(TargetFileName)" Outputs="$(OutDir)\Setup.exe" Condition=" '$(OutputType)'=='package' ">
<GenerateBootstrapper Path="C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\Bootstrapper" ApplicationName="EcoButton" ApplicationFile="$(TargetFileName)" BootstrapperItems="@(BootstrapperFile)" ComponentsLocation="HomeSite" OutputPath="$(OutputPath)" />
</Target>
<PropertyGroup>
<BuildDependsOn>$(BuildDependsOn);Bootstrapper</BuildDependsOn>
</PropertyGroup>
<PropertyGroup>
<PostBuildEvent>cscript "$(ProjectDir)..\EditMsi.vbs" "$(Configuration)" "$(TargetPath)"
cscript "$(ProjectDir)..\BuildSetup.vbs" "1" "$(Configuration)" "$(TargetPath)"
cscript "$(ProjectDir)..\BuildSetup.vbs" "2" "$(Configuration)" "$(TargetPath)"</PostBuildEvent>
</PropertyGroup>
答案 0 :(得分:0)
这就是诀窍。
<Target Name="AfterBuild">
<CallTarget Targets="AfterBuild1" />
<CallTarget Targets="AfterBuild2" />
<CallTarget Targets="AfterBuild3" />
<CallTarget Targets="AfterBuild4" />
</Target>
<Target Name="AfterBuild1" Inputs="$(OutDir)$(TargetFileName)" Outputs="$(OutDir)\Setup.exe" Condition=" '$(OutputType)'=='package' ">
<GenerateBootstrapper Path="C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\Bootstrapper" ApplicationName="EcoButton" ApplicationFile="$(TargetFileName)" BootstrapperItems="@(BootstrapperFile)" ComponentsLocation="HomeSite" OutputPath="$(OutputPath)" />
</Target>
<Target Name="AfterBuild2">
<Exec Command="cscript "$(ProjectDir)..\EditMsi.vbs" "$(Configuration)" "$(TargetPath)"" />
</Target>
<Target Name="AfterBuild3">
<Exec Command="cscript "$(ProjectDir)..\BuildSetup.vbs" "1" "$(Configuration)" "$(TargetPath)"" />
</Target>
<Target Name="AfterBuild4">
<Exec Command="cscript "$(ProjectDir)..\BuildSetup.vbs" "2" "$(Configuration)" "$(TargetPath)"" />
</Target>