Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 27th April 2011, 10:14   #1
juliarg
Junior Member
 
Join Date: Mar 2011
Posts: 28
Detecting application when run by another user. FindWindow or...?

In my uninstaller, I want to handle correctly the situation when one user on the machine tries to uninstall the app when another user has it running. Normally, I identify the running application using FindWindow and then looking at the window's user data from GetWindowLong(). But in this case, it doesn't seem to work. Can FindWindow find another user's windows? Is there a better way to handle this task?
juliarg is offline   Reply With Quote
Old 27th April 2011, 10:38   #2
jpderuiter
Major Dude
 
Join Date: Feb 2007
Posts: 672
FindWindow will not work:
Quote:
Originally Posted by http://support.microsoft.com/kb/310153/en-us
The traditional approach of using FindWindow or FindWindowEx will not work on a Windows XP system on which fast user switching is enabled because it will not detect application instances that are running in different user sessions (on different desktops).
The suggested method on this site using a Global Mutex requires you to edit the application you want to install...
If that's possible, you can use:
http://nsis.sourceforge.net/Allow_on...aller_instance
to check if it's running already.

Else you may try to use the method of trying to open the application executable for writing.
If it fails, it's in use:
http://forums.winamp.com/showthread.php?threadid=274495
Not sure if this works with fast user switching.
jpderuiter is offline   Reply With Quote
Old 7th May 2011, 15:20   #3
Wizou
Senior Member
 
Join Date: Aug 2007
Location: Paris, France
Posts: 304
See http://nsis.sourceforge.net/Check_wh...ion_is_running

maybe one of the answers suits your situation
Wizou 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