I would install postgresql with the NSIS installer, but I don\'t know how.
Can you help me please ?
I\'ve find this code
outfile \"C:\\proj
All you need to do is create a data dir:
initdb -D %PROGRAMDATA%\MyApp\data
then install your PostgreSQL config file and pg_hba.conf
or make any required edits to the files generated automatically by initdb
at %PROGRAMDATA%\MyApp\data\postgresql.conf
and %PROGRAMDATA%\MyApp\data\pg_hba.conf
.
Then:
pg_ctl register -D %PROGRAMDATA%\MyApp\data -S auto -N postgres-MyApp -U NETWORKSERVICE
net start postgres-MyApp
Please do not use the default port 5432. Run on a non-default port that won't conflict with any existing or future PostgreSQL install. Also, do not use the "standard" service names like postgresql-9.2
.
(NSIS may offer a command to start a service, instead of using net start
. If it does, use the appropriate NSIS command).
Note that %PROGRAMDATA%
is only defined for Windows Vista and higher (where it points to %SYSTEMDRIVE%\ProgramData
by default). You can use %ALLUSERSPROFILE%
on Windows XP, but really, who cares about XP now?
Personally, I suggest using MSI installers with WiX.