Originally Posted by yogi1410
i found that there are no conf file installed.
The conf file is created when you run initdb. So you need to included that somehow in your installation process.
I have no experience with the msi installer, but you can simply use the zip binaries, extract them and run initdb and pg_ctl register from within your "main" installation routine.
Something like this:
REM create Windows user
net user postgres windows_password /ADD
REM create a PW file for the Postgres super user
echo my_secret_postgres_password > password.txt
unzip postgresql-8.4.2-1-windows-binaries.zip -d mypostgresinstalldir
REM run initdb
mypostgresinstalldir\pgsql\bin\initdb -D mydatadir -U postgres --pwfile=password.txt -E UTF8 -A md5
REM register the Postgres windows service
pg_ctl register -N PostgreSQL -U postgres -P windows_password -D mydatadir
Of course you'll need to replace mypostgresinstalldir
with the full path to the real directories.
If you install Postgres into c:\Program Files
place the data directory inside that directory. Regular users do not have write access there, which will make the service fail when starting.
Make sure mydatadir
has the correct security settings so that the postgres user can write to that directory.