vicky1981
27th January 2009 11:11 UTC
FCT plugin - msgonly
Hello,
I would like to identify whether my application is currently running while i am uninstalling it. I don't want to kill/close the application, but rather notify the user to close it.
I found that FCT plugin suits my needs. However, I have a problem. Eventhough I am using /MSGONLY parameter (Not attempts to terminate the process), it is still terminating the application. what is wrong with my code?
How can I know that FCT identified a running instance of my application? Return value should be >0?
fct::fct /WC "SunAwtFrame" /WTP "partial application name" /MSGONLY
Pop $0
StrCmp $0 1 0 OK1
MessageBox MB_OK "The application you are trying to uninstall is running. Close it and try again."
Abort ok1:
Thanks in advance
Red Wine
27th January 2009 12:45 UTC
Speaking about your application I guess you know the window class/title so you may simply use the FindWindow instruction,
http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.14.5
Just search the forum, you'll find loads of examples.
vicky1981
27th January 2009 13:00 UTC
Hello,
FindWindow doesn't suit my needs because my application's class name is "SunAWTFrame" and most of the java application using JFrame tend to have the same. And title is only partial i.e. only some part of the title is constant and the remaining part changes (project name).
Red Wine
27th January 2009 13:11 UTC
Takhir added a function in wiki which involve system plugin, did you check it?
You may replace the part of killing the process with interactive messages.
http://nsis.sourceforge.net/Find_and_Close_or_Terminate
vicky1981
27th January 2009 13:24 UTC
thanks for the quick replies.....
"Find and Close or Terminate" macro won't work as it needs unique & complete class name or unique & complete class title.
Red Wine
27th January 2009 13:45 UTC
You're welcome.
Same issue huh?
I'm sure I've seen here several related threads, so what do you say, are you going to dig the forum? :)
Here's the result of a very quick search,
http://forums.winamp.com/showthread....hreadid=248179
vicky1981
27th January 2009 14:00 UTC
Actually i searched the forum before posting...
Hopefully Takhir will find this post & reply :-)
Takhir
27th January 2009 14:41 UTC
'Close or Terminate' means that plug-in first sends WM_CLOSE to application and then (optionaly) terminates application. 'Find only' mode not supported in current version (may be in next release? :) ). But you can try to find application by file name, for example http://nsis.sourceforge.net/KillProc_plug-in
Also - plug-in returns number of not closed/terminated processes.