StrCmp and invalid opcode
Yet again, my broken code or something up with NSIS 2.45?
The code below works fine and no issues.
Function .onInit
;various other stuff
phase2:
;Prevent Multiple Instances
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "myMutex123") i .r1 ?e'
Pop $R0
StrCmp $R0 0 phase3
MessageBox MB_OK|MB_ICONEXCLAMATION "The $(^Name) installer is already running." /SD IDOK
${WriteErrorCode} "200" "The $(^Name) installer is already running." ; this function calls Abort
phase3:
;Check min disk space requirements
!ifndef DEVELOPMENT
;more stuff
The code below does NOT work. Soon as one launches the installer, you'll get "Installer corrupted. Invalid opcode"
Function .onInit
;various other stuff
phase2:
;Prevent Multiple Instances
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "myMutex123") i .r1 ?e'
Pop $R0
StrCmp $R0 0 +4
MessageBox MB_OK|MB_ICONEXCLAMATION "The $(^Name) installer is already running." /SD IDOK
${WriteErrorCode} "200" "The $(^Name) installer is already running." ; this function calls Abort
phase3:
;Check min disk space requirements
!ifndef DEVELOPMENT
;more stuff
What gives? Why do I need a tagged goto location instead of just using line numbers?