Old 25th July 2012, 19:36   #1
nawfal
Junior Member
 
Join Date: Jul 2012
Posts: 22
How to access InstallDirRegKey in NSIS

I can specify installation directory and registry value in NSIS like this:
InstallDir "$PROGRAMFILES\CTVI"
InstallDirRegKey HKLM "Software\CTVI" "Install_Dir"

Now I can access InstallDir by using the notation $INSTDIR throughout the script. How do I similarly access InstallDirRegKey? Is there a similar notation as there exists for InstallDir? I tried $INSTDIRREGKEY but that is not. Now what I do is that I type HKLM "Software\CTVI" "Install_Dir" everytime I require it. But that is not so DRY
nawfal is offline   Reply With Quote
Old 25th July 2012, 19:43   #2
nawfal
Junior Member
 
Join Date: Jul 2012
Posts: 22
I got an answer here http://stackoverflow.com/questions/1...regkey-in-nsis
nawfal is offline   Reply With Quote
Old 26th July 2012, 04:50   #3
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
NSIS will first try to get a previously set installation directory from registry. If it exists, $INSTDIR will be set to the value from registry. If it doesn't exist, $INSTDIR will be set to the default you set with the InstallDir directive.
MSG is offline   Reply With Quote
Old 27th July 2012, 22:35   #4
nawfal
Junior Member
 
Join Date: Jul 2012
Posts: 22
Yes I understood that from the link I posted. Thanks..
nawfal is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
installdirregkey, registry, variable

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump