Skip to content

Clarify some manifest values and add examples#6277

Open
sredna wants to merge 2 commits into
microsoft:masterfrom
sredna:manifest_clarify
Open

Clarify some manifest values and add examples#6277
sredna wants to merge 2 commits into
microsoft:masterfrom
sredna:manifest_clarify

Conversation

@sredna

@sredna sredna commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

📖 Description

  • Tries to clarify the description of some of the manifest values.
  • Adds value examples.
  • Adds the UpgradeCode definition.

Notes:

  • UpgradeCode is restricted only to GUIDs because this is a MSI feature. I have verified that all existing manifests in the community repository only uses GUIDs here.
  • DefaultInstallLocation is restricted to strings starting with % or \. The thinking is that the only sane values are %ProgramFiles%\MyApp, %LOCALAPPDATA%\Programs\MyApp and \AppInRootOfDrive.

🔗 References

Fixes some of the issues reported in #6221

🔍 Validation

None/YOLO

✅ Checklist

📋 Issue Type

  • Bug fix
  • Feature
  • Task
Microsoft Reviewers: Open in CodeFlow

@sredna
sredna requested a review from a team as a code owner June 10, 2026 19:37
@github-actions

This comment has been minimized.

@JohnMcPMS JohnMcPMS left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes seem reasonable to me, but I don' actually touch the schema much so I would like someone else to take a look too.

The flow for semantic changes to the schema as part of a new minor version also requires quite a bit more setup. See #5997 and/or #5011.

I think I will also create some additional documentation to prevent the need for you to parse through those if you want to wait for that.

@JohnMcPMS

Copy link
Copy Markdown
Member

#6280 ; you could either grab the script from that PR or wait for it to be merged. But #6279 is updating the minor version that the script picks up so probably want that too.

Comment thread schemas/JSON/manifests/latest/manifest.installer.latest.json
"minLength": 1,
"minLength": 2,
"maxLength": 2048,
"pattern": "^[%\\]",

@pl4nty pl4nty Jun 30, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of apps hardcode a C:\ prefix. Most of these are parsed directly from the installer by komac

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it does not make sense to allow that. I don't think this value is actually used yet but when it is, there are pretty much only 3 places that make sense:

  • %ProgramFiles%\MyApp (Or in %ProgramFiles(x86)%)
  • %LocalAppData%\Programs\MyApp
  • \MyApp (In the root of any drive? The same drive as %windir%?)

@pl4nty pl4nty Jun 30, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately a lot of apps do not install to paths that make sense. I don't think we can block apps from WinGet just because they install to an unusual path

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not about blocking anyone but manifests should match the spec. Some manifests might need to change c:\MyApp to \MyApp etc. to be compliant if they want to update to the latest manifest version.

@pl4nty pl4nty Jul 1, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that could be misleading though. These apps don't install to \MyApp or %SystemDrive%\MyApp, they specifically hardcode C:\MyApp

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that could be misleading though. These apps don't install to \MyApp or %SystemDrive%\MyApp, they specifically hardcode C:\MyApp

C:\ might not even exist on all systems.

Somebody from Microsoft should chime in and say the exact allowed format of this value (which is the point of this PR in the first place).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have any concrete examples of packages in the repository that exhibit this behavior. I suspect we'll need to use a few real examples to make the right decision here.

@sredna sredna Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have any concrete examples of packages in the repository that exhibit this behavior.

Examples of drive c: root folders (I think this is all the packages that do this):

Examples of broken entries:

  • Ethereum.geth.installer.yaml: InstallDir (This looks like a bug in some sort of automated script. In NSIS installers, the default install directory is specified like InstallDir "$ProgramFiles\MyApp")
  • Humanity.DJV2.installer.yaml: Documents\DJV 3.3.4 (I assume they mean My Documents but that should be specified as %userprofile%\Documents)
  • GAM-Team.gam.installer.yaml used to specify ./GAM7 (relative to what?) in older versions but has been corrected to %SystemDrive%\GAM7 in newer versions so this is no longer a problem nor a breaking change.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JohnMcPMS what are your thoughts here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should add a new restriction on the possible values for a field, even if they may be "wrong", because that would break backwards compatibility. We could clean up the community repo, but we can't be sure it's not used like that in some private third party source.

Also, my understanding is that winget doesn't use this to decide where to install a package to, and instead it just tells us where a package installs by default. I think in those cases there is a meaningful difference between having C:\Program Files\MyApp\ and %ProgramFiles%\MyApp\: If %ProgramFiles% is configured in the machine as something different, but the installer uses C:\Program Files\ instead of a variable, then it will try to install there regardless of what your %ProgramFiles% is or whether you even have a C:\ drive.

Same for having a relative path. If an installer defaults to .\MyApp\ relative to where it is run from, then we can't say it's going to be %SystemDrive%\MyApp\ or anything like that. If the app is run from winget then we know it will be relative to winget's cwd, but I think that could change, for example if we're running inproc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants