Old 27th January 2009, 10:11   #1
vicky1981
Junior Member
 
Join Date: Jan 2009
Posts: 4
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?

code:
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
vicky1981 is offline   Reply With Quote
Old 27th January 2009, 11:45   #2
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
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.

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 27th January 2009, 12:00   #3
vicky1981
Junior Member
 
Join Date: Jan 2009
Posts: 4
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).
vicky1981 is offline   Reply With Quote
Old 27th January 2009, 12:11   #4
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
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

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 27th January 2009, 12:24   #5
vicky1981
Junior Member
 
Join Date: Jan 2009
Posts: 4
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.
vicky1981 is offline   Reply With Quote
Old 27th January 2009, 12:45   #6
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
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

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 27th January 2009, 13:00   #7
vicky1981
Junior Member
 
Join Date: Jan 2009
Posts: 4
Actually i searched the forum before posting...

Hopefully Takhir will find this post & reply :-)
vicky1981 is offline   Reply With Quote
Old 27th January 2009, 13:41   #8
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
'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.
Takhir is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump