views:

66

answers:

1

I have MSI installer which installs product and this product has several widely used API dll's. These dll's may be loaded into processes that I cannot control during upgrade (for instance, I cannot ask user to close explorer.exe or svchost). So, during MSI upgrade these dll's are locked and cannot be upgraded without reboot. I need to make it upgradeable without reboot. These API dll's are very stable and it is acceptable to leave old copies working in old processes when new versions of these dll's will be loaded into new running processes. So, when we didn't use MSI then we just used standard trick - rename file, mark it to delete on reboot, write new file.

What is the best way how to do it in MSI? Should I create custom action which will do this standard trick? Or maybe MSI has some better way to do it?

Thank you!

+1  A: 

The processes are "locked" because they're in-use, and you can't change an executable file while it's running; there is no "unlock" but to stop using the file. So either you kill the processes now or use the PendingFileRename key to change the file after a reboot...

You could perhaps try to kill the handles/threads that explorer.exe et al have to hold onto your DLLs (using a custom action), which might work for a minute... but that would ensure that (a) your newly upgraded DLLs won't work until after a restart either, and (b) you've probably made the user's computer unstable and Explorer could crash at any moment. Either way, the end users would not be pleased with your software... must worse than they would be annoyed at having to reboot.

ewall
It is not entirely true. As I said in first post, I can leave my old dll's loaded into old processes. And only new ones will use new dll.
Oleg
ewall

related questions