As the PostgreSQL installer for Windows uses Windows Installer (MSI) technology, performing a silent or semi-silent install works the same way as with any MSI installer. It is all done using commandline options to msiexec, which are used to:
All installation is done using the postgresql-<ver>-int.msi file. The main MSI file is just a wrapper around this file that sets some required properties.
Note that the following functions are not available when running a silent install:
If you have any questions regarding silent installations, please use the pginstaller-devel mailinglist available from the pgFoundry page.
The following user interface levels are available:
| Name | Commandline | Description |
| Normal | none | Normal interactive user installation |
| Reduced | /qr |
No user interaction. "Full size" progress window including progress descriptions. |
| Basic | /qb |
No user interaction. Just a basic progressbar and not full descriptions. You can also remove the cancel
button using /qb! |
| Silent | /qn |
No user information at all. |
Features to install are specified by adding:
ADDLOCAL=feature1,feature2...
to the commandline. If the ADDLOCAL parameter is not set, the default set of options will be installed.
The following features are available for install (see the wxs/pginst.wxs source for an up-to-date list. This list is accurate per RC1):
| Id | Description |
| server | Database server |
| nls | Natural Language Support |
| postgis (8.1 only) | PostGIS Spatial Extensions |
| pljava (8.1 only) | PL/Java |
| psql | psql commandline utility |
| pgadmin | pgAdmin III |
| jdbc | JDBC driver |
| npgsql | NPgSql .Net Data Provider |
| psqlodbc | ODBC driver |
| pgoledb | OLE DB provider |
| docs (8.0 only) | HTML format documentation. 8.1 will always install CHM format documentation. |
| includefiles | C/C++ include files |
| libfiles | C/C++ library files |
| msvclibs | C/C++ library files for MS Visual C++ |
| pgxs | PGXS |
| binfiles | Development tools and utilities, such as ecpg |
Property values are fixed if using any other UI level than Normal. When using Normal, they are taken as default values in the dialogs. Note that string parameters may require quotes (") around the value.
The following properties are available:
| Id | Default | Description |
| INTERNALLAUNCH | 0 | This must be set to 1 to be able to use the -int MSI file. |
| DOSERVICE | 1 | Install running as a service. |
| DOINITDB | 1 | Run initdb on installed system. Only available when installing service. Not available on NT4. |
| SERVICEDOMAIN | . | Domain name for service user. For local user, use the name of the computer (%COMPUTERNAME%). Only used when installing as a service. |
| SERVICEACCOUNT | postgres | Name of service user, excluding domain name. Only used when installing as a service. |
| SERVICEPASSWORD | Password for service account. The account must already have this password; the installer will not change it. Only used when installing as a service. | |
| CREATESERVICEUSER (8.1 only) | 0 | Set to 1 have the service user created during installation, with the specified username and password. |
| SERVICENAME | PostgreSQL Database Server <ver> | Name of service in the service control manager. Must be unique on system. |
| SUPERUSER | postgres | Account name for default user in database. Only used when running initdb. |
| SUPERPASSWORD | Password for default user in database. Only used when running initdb. | |
| LOCALE | C | Locale for database. Only used when running initdb. |
| ENCODING | SQL_ASCII | Encoding for database. Only used when running initdb. |
| LISTENPORT | 5432 | TCP port to listen for connections on. Only used when running initdb. |
| PERMITREMOTE | Permit connections from non-localhost machines (set to 1 to enable). Only used when running initdb. | |
| PL_PGSQL | 1 | Install PL/PGSQL procedural language. |
| PL_PERL | Install PL/PERL procedural language. Make sure you have the correct perl58.dll available in the system path. | |
| PL_PERLU | Install PL/PERL untrusted procedural language. Make sure you have the correct perl58.dll available in the system path. | |
| PL_TCL | Install PL/TCL procedural language. Make sure you have the correct tcl84.dll available in the system path. | |
| PL_TCLU | Install PL/TCL untrusted procedural language. Make sure you have the correct tcl84.dll available in the system path. | |
| PL_PYTHONU | Install PL/PYTHON untrusted procedural language. Make sure you have the correct python23.dll available in the system path. | |
| PL_JAVA (8.1 only) | Install PL/JAVA trusted and untrusted procedural languages. Make sure you have the correct JRE available in the system path. | |
| NOSHORTCUTS (8.1 only) | 0 | Don't install any startmenu shortcuts |
The following properties are available to change the location of the installation. It is recommended that you only change the BASEDIR and DATADIR properties if that is appropriate for your installation.
| Id | Default | Description |
| BASEDIR | automatically set by Windows Installer | Root directory for entire installation. |
| SERVERDIR | BASEDIR | Location of server files. |
| DATADIR | BASEDIR\data | Location of server data files. |
| UIDIR | BASEDIR | Root directory for UI subfeatures. |
| CBINDIR | UIDIR\bin | Directory for psql.exe. |
| PGADMINDIR | UIDIR\pgAdmin | Directory for pgAdmin III. |
| JDBCDIR | BASEDIR\jdbc | Directory for JDBC driver. |
| NPGSQLDIR | BASEDIR\Npgsql | Directory for Npgsql .Net data provider. (Some files are also installed in the GAC if .Net Framework is installed) |
| PSQLODBCDIR | BASEDIR\odbc | Directory for ODBC driver. |
| PGOLEDBDIR | BASEDIR\PgOleDb | Directory for OLE DB provider. |
| DOCDIR (8.0 only) | BASEDIR\doc | Directory for documentation. |
| DEVDIR | BASEDIR | Directory for development files. |
There are some further specific subdirectories available that may or may not work when changed. See wxs/pginst.wxs for a complete list.
Apart from these there is a whole set of properties for which contrib modules to enable. If you want anything other than the default, you will have to look at the source code (wxs/pginst.wxs) for a list of these.
To select a language other than english for installation messages, you need to apply an embedded language transform.
This is done by specifying the property:
TRANSFORMS=:lang_langcode
where langcode is the language code for the messages. Available language codes can be found in lang/Makefile.lang.
At the time of this writing, support exists for German (de), French (fr), Brazilian Portuguese (pt_br) and Swedish (sv).
The following example will install the server, psql and documentation into the file c:\postgres, as a service, with specified username/password. It uses a reduced UI level so we can see the full progress indication, and sets the language to german.
msiexec /i postgresql-8.0.0-rc1-int.msi /qr INTERNALLAUNCH=1 ADDLOCAL=server,psql,docs SERVICEDOMAIN="%COMPUTERNAME%"
SERVICEPASSWORD="SecretWindowsPassword123" SUPERPASSWORD="VerySecret" BASEDIR="c:\postgres" TRANSFORMS=:lang_de