Skip to content
⌘ NSIS Forum Archive

Prevent Multiple Installs

2 posts

meaningoflights#

Prevent Multiple Installs

Hi,

I'm looking for nsis code to prevent end-users from installing more than one instance of my program.

I've trawled through the forums and help but I cant find it.

Thanks in advance
meaningoflights#
Its cool I think I've found a way:

!macro CHECK_ALREADY_INSTALLED

ReadRegStr $R1 HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\YourProgram.exe" "Default"

${If} $R1 != ""
MessageBox MB_ICONINFORMATION|MB_OK "You have already installed YourProgram."

Quit

${EndIf}

!macroend