成功完成 wix 引导程序输出的数字签名后 .exe 未安装

After successfully digital sign of wix bootstrapper output .exe is not installing

如果尝试在没有引导程序输出 .exe 文件的数字签名的情况下进行安装,它会在数字签名安装程序显示错误后工作 fine.But。

对 .exe 进行签名,在 bootstrap.wixproj 文件中的结束 /Project 标记之前使用了以下代码。

    <!-- SignOutput must be present in some PropertyGroup to trigger signing. -->
  <PropertyGroup> 
    <SignOutput>true</SignOutput>
  </PropertyGroup>

   <!-- Sign the bundle engine -->
  <Target Name="SignBundleEngine">
    <Exec Command="&quot;C:\Program Files (x86)\Microsoft SDKs\ClickOnce\SignTool\signtool.exe&quot; sign /tr http://timestamp.digicert.com /td sha512 /fd sha512 /f &quot;D:\Digital Sign Resorce\CARoot.pfx&quot; /p Test123 /d &quot;My Project Name&quot; &quot;D:\Project\xxx\v3.2.0.0\SetupWiX\bin\Release\SetupWiX.msi&quot;" />
  </Target>

  <!-- Sign the final bundle -->
  <Target Name="SignBundle">
    <Exec Command="&quot;C:\Program Files (x86)\Microsoft SDKs\ClickOnce\SignTool\signtool.exe&quot; sign /tr http://timestamp.digicert.com /td sha512 /fd sha512 /f &quot;D:\Digital Sign Resorce\CARoot.pfx&quot; /p Test123 /d &quot;My Project Name&quot; &quot;D:\Project\xxx\v3.2.0.0\Bootstrapper_New\bin\Release\MyApp.exe&quot;" />
  </Target>

这对我有用。我将证书(并且只有一个证书)安装在我的构建用户服务帐户的个人存储中,以便自动选择它而无需密码或在其他地方访问 PFX 文件。我的 MSI 已在之前的构建步骤中签名。

  <Target Name="SignBundleEngine">
    <Exec Command="signtool.exe sign /tr http://timestamp.digicert.com &quot;@(SignBundleEngine)&quot;" />
    <Exec Command="Signtool.exe sign /fd SHA256 /tr http://timestamp.digicert.com /td sha256 &quot;@(SignBundleEngine)&quot;" />
  </Target>
  <Target Name="SignBundle">
    <Exec Command="signtool.exe sign /tr http://timestamp.digicert.com &quot;@(SignBundle)&quot;" />
    <Exec Command="Signtool.exe sign /fd SHA256 /tr http://timestamp.digicert.com /td sha256 &quot;@(SignBundle)&quot;" />
  </Target>