Skip to content
⌘ NSIS Forum Archive

FCT plugin - msgonly

8 posts

vicky1981#

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#
Speaking about your application I guess you know the window class/title so you may simply use the FindWindow instruction,



Just search the forum, you'll find loads of examples.
vicky1981#
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#
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.

vicky1981#
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#
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,

Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.
vicky1981#
Actually i searched the forum before posting...

Hopefully Takhir will find this post & reply :-)
Takhir#
'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.