説明できない奇妙な動作が見られます。
私は wix を使用して msi を生成し、msbuild GenerateBootstrapper タスクを使用して前提条件を処理しています。すべてが正しくビルドされているように見えます。つまり、エラーや警告はありませんが、生成された setup.exe は実行されません。空白のエラー ダイアログが表示され、イベント ログにもほぼ同じ情報が表示されます。
キッカーは、コマンド ラインにドロップしてプロジェクトで msbuild を手動で実行し、ブートストラップ ターゲットを指定すると、正しい動作する setup.exe が生成されることです。
このウィックスの記事をベースとして使用して開始しました。また、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