将时间戳添加到已签名的 AppX 捆绑包

Add timestamp to signed AppX bundle

我们的 Windows Store 应用由 Visual Studio 使用我们的自定义代码签名证书签名,以允许侧载生成的 AppX 包。

由 Visual Studio 生成的 AppX 包(我猜是在 _CreateBundle 构建步骤中)不会向数字签名添加任何可信时间戳。这可以防止在证书过期后安装捆绑包。

有没有办法调整或配置 _CreateBundle 构建任务,在打包和唱歌过程中添加时间戳?我查看了 SignTool(我们用它来对 MSI 包进行代码签名),但是 documentation 产生

You can't use the SignTool time stamp operation on a signed app package; the operation isn't supported.

.. 并且我的包裹已经在 _CreateBundle 步骤中由 Visual Studio 签署,看起来。

澄清文档:不能向已签名的包添加时间戳,但 SignTool 可以重新签名包并包含时间戳。所以我添加了一个 post-build 事件来重新签署由 Visual Studio:

生成的包
if $(SolutionName) == Installer (
  "C:\Program Files (x86)\Windows Kits\bin\x86\signtool.exe" sign /fd SHA256 /a /f "$(ProjectDir)..\..\Build\CodeSigning.pfx" /tr http://tsa.starfieldtech.com "$(TargetDir)AppPackages\my_app\my_app.appxbundle"
)