Repository navigation
Use in-proc winget in PowerShell module when running as SYSTEM - #3129
Merged
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
yao-msft
reviewed
Apr 5, 2023
| /// <param name="expectedVersion">Expected version.</param> | ||
| public static void AssertWinGet(PSCmdlet psCmdlet, string expectedVersion) | ||
| { | ||
| // In-proc shouldn't have other dependencies and thus should be ok. |
Contributor
Member
Author
There was a problem hiding this comment.
This was caveat 1 from my PR summary. We will need to statically link the runtime in to be able to release this in a self-contained form. My hope is that we can do that with some form of property override on the internal release build. If that doesn't work, then a future PR will need to create a new build flavor that only changes to static linkage.
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
This change uses the in-proc WinRT binaries and activation path when running as
SYSTEMin the PowerShell module. It also makesAssert-WinGetPackageManagersucceed as long as the OS version is high enough in that case.There are two known caveats with this that could be addressed in a future change if needed:
SYSTEMthe module requires running PowerShell with the MTA option.Validation
Ran module in user and
SYSTEMcontexts using theInitialize-LocalWinGetModules.ps1script.Microsoft Reviewers: Open in CodeFlow
Microsoft Reviewers: Open in CodeFlow