← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2977: Improved DHIS2 Postgresql Installer. Seems to actually work this time.

 

------------------------------------------------------------
revno: 2977
committer: Jason P. Pickering <jason.p.pickering@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2011-03-06 10:31:18 +0100
message:
  Improved DHIS2 Postgresql Installer. Seems to actually work this time.
modified:
  dhis2-live-installer/resources/conf/hibernate.properties
  dhis2-live-installer/resources/postgres/dhis2db.backup
  dhis2-live-installer/resources/postgres/restore_db.bat
  dhis2-live-installer/src/bitrock/DHIS2_pginstaller.xml


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis2-live-installer/resources/conf/hibernate.properties'
--- dhis2-live-installer/resources/conf/hibernate.properties	2011-03-03 18:29:05 +0000
+++ dhis2-live-installer/resources/conf/hibernate.properties	2011-03-06 09:31:18 +0000
@@ -1,4 +1,3 @@
-
 # H2
 
 #hibernate.dialect = org.hisp.dhis.dialect.H2Dialect
@@ -11,7 +10,7 @@
 
 hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
 hibernate.connection.driver_class = org.postgresql.Driver
-hibernate.connection.url = jdbc:postgresql://localhost/dhis2db
+hibernate.connection.url = jdbc:postgresql:dhis2db
 hibernate.connection.username = dhis2
 hibernate.connection.password = dhis2
 

=== modified file 'dhis2-live-installer/resources/postgres/dhis2db.backup'
Binary files dhis2-live-installer/resources/postgres/dhis2db.backup	2011-03-03 18:29:05 +0000 and dhis2-live-installer/resources/postgres/dhis2db.backup	2011-03-06 09:31:18 +0000 differ
=== modified file 'dhis2-live-installer/resources/postgres/restore_db.bat'
--- dhis2-live-installer/resources/postgres/restore_db.bat	2011-03-03 18:29:05 +0000
+++ dhis2-live-installer/resources/postgres/restore_db.bat	2011-03-06 09:31:18 +0000
@@ -1,3 +1,4 @@
+SET PGPASSWORD=PG_PASSWORD
 "c:\Program Files\PostgreSQL\9.0\bin\psql.exe" -c "CREATE USER dhis2 CREATEDB LOGIN PASSWORD 'dhis2';" -U postgres -w postgres
 "c:\Program Files\Postgresql\9.0\bin\createdb.exe" -U postgres -w -O dhis2 dhis2db
 "c:\Program Files\Postgresql\9.0\bin\pg_restore" -U postgres -w -d dhis2db dhis2db.backup
\ No newline at end of file

=== modified file 'dhis2-live-installer/src/bitrock/DHIS2_pginstaller.xml'
--- dhis2-live-installer/src/bitrock/DHIS2_pginstaller.xml	2011-03-03 18:29:05 +0000
+++ dhis2-live-installer/src/bitrock/DHIS2_pginstaller.xml	2011-03-06 09:31:18 +0000
@@ -210,14 +210,37 @@
                     </distributionFileList>
                 </folder>
             </folderList>
+            <parameterList>
+                <passwordParameter>
+                    <name>pg_password</name>
+                    <title>Postgresql Password</title>
+                    <description>Please enter a password for the Postgresql superuser.</description>
+                    <explanation></explanation>
+                    <value></value>
+                    <default>postgres</default>
+                    <allowEmptyValue>1</allowEmptyValue>
+                    <descriptionRetype></descriptionRetype>
+                    <width>20</width>
+                </passwordParameter>
+            </parameterList>
             <postInstallationActionList>
                 <runProgram>
                     <explanation>Installing Postgresql</explanation>
                     <program>postgresql-9.0.1-1-windows.exe</program>
-                    <programArguments></programArguments>
+                    <programArguments>--unattendedmodeui none --superaccount postgres --servicepassword ${pg_password} --superpassword ${pg_password}</programArguments>
                     <progressText>Installing Postgresql</progressText>
                     <workingDirectory>${installdir}\tmp\</workingDirectory>
                 </runProgram>
+                <substitute>
+                    <files>${installdir}\tmp\restore_db.bat</files>
+                    <type>regexp</type>
+                    <substitutionList>
+                        <substitution>
+                            <pattern>PG_PASSWORD</pattern>
+                            <value>${pg_password}</value>
+                        </substitution>
+                    </substitutionList>
+                </substitute>
             </postInstallationActionList>
         </component>
         <component>