-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Scope Switches to Manifest #4167
Conversation
This comment has been minimized.
This comment has been minimized.
Winget 1.7 manifest is closed for changes as we are doing a winget 1.7 release candidate by end of this week. We can consider this change in winget 1.8 if needed. P.S. Personally I feel these switches are a bit overlapping with the InstallerScope installer property. In the whole workflow, InstallerScope is used for installer selection, like architecture. And specific switch values for the InstallerScope, architecture would go to Custom (existing winget-pkgs usage). |
They are, but the advantage of having these be switches can make it easier to understand how an installer works, and that the switches are the only difference between the scopes.
This change may partially address one key issue though, in that after an installer is selected, if the scope is not specified in the manifest or through an installer switch, there is not a way to know which scope has been selected for install. Consider the upgrade case where an installer is of unknown scope, and the current install is machine scoped. Once the installer is selected, there is no easy way to determine the scope that should be used. By allowing there to be a concept of switches for scope, the loading of the single installer into two with defined scopes solves that issue.
I can understand that; These could be made internal-only, but then they couldn’t be overridden. They could also be renamed, which may help. Regarding the switches for architecture, I would argue that if they were anywhere near as common as switches for scope, then why not have them switch-selectable with defaults based on installer type? More than 10% of the manifests currently in winget-pkgs currently have |
By the way, we need to also consider "somewhat breaking" behavior change for old clients. For the example with the Microsoft.Azure.StorageExplorer, if a winget 1.6 client is working on the new manifest, it does not know to look at the new switches, it relies on the installer selection logic to apply correct switches. This change will make old clients see only 1 installer with Custom: /NoRestart. |
That is true, but to me it is no different than updating the default switches for an installer type. In an older version of the client, the updated default switches wouldn’t be applied anyways which would result in the same behavior if the manifest didn’t include them. It's just that this happens to be the scope switches specifically. If this is something that can be moved into 1.8, I would imagine that the same process would be used where the new manifest version wouldn’t be accepted in the winget-pkgs repo until a substantial portion of users had upgraded to the 1.8 client |
Also, if this is something that the team decides to simply not move forward on, its no big deal to me. I didn't put too much effort into making these changes and only raised the PR as I thought it could be helpful to manifest authors |
Yep, thanks for raising this idea. I have mixed feeling about having specific "installer property value" based switches. I think we'll revisit in winget 1.8. |
I feel it's a bit different. "Updating default switches" does not break existing behavior of old clients. Old clients just do not get new feature. While "manifest change in winget-pkgs" changes existing behavior of old clients. But if we decide to go with this change, we could certainly wait for some time and update manifests in winget-pkgs after large portion of users have moved to new clients. |
Take for example the new default switches that were just added for Inno - specifically Sure, adding the |
I agree, any installer switches changes to existing manifests may affect existing behavior for old clients. Do you happen to know if specifying "/SUPPRESSMSGBOXES" twice during installer invocation will cause installer failures? If not, maybe we should just not modify existing manifests that have "/SUPPRESSMSGBOXES" as Custom switch. By the way, I thought /SUPPRESSMSGBOXES would better fit in silent | interactive behavior switches, not Custom. So that the /SUPPRESSMSGBOXES change would not affect existing manifests. But I cannot control how every manifest is authored. Regarding old clients handling new manifests, yes, there are potential that old clients cannot work well with new manifests. Our goal is to keep compatibility as best as we can. Like for this change, if we know moving the scope switches will break old clients, we should probably not do anything to existing manifests. Or only make the manifest change after most people moved to new clients. |
Some installer types, like
Inno
, have default switches that control whether they install in User scope or Machine scope. Other times, ISV's build custom switches into their installer to allow for this.Currently, in order to have separate switches for each scope, there must be two installer nodes. One for the user scope with the
Custom
switch set to the user scope switch, and one for the machine scope with theCustom
switch similarly set. This makes it difficult to suggest changes when a user only has one installer in the manifest. Additionally, it makes it difficult to identify the differences between installers when they are identical except for theScope
and theCustom
switch.This PR adds two new installer switches -
ScopeUser
which is added when the installation is happening on a user scoped install, andScopeMachine
which is added when the installation is happening on a machine scoped install. It also sets the defaults forInno
installers.This means that two scoped installers can now be combined into a single un-scoped installer in the manifest. As this will appear as
ScopeEnum::Unknown
for manifest selection, the logic when loading a manifest was updated such that ifScopeUser
orScopeMachine
are present for an installer, then a copy of that installer for each scope is loaded. This allows for certainty that the correct scope will be used in an upgrade scenario, as the ManifestComparator will choose the scope which is currently installed.Microsoft.Azure.StorageExplorer manifest
MyCloudGame.AirGamePlay manifest
###### Microsoft Reviewers: [Open in CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com//pull/4167)