This is currently only a high-level idea. Before implementing it in our environment, I would appreciate a thumbs-up from Patch My PC on whether the approach is considered safe and supported.
The plan is to create a Microsoft Intune Remediation running every hour to detect and clean up IFEO entries left behind by interrupted installations.
--------------------------------------------------------------------------
Detection
Check 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options' for Debugger values containing *patchmypc-preventstart.exe*.
-
If found, check the 20 most recent package folders in:
Only consider folders containing PatchMyPC-PreventStart.exe.
Use Sysinternals handle64.exe to verify whether any process is still using those folders.
If no process is using them, report the IFEO entries as orphaned and trigger remediation.
Remediation
Simply delete the IFEO entries identified by the detection script.
--------------------------------------------------------------------------
The goal is to run this hourly, allowing devices to recover relatively quickly from an interrupted Patch My PC installation while avoiding removal of IFEO entries when an installation is still active.
At this stage I'm mainly looking for feedback/approval on the high-level approach before developing and implementing it in our environment.