代码之家  ›  专栏  ›  技术社区  ›  Coden00b

如何在GitHub操作中使用SignTool对appx/msix包进行签名

  •  0
  • Coden00b  · 技术社区  · 4 年前

    我正在尝试在Windows GitHub Actions运行程序上执行与此命令等效的操作:

    SignTool sign /fd sha256 /a 
    /f $certificatePath /p $certificatePwd $Packages_2Sign
    

    这导致GitHub操作出现以下错误:

         | The term 'SignTool' is not recognized as a name of a cmdlet, function, script file, or executable
         | program. Check the spelling of the name, or if a path was included, verify that the path is correct
         | and try again.
    

    在GitHub上的Marketplace上,我没有看到任何可以签名appx的东西,只有.dll或.ps1文件。Microsoft推荐的工具需要Azure帐户: https://learn.microsoft.com/en-us/windows/msix/desktop/cicd-keyvault?source=recommendations#using-azure-signtool-with-github-actions

    温馨提示/建议欢迎并感谢!

    0 回复  |  直到 4 年前
        1
  •  1
  •   Lex Li    4 年前

    作为一名Windows用户,您可能会在第一天了解到,并没有将所有可执行文件都添加到Windows PATH中,因此,仅按名称调用可执行文件将不会像错误消息所示那样工作。

    你可以用这样的东西

    $signtool = "C:\Program Files (x86)\Microsoft SDKs\ClickOnce\SignTool\signtool.exe"
    & $signtool sign /fd sha256 /a /f $certificatePath /p $certificatePwd $Packages_2Sign
    

    而是在PowerShell中。

    完整的示例可以在中找到 this repo 。

    推荐文章