winget-cli
winget-cli copied to clipboard
Exclamation marks not allowed in PackageIdentifier
Please confirm these before moving forward
- [X] I have searched for my issue and not found a work-in-progress/duplicate/resolved issue.
- [X] I have not been informed if the issue is resolved in a preview version of the winget client.
Category of the issue
Other
Brief description of your issue
I encountered this error when creating a new application package manifest. It does not allow exclamation marks in the path. However, there is no restriction on this in the matching rules of the schemas.
Steps to reproduce
create manifests
manifests\h\huanghongxun\HelloMinecraft!Launcher\3.5.3.221\huanghongxun.HelloMinecraft!Launcher.installer.yaml
# Created using wingetcreate 1.1.2.0
# yaml-language-server: $schema=https://aka.ms/winget-manifest.installer.1.2.0.schema.json
PackageIdentifier: huanghongxun.HelloMinecraft!Launcher
PackageVersion: 3.5.3.221
Installers:
- Architecture: x86
InstallerType: portable
InstallerUrl: https://github.com/huanghongxun/HMCL/releases/download/v3.5.3.221/HMCL-3.5.3.221.exe
InstallerSha256: EC9DB614C849A315F20B1E43AEBC5E7ADFAB5F3A7AD6DA04A9886BD6E82F28A5
ManifestType: installer
ManifestVersion: 1.2.0
manifests\h\huanghongxun\HelloMinecraft!Launcher\3.5.3.221\huanghongxun.HelloMinecraft!Launcher.locale.zh-CN.yaml
# Created using wingetcreate 1.1.2.0
# yaml-language-server: $schema=https://aka.ms/winget-manifest.defaultLocale.1.2.0.schema.json
PackageIdentifier: huanghongxun.HelloMinecraft!Launcher
PackageVersion: 3.5.3.221
PackageLocale: zh-CN
Publisher: huanghongxun
PackageName: Hello Minecraft! Launcher
License: GPL-3.0 License
Copyright: Copyright (C) 2021 huangyuhui
ShortDescription: HMCL 是一个免费、开源的 Minecraft 启动器,允许玩家方便快捷地安装、管理、运行游戏。
ManifestType: defaultLocale
ManifestVersion: 1.2.0
manifests\h\huanghongxun\HelloMinecraft!Launcher\3.5.3.221\huanghongxun.HelloMinecraft!Launcher.yaml
# Created using wingetcreate 1.1.2.0
# yaml-language-server: $schema=https://aka.ms/winget-manifest.version.1.2.0.schema.json
PackageIdentifier: huanghongxun.HelloMinecraft!Launcher
PackageVersion: 3.5.3.221
DefaultLocale: zh-CN
ManifestType: version
ManifestVersion: 1.2.0
winget install
C:\>winget install -m <manifests path>
Actual behavior
Expected behavior
no error
Environment
[winget --info]
Windows 程序包管理器 v1.3.2091
版权所有 (C) Microsoft Corporation。保留所有权利。
Windows: Windows.Desktop v10.0.22000.856
系统体系结构: X64
程序包: Microsoft.DesktopAppInstaller v1.18.2091.0
日志: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
链接
----------------------------------------------------------------------------
隐私声明 https://aka.ms/winget-privacy
许可协议 https://aka.ms/winget-license
第三方声明 https://aka.ms/winget-3rdPartyNotice
主页 https://aka.ms/winget
Windows 应用商店条款 https://www.microsoft.com/en-us/storedocs/terms-of-sale
Screenshots and Logs
Well, the fix would be to change the PackageIdentifier
from huanghongxun.HelloMinecraft!Launcher
to huanghongxun.HelloMinecraftLauncher
as Windows does not allow !
in the Path.
I can't recall but hopefully the pipelines does not allow special characters as that would break alot of stuff. Should probably be double checked in both WinGet Create and YamlCreate @denelon @Trenly
Should probably be double checked in both WinGet Create and YamlCreate
YamlCreate will allow !
in the package Identifier, but I would suggest that this is actually an issue with the schema, as that is what both WingetCreate and YamlCreate use to validate
@ryfu-msft do we need to look at how we're validating?