Programmatic method to determine currently installed Windows PostrgreSQL version

From: Will Wright <will4wright(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Programmatic method to determine currently installed Windows PostrgreSQL version
Date: 2005-11-07 19:39:44
Message-ID: 20051107193944.38038.qmail@web60711.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I'm in the process of creating an Windows installation
package for a product that uses PostgreSQL.

During the installation I would like to check if
PostgreSQL is installed and if it is, which version.

I think that I can infer that PostgreSQL is installed
by searching for the
\HKLM\SOFTWARE\PostgreSQL\Services or
HLKM\SOFTWARE\PostrgreSQL\Installations registry keys.
However I am not so sure about the version number
identification.

I note that with v8.0.x the following ValueName
exists:
HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\{5AA3FA26-72A2-4D06-9BFE-98E650A37B6D}
"Version"="8.0"

And with 8.1 beta the following:
HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\{317D0ED1-8845-40DD-A028-0A3EB8E24F2E}
"Version"="8.1-beta4"

So it looks like the version number is underneath a
key that changes with every new version (new Product
number). And I am therefore not sure if I can use
this knowledge to identify the installed version.

Does anyone have a better idea for a more reliable
identification method?

Thanks,
Will



__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com

Browse pgsql-general by date

  From Date Subject
Next Message Jim C. Nasby 2005-11-07 19:41:38 Re: How to create a virtual column
Previous Message Jim C. Nasby 2005-11-07 19:38:01 Re: Setting max_fsm_pages