我看到一些我无法解释的奇怪行为。
我正在使用wix生成msi并使用msbuild GenerateBootstrapper任务来处理先决条件。所有似乎正确构建,即没有错误或警告,但生成的setup.exe将无法运行。它提供了一个漂亮的空白错误对话框,事件日志提供了相同的信息。
踢球者是如果我下拉到命令行并在项目上手动运行msbuild并指定引导程序目标,它会生成正确且有效的setup.exe。
我已经使用此wix article作为入门基础。我还在StackOverflow上使用了一些问题来尝试提出修复。
之前有没有人见过这种行为,更好的还是修复?
这是调用GenerateBootstrapper任务的项目文件的一部分:
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
....
<Import Project="$(WixTargetsPath)" />
<ItemGroup>
<BootstrapperFile Include="Microsoft.Net.Framework.3.5">
<ProductName>Microsoft .NET Framework 3.5</ProductName>
</BootstrapperFile>
<BootstrapperFile Include="Microsoft.Windows.Installer.3.1">
<ProductName>Windows Installer 3.1</ProductName>
</BootstrapperFile>
</ItemGroup>
<Target Name="Bootstrapper" Inputs="$(OutDir)$(TargetFileName)" Outputs="$(OutDir)\Setup.exe" Condition=" '$(OutputType)'=='package' ">
<GenerateBootstrapper
ApplicationName="MyProductName"
ApplicationFile="$(TargetFileName)"
BootstrapperItems="@(BootstrapperFile)"
ComponentsLocation="HomeSite"
OutputPath="$(OutputPath)"
Culture="en-US" />
<Exec Command=""C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\signtool.exe" sign /a setup.exe" WorkingDirectory="$(OutputPath)" />
<Exec Command=""C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\signtool.exe" timestamp /t http://timestamp.verisign.com/scripts/timstamp.dll setup.exe" WorkingDirectory="$(OutputPath)" />
<Exec Command=""C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\signtool.exe" sign /a $(TargetFileName)" WorkingDirectory="$(OutputPath)" />
<Exec Command=""C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\signtool.exe" timestamp /t http://timestamp.verisign.com/scripts/timstamp.dll $(TargetFileName)" WorkingDirectory="$(OutputPath)" />
</Target>
<PropertyGroup>
<BuildDependsOn>$(BuildDependsOn);Bootstrapper</BuildDependsOn>
<PreBuildEvent>
"C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\signtool.exe" sign /a "$(SolutionDir)Dotfuscator\$(ConfigurationName)\Dotfuscated\Application1.exe"
"C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\signtool.exe" timestamp /t http://timestamp.verisign.com/scripts/timstamp.dll $(SolutionDir)Dotfuscator\$(ConfigurationName)\Dotfuscated\application1.exe"
</PreBuildEvent>
</PropertyGroup>
</Project>
这是我用它来生成一个有效的setup.exe的命令:
msbuild wixproject.wixproj /target:Bootstrapper /p:Configuration=Release
答案 0 :(得分:0)
您应该在GenerateBootstrapper元素中定义Path属性。例如,对于Windows 8,路径变量是:
<GenerateBootstrapper
Path="C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\Bootstrapper\Packages"