Archive: How can i detect started application ?


How can i detect started application ?
Hello!
How can I detect that my application is already started before beginning of deinstallation process ?

Thanx.


Make your application set a mutex and use the System plug-in in the installer to check whether the mutex exists.


Originally posted by Joost Verburg
Make your application set a mutex and use the System plug-in in the installer to check whether the mutex exists.
Show, please, piece of the script-code demonstrating this possibility.

FindWindow ${TEMP1} "" "My wnd caption"
SendMessage ${TEMP1} ${WM_QUIT} 0 0

not work ;(( why ?


Try it this way

  GoTo Running

Exit:
MessageBox MB_YESNO|MB_ICONEXCLAMATION "$(MUI_TEXT_ABORTWARNING)" \
IDNO Running
Quit

Running:
FindWindow $R9 "Becky2MainFrame" ""
IntCmp $R9 0 NotRunning
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "Becky! Internet Mail \
is akticv.Pls close Becky." IDCANCEL Exit
GoTo Running
NotRunning:


To determine the right window (eg "Becky2MainFrame") uses this lite program:

You need the label "Win Class" - NSIS can also perfom on special sub windows here called "Win Title".
Pls read the manual to this.

Using a mutex is still a better way than finding windows. Check MSDN for the CreateMutex API.


Originally posted by Joost Verburg
Using a mutex is still a better way than finding windows. Check MSDN for the CreateMutex API.
It is obviously even for hedgehog ;) But how I can use WinAPI functions in NSIS-script I haven't found in docs :(

Check out ${NSISDIR}\Contrib\System and examples, with this plugin you can call any API from windows

good luck,
Ramon


This thread talks about using a mutex with NSIS.


Originally posted by kichik
This thread talks about using a mutex with NSIS.
thanx!