Archive: ending a running exe


ending a running exe
i have a small application which keeps running with windows but if i wanna provide an update for it, i cant replace the exe file as it will be running. is there any way i can end task it through NSIS or some way i can remove the registry entry and then restart the installer to continue with the rest of the installation?


There are so many forum threads discussing this... Please search the forum. Here's one for example:

http://forums.winamp.com/showthread....hreadid=128743


i have read all those threads bout killing an application but all dont seem the ideal way of doing it. Is it possible to pass certain parameters to the insaller so that i can make it detect if the older version of the application is running then ask the user to restart the pc and mean while remove the entry from the registry so the application doesnt run again, then after restarting, the installer should continue from where it left not asking the user to click anything or do anything and deleting the older file and replacing it with the new. the main thing that i want is to be able to pass some parameters to the installer so when it restarts, it comes in the silent install mode and complete the rest of the updating. the other way is to re run the installer and ask the user for all the details again, if some switches were written then it can do specified tasks.


Assuming you can't close the application and that you must reboot, you can use $CMDLINE to check the command line parameters passed on to the installer. To make the installer start up silent all you need to do is pass /S and NSIS will take care of the rest. To check if the installer is silent by command line you can use IsSilent. To get the command line parameters alone, without the executable path use GetParameters.

If I were you I would try to avoid the reboot and seek a way to close the process that doesn't involve TerminateProcess. Maybe if you specify the application you're trying to close someone can help you with it. If it is a service you can use Sunjammer's services handler plug-in from the archive's downloads page.


can u plz type some code for me to check if a file is open or running, meaning locked or not


It's very simple, just try to open it using FileOpen.


i tried to use that same command but wasnt able to get the installer compiled as some problem with the variables. i would appreciate it if u just typed that 3 to 4 line code.


Here's one:

http://forums.winamp.com/showthread....light=fileopen


thanx m8