Old 17th February 2017, 09:03   #1
annuska
Junior Member
 
Join Date: Feb 2017
Posts: 3
Not finding previous PostgreSQL installation

Hi all,

I'm trying to find the version of previous postgresql installation with the following code:
EnumRegKey $1 HKLM "SOFTWARE\PostgreSQL\Installations\" "0"
MessageBox MB_OK "Installation: $1"
${if} $1 != ""
ReadRegStr $PG_OLD_VERSION HKLM "SOFTWARE\PostgreSQL\Installations\$1" "Version"
.....

I have followed this example.

I have checked with Registry Editor and the entry seems to exist (HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-9.3).
However $1 is always empty and never enters the if.

I have also tried EnumRegKey $1 HKLM "SOFTWARE\PostgreSQL\" "0" and in this case it prints "Installations" so it seems to find the root.

Any suggestions to solve this problem?

Thanks in advance,
Anna.
annuska is offline   Reply With Quote
Old 17th February 2017, 12:02   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,476
If you support 32 and 64 bit psql then you must use SetRegView to read from both registry views probably.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 20th February 2017, 06:12   #3
annuska
Junior Member
 
Join Date: Feb 2017
Posts: 3
Thanks Anders! That was the problem. I changed the SetRegView and now it works.

Anna.
annuska 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