winget-create icon indicating copy to clipboard operation
winget-create copied to clipboard

PackageIdentifier - Input does not match the valid format for this field

Open jdalley opened this issue 7 months ago • 2 comments

Brief description of your issue

Hey folks,

When running wingetcreate new and supplying an installer URL from a release on GitHub, then trying to accept the parsed PackageIdentifier name OR typing it in manually, I get the following error:

"Input does not match the valid format pattern for this field".

I did some searching and I'm seeing a ton of packages that have exactly this format of <author>.<package-name>, so I'm not sure what the problem is exactly.

Image

Steps to reproduce

  1. Run wingetcreate new
  2. When prompted for InstallerUrls, enter: https://github.com/jdalley/command-palette-toggle-hdr/releases/download/v0.0.1/jdalley.ToggleHDRExtensionforCommandPalette_0.0.1.0_x64__ygjv9tpcda3x6.msix and hit enter (twice).
  3. Hit enter to accept suggested/parsed value of jdalley.ToggleHDRExtensionforCommandPalette or manually type jdalley.ToggleHDRExtensionforCommandPalette and hit enter.
  4. Get error

Expected behavior

Be allowed to proceed to the next step after entering a correct PackageIdentifier value.

Actual behavior

Not able to proceed to the next step after entering a correct PackageIdentifier value.

Environment

Windows Package Manager Manifest Creator v1.9.4.0
Copyright (c) Microsoft Corporation. All rights reserved.

Operating System: Microsoft Windows NT 10.0.26100.0
System Architecture: X64

Tried on both Warp terminal (Powershell 7.5.1) and Windows Terminal (Powershell 7.5.1)

Update

It turns out I didn't consider the property section length, and the following regex has enlightened me to the fact that the max length per-section is 32 characters. Shortening it does in fact fix this.

https://github.com/microsoft/winget-cli/blob/master/schemas/JSON/manifests/v1.6.0/manifest.singleton.1.6.0.json#L8

jdalley avatar May 20 '25 23:05 jdalley

It turns out I didn't consider the property section length, and the following regex has enlightened me to the fact that the max length per-section is 32 characters. Shortening it does in fact fix this.

Yep, that's not specifically a winget-create issue since it validates based on the WinGet schema. Maybe you can open an issue at winget-cli to possibly relax the character limit in a new schema version?

mdanish-kh avatar May 27 '25 17:05 mdanish-kh

It turns out I didn't consider the property section length, and the following regex has enlightened me to the fact that the max length per-section is 32 characters. Shortening it does in fact fix this.

Yep, that's not specifically a winget-create issue since it validates based on the WinGet schema. Maybe you can open an issue at winget-cli to possibly relax the character limit in a new schema version?

Oh yeah good point - great suggestion, I've opened one here: https://github.com/microsoft/winget-cli/issues/5498

jdalley avatar May 31 '25 03:05 jdalley