Old 27th January 2010, 22:38   #1
Dutch_Delight
Junior Member
 
Join Date: Jan 2010
Posts: 4
check for specific install path or version

hi all,

I've written a plugin for another program and want to use NSIS as installer. Problem is that there are several versions of this other software and I need the installer to decide on the path. It is vitally important for me to find the version number.

The version of the other software is written in the registry and would look something like this:
software\program\v1\
Not a key, but a path.

the next version of the software would be this:
software\program\v2


Optimistically, I was hoping that I could just assign the value to a string and fill the string with the last value it finds:

InstallDirRegKey HKLM "Software\program\v1" "Installdir"
InstallDirRegKey HKLM "Software\program\v2" "Installdir"
InstallDirRegKey HKLM "Software\program\v3" "Installdir"

So if the end-user only has v2 installed, no value would be found and so we would know that version 2 is installed. But this doesnt work.

Does anyone have a quick fix for this. This is the only thing that I need to get it working on the installer side.
Dutch_Delight is offline   Reply With Quote
Old 28th January 2010, 06:06   #2
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.2.5

Please try reading the manual first, it exists for a reason.
MSG is offline   Reply With Quote
Old 28th January 2010, 12:38   #3
Dutch_Delight
Junior Member
 
Join Date: Jan 2010
Posts: 4
Yes boss
Dutch_Delight is offline   Reply With Quote
Old 28th January 2010, 20:33   #4
Dutch_Delight
Junior Member
 
Join Date: Jan 2010
Posts: 4
Right, I've tried every possible combination but I cant figure out how to read the DATA part of the key.



StrCpy $1 "Software\program\"
StrCpy $2 "version2" ;this is obtained earlier
StrCpy $3 "\installdir"
StrCpy $4 $1$2$3
;this gives me "Software\program\version2\installdir"

but now I need to know how to query the value of this key.
I tried:

EnumRegValue $5 HKLM $4 "path"
;path is a REG_SZ name but i want it's value
It's only returning "path"

What am I doing wrong?

Thanks for any help.
Dutch_Delight is offline   Reply With Quote
Old 28th January 2010, 20:45   #5
Dutch_Delight
Junior Member
 
Join Date: Jan 2010
Posts: 4
ok, I've got it.

ReadRegStr $5 HKLM $4 "Installdir"


Got there in the end.
Dutch_Delight is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

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