Question

I have a program product which additionally installs Shell Extension to Windows Explorer. It made in C# and uses .NET Framework v4.0. Shell extension are installing by Inno Setup during installation by using regasm.exe. Everything works fine until I want to install updated version of application. The problem is I can’t update shell extension dll because it loaded into explorer’s memory. Before installing Inno Setup shows me following message

enter image description here

It says installer needs to terminate Windows Explorer because it uses files which should be updated by installer. It terminates explorer process but doesn’t launch him again. That’s my first issue.

Actually I don’t want to force user shutdown explorer. But I don’t know how to unload managed shell dll from explorer’s memory. If uninstall it by regasm.exe dll still remains in memory. In fact I can’t even find place where this checking occurs because I received already made installation sources.

Files-In-Use (IssProc.dll) add-in for Inno Setup doesn’t help because as soon I terminate windows explorer by this add-in, explorer immediately restarts.

How could I solve this issue? How could I update shell extension dll with better user experience? And maybe someone could give me a hint where’s that code which checks for files in use is placed?

O and BTW I'm using Windows 7 x64.

Was it helpful?

Solution

Use the restartreplace flag at your file entry. From the reference:

When an existing file needs to be replaced, and it is in use (locked) by another running process, Setup will by default display an error message. This flag tells Setup to instead register the file to be replaced the next time the system is restarted (by calling MoveFileEx or by creating an entry in WININIT.INI). When this happens, the user will be prompted to restart their computer at the end of the installation process.

So using this flag won't cause the wizard to ask to terminate applications using the file but schedule the file update to the next reboot and prompt user to restart the computer at the installation end, what is in my opinion quite user friendly and commonly used.

OTHER TIPS

To disable the prompt , you should set "CloseApplications=no" in the [Setup] simply . But you still need use the restartplace flag in the [File] if your are sure the replacement is necessary but later.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top