Talk:Allow only one installer instance: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
No edit summary
mNo edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
[[Saivert]]
[[User:Saivert]]
You can also put the value of $HWNDPARENT variable in a registry key and then use this in a second invocation of the installer to bring the original installer window to front. Like in this example:
You can also put the value of $HWNDPARENT variable in a registry key and then use this in a second invocation of the installer to bring the original installer window to front. Like in this example:


Line 16: Line 16:


Hope this helps further....
Hope this helps further....
== Forum thread for this article ==
http://forums.winamp.com/showthread.php?t=362157
[[User:Slappy|Slappy]] 04:40, 27 May 2013 (UTC)

Latest revision as of 04:40, 27 May 2013

User:Saivert You can also put the value of $HWNDPARENT variable in a registry key and then use this in a second invocation of the installer to bring the original installer window to front. Like in this example:

System::Call 'kernel32::CreateMutexA(i 0, i 0, t "myMutex") i .r1 ?e'
Pop $R0 
 
StrCmp $R0 0 goahead
  MessageBox MB_OK "The installer is already running." 
  ReadRegStr $R0 HKLM "Software\MyApp" "installerhwnd"
  System::Call 'user32::SetForegroundWindow(i R0) i ..'
  Abort
goahead:
WriteRegStr HKLM "Software\MyApp" "installerhwnd" $HWNDPARENT

Hope this helps further....

Forum thread for this article

http://forums.winamp.com/showthread.php?t=362157

Slappy 04:40, 27 May 2013 (UTC)