Skip to content

feat(pedm): explicitly support elevating .msi files #1325

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

Merged
merged 1 commit into from
May 8, 2025

Conversation

thenextman
Copy link
Member

@thenextman thenextman commented May 8, 2025

By inspecting elevated .msi files launched from Explorer, we see that Explorer invokes %systemroot%\system32\msiexec, with the command line "%systemroot%\system32\msiexec" /i "{path-to-msi}".

We achieve the same in the PEDM module by using the same command if the file extension is .msi. The .msi extension is already being trapped by the shell extension, but previously we would call CreateProcess on the .msi causing "file is not a valid Win32 executable".

Additionally, I polished and added @awakecoding's original "ExplorerCommand.ps1" script. This is useful for debugging, where the installed shell extension can't be overwritten as it's in use by Explorer. Install Devolutions Agent with the PEDM feature; then use the PowerShell to unregistered the shell extension. Swap in your development or debug DLL, then re-register the shell extension. If you supply the .pdb file as well it's possible to attach the debugger to Explorer.exe and debug the shell extension code.

@thenextman thenextman requested a review from a team May 8, 2025 15:08
Copy link
Contributor

@awakecoding awakecoding left a comment

Choose a reason for hiding this comment

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

wooohoo, you're making my day! good job!

@CBenoit CBenoit self-requested a review May 8, 2025 15:09
Copy link

github-actions bot commented May 8, 2025

Let maintainers know that an action is required on their side

  • Add the label release-required Please cut a new release (Devolutions Gateway, Devolutions Agent, Jetsocat, PowerShell module) when you request a maintainer to cut a new release (Devolutions Gateway, Devolutions Agent, Jetsocat, PowerShell module)

  • Add the label release-blocker Follow-up is required before cutting a new release if a follow-up is required before cutting a new release

  • Add the label publish-required Please publish libraries (`Devolutions.Gateway.Utils`, OpenAPI clients, etc) when you request a maintainer to publish libraries (Devolutions.Gateway.Utils, OpenAPI clients, etc.)

  • Add the label publish-blocker Follow-up is required before publishing libraries if a follow-up is required before publishing libraries

@thenextman thenextman force-pushed the pedm-add-msi-support branch from cf8d7c5 to 956e945 Compare May 8, 2025 15:13
Copy link
Member

@CBenoit CBenoit left a comment

Choose a reason for hiding this comment

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

LGTM! Left a few minor comments, feel free to address and merge! 🙂

@thenextman thenextman force-pushed the pedm-add-msi-support branch from 956e945 to 5907767 Compare May 8, 2025 15:22
@thenextman thenextman enabled auto-merge (squash) May 8, 2025 15:22
@thenextman thenextman force-pushed the pedm-add-msi-support branch from 5907767 to 14197e1 Compare May 8, 2025 16:28
@thenextman thenextman merged commit 3989c86 into master May 8, 2025
38 checks passed
@thenextman thenextman deleted the pedm-add-msi-support branch May 8, 2025 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants