I came across the problem within my NSIS-script which happens whenever the user launches the (un)installer twice.
Thanks to the Wiki, I found the solution (http://nsis.sourceforge.net/Allow_on...aller_instance), but even the “even more advanced†example
doesn’t work — no matter if I modify “IntCmp $1 0 +5†to “+4†(or even “+3â€) or not.BringToFront
# Check if already running
# If so don't open another but bring to front
System::Call "kernel32::CreateMutexA(i 0, i 0, t '$(^Name)') i .r0 ?e"
Pop $0
StrCmp $0 0 launch
StrLen $0 "$(^Name)"
IntOp $0 $0 + 1
loop:
FindWindow $1 '#32770' '' 0 $1
IntCmp $1 0 +3
System::Call "user32::GetWindowText(i r1, t .r2, i r0) i."
StrCmp $2 "$(^Name)" 0 loop
System::Call "user32::ShowWindow(i r1, i 9) i." ; If minimized then maximize
System::Call "user32::SetForegroundWindow(i r1) i." ; Bring to front
Abort
launch:
By “doesn’t workâ€, I mean that there’s only _one_ installer launched, but that one _never_ gets brought to the front or maximized (when previously minimized, of course).
The test bed consists of Vista Business x64 with myself having administrative rights, several entries at the taskbar and HM NIS Edit 2.0.3 as the IDE.
If somebody knows something: please, share your knowledge and/or ideas! 🙂
/Martin..