Skip to content
⌘ NSIS Forum Archive

How can i detect started application ?

10 posts

izverg#

How can i detect started application ?

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

Thanx.
Joost Verburg#
Make your application set a mutex and use the System plug-in in the installer to check whether the mutex exists.
izverg#
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.
Brummelchen#
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.
Joost Verburg#
Using a mutex is still a better way than finding windows. Check MSDN for the CreateMutex API.
izverg#
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 🙁
ramon18#
Check out ${NSISDIR}\Contrib\System and examples, with this plugin you can call any API from windows

good luck,
Ramon