如何在 wingetcreate 中更新我的 Windows 应用程序包

How to update my Windows application package in wingetcreate

我想更新我的包时遇到了一个小问题。我将对此进行解释:我发布了我的包。在那之后,我等了 2-3 个小时,我的包裹才到达 GitHub 中的 microsoft/winget-pkgs。我的分支合并成功,它适用于任何 Windows 设备,但是,我创建了我的应用程序的新版本:v3.6.2。我发布的版本是 v3.5.7。所以现在,我无法发布该版本,因为当我执行此 cmd 命令时显示此错误:wingetcreate update <packageIdentifier> -u https://github.com/YourUsername/yourrepository/releases/download/3.6.2/yourapp.exe --version 3.6.2 -t ghp_YourGithubPersonalAccessTokenWith_public_repo_setting.

如果你想要图片,我会给你看图片(顺便说一句,我的 Windows 是法语):Here the image. But as you can see, the red is the error and I tried everything, I searched on Google and didn't find anything that fixed my problem, I tried the examples showed above when you only execute this command: wingetcreate.exe update but still the same error message that you can see on the image.

所以我决定采用第三个示例,但没有成功。有什么方法可以更新我的 WinGet 包吗?谢谢!

我不知道这是否有帮助,但我可以给你一些信息:它是创新的,架构是 Neutral

重要提示 最后一个答案有效,但如果你键入命令 winget search <YourApp>,它将保留以前的版本,如果你安装,它会安装以前的版本......如何解决这个问题,因为它是乱七八糟的 NOT 正在更新但什么都不做

在不知道清单内容或安装程序元数据的情况下,我很难确切知道问题出在哪里。我的直觉是,在尝试将您提供的安装程序与现有清单中当前指定的现有安装程序进行匹配时,架构不匹配。要覆盖检测到的体系结构,您可以使用“|”符号后跟所需的体系结构。这是一个例子:

wingetcreate update <packageIdentifier> -u "https://github.com/YourUsername/yourrepository/releases/download/3.6.2/yourapp.exe|x64" --version 3.6.2 -t <githubToken>

如果这对您不起作用,我鼓励您 post 在 GitHub repository 上提出问题,以便我们进一步帮助您。

好的,我找到了方法:你把包含的代码,加上-s:

wingetcreate update -s <packageIdentifier> -u "https://github.com/YourUsername/yourrepository/releases/download/3.6.2/yourapp.exe|x64" --version 3.6.2 -t <githubToken>

它将在 GitHub 上发布应用程序以进行验证,在您输入的命令提示符中(将引号中的句子替换为您当前的清单文件):

winget validate --manifest "PathToYourManifestShowedInGreenAfterPublishing"

GitHub 上的验证完成后,它就完成了,通常它应该可以工作。

注意: GitHub 上的验证可能需要 2 到 3 小时甚至 4 小时。要有耐心! (我希望)