[FIX] setup.nsi: fix the posgresql registry check:
authorVo Minh Thu <vmt@openerp.com>
Tue, 5 Mar 2013 11:02:53 +0000 (12:02 +0100)
committerVo Minh Thu <vmt@openerp.com>
Tue, 5 Mar 2013 11:02:53 +0000 (12:02 +0100)
My understanding is that EnumRegKey will index (the last argument)
the given registry path. When nothing is found, it sets the first
argument to the empty string. Only if the given path is wrong an
error is generated. So we have to go to the DoInstallPostgreSQL
label.

bzr revid: vmt@openerp.com-20130305110253-tu0t240liupxtchj

setup.nsi

index ab58915..3f93a5b 100644 (file)
--- a/setup.nsi
+++ b/setup.nsi
@@ -291,9 +291,10 @@ Function .onInit
     !insertmacro MUI_LANGDLL_DISPLAY\r
 \r
     ClearErrors\r
-    EnumRegKey $0 HKLM "SOFTWARE\PostgreSQL" 0\r
+    EnumRegKey $0 HKLM "SOFTWARE\PostgreSQL\Installations" 0\r
+    StrCmp $0 "" DoInstallPostgreSQL\r
     IfErrors DoInstallPostgreSQL 0\r
-        StrCpy $HasPostgreSQL 1\r
+    StrCpy $HasPostgreSQL 1\r
 \r
     DoInstallPostgreSQL:\r
 FunctionEnd\r