Skip to content
⌘ NSIS Forum Archive

How to run a single setup when clicking on the setup exe file few times

4 posts

mayPol#

How to run a single setup when clicking on the setup exe file few times

Hi,

I created a setup file, called mySetup.exe.

When clicking on this setup, the setup dialog opens. If clicking again on the setup, another dialog opens. How can I make that only one setup will run in a current moment ?

Thanks,
May
onad#
Function .onInit

;Allow only one installer instance
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "5C00D2E5-758B-4F49-A0BB-03E596E0B470") i .r1 ?e'
Pop $R0
StrCmp $R0 0 DoRunInstall
Abort
DoRunInstall:

...
onad#
NOTE:
I've created the GUID in the example for you, so I know it is quite unique 😉 and will not criple other installers...