Archive: FCT plugin - msgonly


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

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.


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).


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


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.


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


Actually i searched the forum before posting...

Hopefully Takhir will find this post & reply :-)


'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.