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
c:\ntrights.exe +r SeNetworkLogonRight -u LQOSMAN_DB
c:\ntrights.exe +r SeInteractiveLogonRight -u LQOSMAN_DB
echo Setting Required Environment and PATH Variables ...
set PGRESQLDB=C:\ADNS\postgres
setx PGRESQLDB %PGRESQLDB% /M
set PGDATA=C:\ADNS\postgres\data
setx PGDATA "C:\ADNS\postgres\data" /M
set PATH=%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=server,psql INTERNALLAUNCH=1 SERVICEACCOUNT=LQOSMAN_DB SERVICEPASSWORD=LQoSMAN4**0 SUPERUSER=ADNSDB SUPERPASSWORD=ADNS**db11 BASEDIR=%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
%PGRESQLDB%\bin\pg_ctl.exe reload -s -w
echo PostgreSQL (ADNS 4.0) Installation Complete