Updating the Windows Explorer Shell Extension with Inno Setup

I have a software product that optionally installs Shell Extension in Windows Explorer. This is done in C # and uses the .NET Framework v4.0. The shell extension is installed by Inno Setup during installation using regasm.exe. Everything works fine until I want to install an updated version of the application. The problem is that I cannot update the shell dll because it is loaded into researchers' memory. Before installing Inno Setup, the following message is displayed

enter image description here

It says that the installer must exit Windows Explorer because it uses files that the installer needs to update. It terminates the explorer process, but does not start it again. This is my first problem.

In fact, I do not want to force the user to disconnect the explorer. But I do not know how to unload the managed dll shell from the researchers' memory. If you delete it using regasm.exe, the dll will still remain in memory. In fact, I can’t find the place where this check occurs, because I received installation sources already done.

The file add-in (IssProc.dll) for Inno Setup does not help, because as soon as I finish Windows Explorer with this add-in, the explorer immediately reboots.

How can I solve this problem? How can I update shell dlls with improved user interface? And maybe someone can give me a hint that the code that checks the files used is placed?

O and BTW I am using Windows 7 x64.

+4
source share
2 answers

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

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

Thus, the use of this flag will not cause the wizard to ask the application to stop using the file, but will pay for the next reboot to update the file and offer the user to restart the computer from the installation side, which, in my opinion, is very convenient and commonly used.

+2
source

To turn off the prompt, you just need to set "CloseApplications = no" in [Setup]. But you still need to use the reload flag in the [File] file if you are sure that a replacement is necessary, but later.

0
source

All Articles