Archive: Ask to shut down a program before installing


Ask to shut down a program before installing
Hi everyone,

At work we got an app with a NSIS setup and we have a problem during the updates.

If a client does an update while the program is running, the main exe can't be replaced, NSIS generates an error but continues installing and does the Post actions (writes the new version number into the registry).

Then the client runs the app with the new version number but with the old exec.

So I wandered if it is possible to check if the exe is running before installing the software and if it is, ask the client to shut it down (like we can see on java installations).

Many Thanks :)


There are several ways to do what you want. An easy way to do this is by using the LockedList plugin:

http://nsis.sourceforge.net/LockedList_plug-in


Thanks, I'll try that and keep you in touch :)


This is an almost perfect plugin except that it is not multilingual but it contains some nice features I can use.


The LockedList plugin's ReadMe file explains how to change a lot of the text which gets displayed.

If you use LangString commands to define the text strings then it is easy to make the LockedList plugin display appropriate text strings.

The attached screenshot is from a modified version of one of the example scripts that comes with the plugin. I don't speak French so I used Google to translate the strings so they may not make much sense!


Thanks, I'll read the readme this sounds perfect :up:


See also http://nsis.sourceforge.net/Check_wh...ion_is_running