Archive: Mutex and Vista Sessions


Mutex and Vista Sessions
  I am making an installer to patch a program.
Said program creates a mutant, which it checks to stop duplicated copies, which is good.

Problem is, it creates it in

\BaseNamedObjects\

Instead of:
\Sessions\1\BaseNamedObjects\


With the macro I have to create a mutex

macro MutexCheck _mutexname _outvar _handle

System
::Call 'kernel32::CreateMutexA(i 0, i 0, t "${_mutexname}" ) i.r1 ?e'
>StrCpy ${_handle} $1
Pop${_outvar}
!macroend
>
It creates the mutex in
\Sessions\1\BaseNamedObjects\


How can I 'attempt' to create it in
\BaseNamedObjects\

So I can check if the program is running (and block it from running while installer is! [most important bit])

Thank you for your time.

try naming the mutex "Global\Whatever"


Thank you very much!
I didn't expect it to be that easy.

I saw somewhere on Google something mentioning about sessions, and 'global' and some other keywords, but I guess it was late at night, and couldn't understand it at the time, hee hee.

Thank you again.