I want to build a package that, depending on the existence of a certain registry key, copies some files to a directory (also found in the registry) or just quits. This all very silent. Getting the InstallDIr from the registry is no problem, but I don't understand the codesnippit from the NSIS-archieve http://nsis.sourceforge.net/archive/...hp?pageid=307.
Can someone create a complete basic example of a ready2compile script. I think I can manage from there.
Check existence of registry key
4 posts
Do you really need to know whether it exits or is knowing whether it has a value enough?
In the first case, use the macro from that archive page:
In the first case, use the macro from that archive page:
Otherwise, just compare the value form the key with "".!insertmacro IfKeyExists "ROOT" "KeyToCheckIn" "KeyToCheck"
Pop $R0
;$R0 contains 0 (not present) or 1 (present)
And after that use
And put that all in a SectionStrCmp $R0 1 KeyFound KeyNotFound
KeyFound:
File bla.exe
etc...
KeyNotFound:
easier:
Push $0
ClearErrors
ReadRegStr $0 ROOT "Your\Reg\Path" "YourKey"
IfErrors KeyDoesntExist KeyExists
KeyDoestnExist:
ClearErrors
# do something
Goto End
KeyExists:
# do something else
End:
Pop $0