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

Launch COM server for elevated use via packaged path #4567

Merged
merged 2 commits into from
Jun 21, 2024

Conversation

JohnMcPMS
Copy link
Member

@JohnMcPMS JohnMcPMS commented Jun 20, 2024

Change

Leverage the feature that allows launching a packaged process via its packaged executable location as long as there is a matching alias. This better ensures that we are launching the correct process.

Validation

While the dev usage can't use this path due to the way it and development deployed packages work, the code to find the executable is being run to ensure correct functionality. It is then replaced with the alias path that was being used previously.

Microsoft Reviewers: Open in CodeFlow

@JohnMcPMS JohnMcPMS requested a review from a team as a code owner June 20, 2024 21:58
LONG result = FindPackagesByPackageFamily(pfn.c_str(), PACKAGE_FILTER_HEAD, &count, nullptr, &bufferLength, nullptr, nullptr);
THROW_WIN32_IF(result, result != ERROR_INSUFFICIENT_BUFFER);

for (size_t i = 0; i < 10 && result == ERROR_INSUFFICIENT_BUFFER; ++i)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this for "in case a new package is added between our calls"?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is defensive, yes.

@JohnMcPMS JohnMcPMS merged commit 75803c3 into microsoft:master Jun 21, 2024
8 checks passed
@JohnMcPMS JohnMcPMS deleted the manact branch June 21, 2024 00:13
@PatrickSchmidtSE
Copy link

PatrickSchmidtSE commented Jun 26, 2024

@JohnMcPMS Could this also help with general COM stuff ?.we are using the COM API to install/update packages. But performance is worse than using CLI . CLI works most of the time but COM method delivers "No applicable installer" for many packages. And cli with same options works just fine. Code must be also fine because some packages can be updates via COM.api. but success rate is 40% in COM vs 90% in cli

If not I am happy to provide some details :)

@JohnMcPMS
Copy link
Member Author

@JohnMcPMS Could this also help with general COM stuff ?.we are using the COM API to install/update packages. But performance is worse than using CLI . CLI works most of the time but COM method delivers "No applicable installer" for many packages. And cli with same options works just fine. Code must be also fine because some packages can be updates via COM.api. but success rate is 40% in COM vs 90% in cli

If not I am happy to provide some details :)

This should have no functional impact and probably wouldn't even affect your use. Creating an issue with details is the best thing to do. Make sure you include how exactly you are using the COM API (user, session, where you got the binaries, etc.)

@PatrickSchmidtSE
Copy link

@JohnMcPMS #4589 here is the issue :)

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.

None yet

3 participants