Skip to content
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

Inform user if a module requires elevation #3758

Merged
merged 5 commits into from Oct 24, 2023

Conversation

msftrubengu
Copy link
Contributor

@msftrubengu msftrubengu commented Oct 12, 2023

Fix #3747

  • Add a new HRESULT for failed importing module because the module requires to run as admin.
  • Also fix places where WINGET_CONFIG_ERROR_UNIT_SETTING_CONFIG_ROOT was missing.
  • We can't have automated tests because we don't currently have a way to run winget as non admin in our tests. I created a UT with a simple test that is skipped in ADO.

I also removed printing details for WINGET_CONFIG_ERROR_UNIT_IMPORT_MODULE because I noticed that "error code could not be found" message is coming the IConfigurationUnitResultInformation description.

Apply :: VSComponents
  Loading the module for the configuration unit failed.
The text associated with this error code could not be found.
Some of the configuration was not applied successfully.

In the configuration module, the IConfigurationUnitResultInformation description is the actual error message that we set in ImportModuleException. My guess is that cppwinrt use some method to get message of well-known errors and set that, but I didn't want to go that deep, so removing it because we are literally printing a line before the text associated with that error code.

Microsoft Reviewers: Open in CodeFlow

@msftrubengu msftrubengu requested a review from a team as a code owner October 12, 2023 00:52
@microsoft-github-policy-service microsoft-github-policy-service bot added the Issue-Bug It either shouldn't be doing this or needs an investigation. label Oct 12, 2023
@github-actions

This comment has been minimized.

JohnMcPMS
JohnMcPMS previously approved these changes Oct 13, 2023
@msftrubengu msftrubengu merged commit e991523 into microsoft:master Oct 24, 2023
8 checks passed
@msftrubengu msftrubengu deleted the admin-loadmod branch November 14, 2023 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inform user if a module requires elevation
2 participants