PDA

View Full Version : Detect Active Application function not working with a named mutex



Svetlana
04-09-2010, 01:34 PM
Hello,

I'm having some trouble with the Detect Active Application function. Attached is the code sample. It includes a simple .NET program and a simple Setupbuilder 7 script. This was tested on SetupBuider 7.1.2680.0 and the function “Detect Active Application” does not appear to work with a named mutex at all. (The only option that seems to work is Window Title.) I thought I had this working in a previous version of SetupBuilder. Am I doing something wrong here?

Thanks in advance,
Svetlana

linder
04-10-2010, 04:44 AM
Svetlana,

I have uploaded a test application for you:

http://www.lindersoft.com/projects/Mutex2.zip

Compile and run mutex.sb7. If you do not start coolapp.exe, then it will report "Mutex NOT found". If you start coolapp.exe (creates named mutex object "MutexTest"), the SB7 application will report "Mutex found".

Hope this helps.

Friedrich

Svetlana
04-12-2010, 08:17 AM
Thanks for your help, we found the issue. We actually start our application from the sb7 installer and apparently weren't giving it enough time to start up and initialize its mutex before checking for it. We put in a sleep time of 2 seconds after starting the app and now it works fine. Interesting though, the Window Title was being detected even before the sleep time... it must be the first thing the app does.