admin 管理员组文章数量: 1086019
2024年4月15日发(作者:integrate所有词性)
Silent install of PostgreSQL on
Windows
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:
Specify desired user interface level
Specify which features to install
Specify (default) values for required properties
Optionally specify language to use for user messages
Look at an example
All installation is done using the postgresql-
just a wrapper around this file that sets some required properties.
Note that the following functions are not available when running a silent install:
Verification of service account and password. If you specify an invalid
account or password, the installation will proceed most of the way, then fail
and rollback at the end because of login failures.
Verification of data directory location. The directory specified as data
directory must either not exist or be empty before you run the installation, if
you want initdb to run.
Verification of DLL versions. You will need to verify SSL library version as
well as PL dependency DLLs manually if you want this check.
If you have any questions regarding silent installations, please use the pginstaller-
devel mailinglist available from the pgFoundry page.
Specifying desired user interface level
The following user interface levels are available:
Name Commandline Description
Normal interactive user installation
No user interaction. "Full size" progress window including
progress descriptions.
No user interaction. Just a basic progressbar and not full
descriptions. You can also remove the cancel button using
/qb!
Normal none
Reduced
/qr
Basic
Silent
/qb
/qn
No user information at all.
Specifying features to install
Features to install are specified by adding:
ADDLOCAL=feature1,featu
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/pgins source for an
up-to-date list. This list is accurate per RC1):
Id
server
nls
postgis (8.1,8.2 only)
pljava (8.1+ only)
psql
pgadmin
jdbc (8.2 and earlier
only)
Description
Database server
Natural Language Support
PostGIS Spatial Extensions (installed through Stackbuilder
in 8.3+)
PL/Java
psql commandline utility
pgAdmin III
JDBC driver (installed through Stackbuilder in 8.3+)
npgsql (8.2 and earlier NPgSql .Net Data Provider (installed through Stackbuilder
only) in 8.3+)
psqlodbc (8.2 and
ODBC driver (installed through Stackbuilder in 8.3+)
earlier only)
pgoledb (8.2 and earlier
OLE DB provider (installed through Stackbuilder in 8.3+)
only)
docs (8.0 only)
includefiles
libfiles
msvclibs (8.2 and
earlier only)
pgxs (8.2 and earlier
only)
binfiles
HTML format documentation. 8.1 will always install CHM
format documentation.
C/C++ include files
C/C++ library files
C/C++ library files for MS Visual C++ (in main libfiles
feature in 8.3 and later)
PGXS
Development tools and utilities, such as ecpg
Specifying values for properties
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
INTERNALLAUNCH
DOSERVICE
DOINITDB
Default
0
1
1
Description
This must be set to 1 to be able to use the -
int MSI file.
Install running as a service.
Run initdb on installed system. Only
available when installing service. Not
available on NT4.
Domain name for service user. For local
user, use the name of the computer
(%COMPUTERNAME%). If installing on
a domain controller, this must be set to the
LANMAN domain name (e.g.
MYDOMAIN). Only used when installing
as a service.
Name of service user, excluding domain
name. Only used when installing as a
service.
Password for service account. The account
must already have this password; the
installer will not change it. Only used
when installing as a service.
Set to 1 have the service user created
during installation, with the specified
username and password.
SERVICEDOMAIN .
SERVICEACCOUNT postgres
SERVICEPASSWORD
CREATESERVICEUSER
0
(8.1+ only)
SERVICENAME
SUPERUSER
SUPERPASSWORD
LOCALE
ENCODING
LISTENPORT
PERMITREMOTE
PL_PGSQL
PL_PERL
PostgreSQL
Name of service in the service control
Database
manager. Must be unique on system.
Server
postgres
C
Account name for default user in database.
Only used when running initdb.
Password for default user in database.
Only used when running initdb.
Locale for database. Only used when
running initdb.
Encoding for database. Only used when
SQL_ASCII
running initdb.
TCP port to listen for connections on.
5432
Only used when running initdb.
1
Permit connections from non-localhost
machines (set to 1 to enable). Only used
when running initdb.
Install PL/PGSQL procedural language.
Install PL/PERL procedural language.
Make sure you have the correct perl5
available in the system path.
PL_PERLU
Install PL/PERL untrusted procedural
language. Make sure you have the correct
perl5 available in the system path.
Install PL/TCL procedural language. Make
sure you have the correct tcl84.dll
available in the system path.
Install PL/TCL untrusted procedural
language. Make sure you have the correct
tcl84.dll available in the system path.
Install PL/PYTHON untrusted procedural
language. Make sure you have the correct
pytho available in the system path.
Install PL/JAVA trusted and untrusted
procedural languages. Make sure you have
the correct JRE available in the system
path.
Don't install any startmenu shortcuts
PL_TCL
PL_TCLU
PL_PYTHONU
PL_JAVA (8.1 only)
NOSHORTCUTS (8.1
only)
0
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
BASEDIR
SERVERDIR
DATADIR
UIDIR
CBINDIR
JDBCDIR
NPGSQLDIR
Default
automatically set by
Windows Installer
BASEDIR
BASEDIRdata
BASEDIR
UIDIRbin
BASEDIRjdbc
BASEDIRNpgsql
Description
Root directory for entire installation.
Location of server files.
Location of server data files.
Root directory for UI subfeatures.
Directory for .
Directory for pgAdmin III.
Directory for JDBC driver.
Directory for Npgsql .Net data provider.
(Some files are also installed in the GAC
if .Net Framework is installed)
Directory for ODBC driver.
Directory for OLE DB provider.
Directory for documentation.
Directory for development files.
PGADMINDIR UIDIRpgAdmin
PSQLODBCDIR BASEDIRodbc
PGOLEDBDIR
DOCDIR (8.0
only)
DEVDIR
BASEDIRPgOleDb
BASEDIRdoc
BASEDIR
There are some further specific subdirectories available that may or may not work
when changed. See wxs/pgins 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/pgins) for a list of these.
Optionally specify language to use for user messages
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/Makef. At the time of this writing, support exists for German
(de), French (fr), Brazilian Portuguese (pt_br) and Swedish (sv).
A complete example
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- /qr INTERNALLAUNCH=1
ADDLOCAL=server,psql,docs SERVICEDOMAIN="%COMPUTERNAME%"
SERVICEPASSWORD="SecretWindowsPassword123"
SUPERPASSWORD="VerySecret" BASEDIR="c:postgres" TRANSFORMS=:lang_de
版权声明:本文标题:PostgreSQL静默安装参数 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/b/1713129277a621315.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论