Schedule a regsvr32 execution on reboot
I'm writing an installer on NSIS that registers a shell extension.
On uninstall and upgrade, the old extension can't be deleted/overwritten since explorer.exe locks it, and killing-restarting the process is ruled out.
So I extract the new extension with a different name, mark the old extension for deletion (uninstall/upgrade) and rename the new extension to its original name (upgrade only) via PendingFileRenameOperations registry key. So far, this works fine.
The problem is, I have to register the new shell component on startup, since PendingFileRenameOperations only works on reboot. Is there a way to schedule a regsvr32 operation after rebooting?
I can't depend on doing this via a .bat execution on RunOn开发者_StackOverflowce, since logging off/logging on also triggers RunOnce operations.
Thanks in advance.
The simplest way I have found to resolve this issue, is to create a registry script that deletes all related registry keys and values. Run the registry script in the (un-)installer, and schedule a "delete on boot" for the COM DLLs. There might be a better way to do this, but I have yet to find it.
精彩评论