X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 4A9C5D9182 for ; Fri, 16 Sep 2005 13:25:32 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 03404-07 for ; Fri, 16 Sep 2005 16:25:25 +0000 (GMT) Received: from TWMAIL.ESNCC.COM (static-66-173-159-28.t1.cavtel.net [66.173.159.28]) by svr1.postgresql.org (Postfix) with ESMTP id DF90DD90F7 for ; Fri, 16 Sep 2005 13:25:18 -0300 (ADT) Received: from spawar2i8uvlb9 ([150.125.117.63]) by TWMAIL.ESNCC.COM with Microsoft SMTPSVC(5.0.2195.6713); Fri, 16 Sep 2005 12:25:18 -0400 From: "Lane Van Ingen" To: "Krzysztof Szadkowski" , Subject: Re: silent installation Date: Fri, 16 Sep 2005 12:25:06 -0400 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_001F_01C5BAB9.AC09B2C0" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-Reply-To: <000001c5bac4$f9384ce0$1401a8c0@eldipsrv> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.181 Importance: Normal X-OriginalArrivalTime: 16 Sep 2005 16:25:18.0693 (UTC) FILETIME=[3A32A950:01C5BADB] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.062 required=5 tests=[AWL=0.011, FORGED_RCVD_HELO=0.05, HTML_MESSAGE=0.001] X-Spam-Level: X-Archive-Number: 200509/186 X-Sequence-Number: 18923 This is a multi-part message in MIME format. ------=_NextPart_000_001F_01C5BAB9.AC09B2C0 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0020_01C5BAB9.AC09B2C0" ------=_NextPart_001_0020_01C5BAB9.AC09B2C0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit MessageHere is a sample for you of one I used (attached), modified to protect confidentiality. Be sure to turn echo off on the batch files and convert imbedded echo stantements to REMs. postgres.bat starts the process. This install was for Windows 2003. -----Original Message----- From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org]On Behalf Of Krzysztof Szadkowski Sent: Friday, September 16, 2005 9:46 AM To: pgsql-admin@postgresql.org Subject: [ADMIN] silent installation Hi All, I'm a .NET programmer. I'm working now on application which is using PostgreSQL. I have to create setup project for this application witch will be able to install Postgres and create my DB. So please tell me it is possible to run PostgreSQL in silent mode ? And how to build DB from SQL script file? Thanks in advance. Best wishes, Krzysztof Szadkowski ------=_NextPart_001_0020_01C5BAB9.AC09B2C0 Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Message
Here=20 is a sample for you of one I used (attached), modified to protect=20 confidentiality.
 
Be=20 sure to turn echo off on the batch files and convert imbedded echo = stantements=20 to REMs.
 
postgres.bat starts the process. This install was for Windows=20 2003.
-----Original Message-----
From:=20 pgsql-admin-owner@postgresql.org=20 [mailto:pgsql-admin-owner@postgresql.org]On Behalf Of Krzysztof = Szadkowski
Sent: Friday, September 16, 2005 9:46 = AM
To:=20 pgsql-admin@postgresql.org
Subject: [ADMIN] silent=20 installation

Hi All,
 
   I'm a=20 .NET programmer. I'm working now on application which is using=20 PostgreSQL.
I have to create setup project = for this=20 application witch will be able to install Postgres
and create my DB.
   So=20 please tell me it is possible to run PostgreSQL in silent mode ? And how to build=20
DB = from SQL script=20 file?
 
Thanks in=20 advance.
Best = wishes,
         Krzysztof=20 Szadkowski
------=_NextPart_001_0020_01C5BAB9.AC09B2C0-- ------=_NextPart_000_001F_01C5BAB9.AC09B2C0 Content-Type: application/octet-stream; name="db_init.bat" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="db_init.bat" @echo off echo Please wait...Intializing database. echo This window will close automatically. echo . echo . rem = #########################################################################= ######### rem # This is the batch file used to set up automated install of = PostgreSQL on Windows rem = #########################################################################= ######### rem rem Create database administrator (CREATE USER) and the database (CREATE = DATABASE) psql template1 -U ADNSDB < database_setup.txt rem Create tables psql adns -U ADNSDB < adnsdb_init.sql psql adns -U ADNSDB < alarm.sql psql adns -U ADNSDB < asid.sql psql adns -U ADNSDB < bw.sql psql adns -U ADNSDB < config.sql psql adns -U ADNSDB < dataevents.sql psql adns -U ADNSDB < email.sql psql adns -U ADNSDB < link_type.sql psql adns -U ADNSDB < log.sql psql adns -U ADNSDB < monitor_non-plugin.sql psql adns -U ADNSDB < monitor_plugin.sql psql adns -U ADNSDB < report.sql psql adns -U ADNSDB < rtg.sql psql adns -U ADNSDB < user.sql psql adns -U ADNSDB < version.sql rem Create functions psql adns -U ADNSDB < functions_plsql.txt psql adns -U ADNSDB < functions_sql.txt rem Create views psql adns -U ADNSDB < views.sql rem Create triggers psql adns -U ADNSDB < triggers.txt ------=_NextPart_000_001F_01C5BAB9.AC09B2C0 Content-Type: application/octet-stream; name="postgres.bat" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="postgres.bat" REM echo off REM Requires the following as now set up on install drive 'c:\' (change = to your own drive): REM (1) proper version of ntrights.exe on install drive (65KB 5/7/2002 = 12:38 PM) REM (2) postgresql-8.0-int.msi on install drive REM (3) a temporary and permanent copy of pg_hba.conf on install drive REM (4) schema (from Subversion = C:\home\trunk\src\LQoSMAN\data\init_db\*) on c:\ REM (5) the two hba.conf files aqre to permit pOSTGRES to install w/o a = password prompt echo Establishing Database Service user and database superUser = (respectively) ... net user /ADD /EXPIRES:NEVER net user /ADD /EXPIRES:NEVER echo Granting Database user Necessary Rights ... c:\ntrights.exe +r SeServiceLogonRight -u LQOSMAN_DB=20 c:\ntrights.exe +r SeNetworkLogonRight -u LQOSMAN_DB=20 c:\ntrights.exe +r SeInteractiveLogonRight -u LQOSMAN_DB=20 echo Setting Required Environment and PATH Variables ... set PGRESQLDB=3DC:\ADNS\postgres setx PGRESQLDB %PGRESQLDB% /M set PGDATA=3DC:\ADNS\postgres\data setx PGDATA "C:\ADNS\postgres\data" /M set PATH=3D%PATH%;%PGRESQLDB%\bin setx PATH "%PATH%;C:\ADNS\postgres\bin" /M echo Installing PostgreSQL Database ... msiexec /i c:\postgresql-8.0-int.msi /qb ADDLOCAL=3Dserver,psql = INTERNALLAUNCH=3D1 SERVICEACCOUNT=3DLQOSMAN_DB = SERVICEPASSWORD=3DLQoSMAN4**0 SUPERUSER=3DADNSDB = SUPERPASSWORD=3DADNS**db11 BASEDIR=3D%PGRESQLDB% /l*v install.log echo Completed Install of PostgreSQL Database echo Creating Database Data Directory ... IF NOT EXIST %PGRESQLDB%\data mkdir %PGRESQLDB%\data /Y echo Setting database to read from trusted source copy pg_hba1.conf %PGDATA%\pg_hba.conf echo Setting Up PostgreSQL for ADNS Schema Load ... %PGRESQLDB%\bin\pg_ctl.exe reload -s -w echo Loading ADNS Schema (database, tables, views, functions, etc.) ... call adnsdb_init.bat echo Resetting PostgreSQL to read from only passwd protected sources = (md5) ... copy pg_hba.conf %PGDATA%\pg_hba.conf=20 %PGRESQLDB%\bin\pg_ctl.exe reload -s -w echo PostgreSQL (ADNS 4.0) Installation Complete ------=_NextPart_000_001F_01C5BAB9.AC09B2C0--