[PostgreSQL] Scripted / unattended install on Windows
Here is a script that allow you to install PostgreSQL (9.4 64 bits in my case) on a Windows server. 3 variables needs to be seted (in green) : Install path, Data path and postgres admin password
You need to launch the script inside the folder containing the postgresql installer. You can download the binaries here : https://www.enterprisedb.com/downloads/postgres-postgresql-downloads
@echo off
REM install PostgreSQL 9.4
REM PostgreSQL installation folder
set POSTGRESQL_INSTALL_DIR=I:\PostgreSQL\bin
REM PostgreSQL data folder
set POSTGRESQL_DATA_DIR=P:\PostgreSQL\data
REM PostgreSQL admin password
set POSTGRESQL_ADMIN_PASSWORD=my_password
call postgresql-9.4.17-1-windows-x64.exe --mode unattended --prefix %POSTGRESQL_INSTALL_DIR% --datadir %POSTGRESQL_DATA_DIR% --superpassword %POSTGRESQL_ADMIN_PASSWORD%