Skip to content

Move pre-check errors to post-check#6236

Merged
JohnMcPMS merged 1 commit into
microsoft:masterfrom
JohnMcPMS:try-and-error
May 20, 2026
Merged

Move pre-check errors to post-check#6236
JohnMcPMS merged 1 commit into
microsoft:masterfrom
JohnMcPMS:try-and-error

Conversation

@JohnMcPMS

@JohnMcPMS JohnMcPMS commented May 20, 2026

Copy link
Copy Markdown
Member

📖 Description

We had some pre-check errors for various issues in the OS. Move those to attempt the operation and convert any failures in the scenario on the older OS to the well-known HRESULT.

🔍 Validation

Existing regression tests.

Microsoft Reviewers: Open in CodeFlow

@JohnMcPMS JohnMcPMS requested a review from a team as a code owner May 20, 2026 17:36
// There was a bug in InstallService where admin users were incorrectly identified as non-admin,
// causing false access denied errors; fixed in 10.0.26100.0. On older OS versions, convert any
// failure under these conditions to the error that was previously always returned.
if (FAILED(hr) &&

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.

Should we check for the specific HR?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't know that we know it nor do we know that it is specific to the failure. That could be a future improvement but I don't see it causing any impact with this change.

!Runtime::IsCurrentOSVersionGreaterThanOrEqual(Utility::Version{ "10.0.26100.0" }))
{
AICLI_LOG(Core, Error, << "Device wide install for msstore type is not supported under admin context on this OS version. Error: " << hr);
return APPINSTALLER_CLI_ERROR_INSTALL_SYSTEM_NOT_SUPPORTED;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I know it's a copy paste but nit: RETURN_HR()

@JohnMcPMS JohnMcPMS merged commit dcd3581 into microsoft:master May 20, 2026
9 checks passed
@JohnMcPMS JohnMcPMS deleted the try-and-error branch May 20, 2026 20:32
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.

3 participants