Archive: 'Prevent Launching Twice' Function fails in XP Home


'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


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

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


anyone have any ideas on what this might be?


could some process already use "6q9nEUg5"? as i can't provide a solution, you might want to use MB_YESNO as a work-around.


Ok
I'll change the string and change the messagebox to MB_YESNO
many thanks