grahama
2nd October 2004 20:48 UTC
'Prevent Launching Twice' Function fails in XP Home
For some reason, the below function works fine in the .oninit for Win2k. For, Windows XP Home, I get the 'The Installer is allready Running' message box. It will give me the message box whether the installer is allready running or has been previously quit.
does anyone know what this can be ? I'm sure I am misusing the function somehow...
many thanks
g
Function preventLaunchingTwice
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "6q9nEUg5") i .r1 ?e' Pop $R0
StrCmp $R0 0 +3
MessageBox MB_OK|MB_ICONEXCLAMATION "The installer is already running."
Abort
FunctionEnd
kichik
2nd October 2004 21:47 UTC
Is that an exact copy of the code? If it is, you're missing a new line between
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "6q9nEUg5") i .r1 ?e'
and
Pop $R0
grahama
3rd October 2004 01:48 UTC
yes, Pop $R0 is on a separate line
let me repaste....
Function preventLaunchingTwice
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "6q9nEUg5") i .r1 ?e'
Pop $R0
StrCmp $R0 0 +3
MessageBox MB_OK|MB_ICONEXCLAMATION "The installer is already running."
Abort
FunctionEnd
grahama
3rd October 2004 23:09 UTC
anyone have any ideas on what this might be?
Yathosho
3rd October 2004 23:25 UTC
could some process already use "6q9nEUg5"? as i can't provide a solution, you might want to use MB_YESNO as a work-around.
grahama
3rd October 2004 23:43 UTC
Ok
I'll change the string and change the messagebox to MB_YESNO
many thanks