Automated Deployment of Perforce
Automating deployment of Perforce client programs for large Windows sites
TASK
Automate deployment of Perforce client programs for large Windows sites.
SOLUTION
- Specify desired user interface level
- Specify which features are installed or removed
- Specify property values used during the installation
- Instruct the installer to produce a log file
p4winst.exe /v”/qb P4PORT=perforce:1666 P4USER=bruno”
p4winst.exe /v”/qb /l+*v p4winst.log P4PORT=perforce:1666 P4USER=brunoSpecifying desired user interface level
p4winst.exe /v"/qb ADDLOCAL=ALL REMOVE=P4EXP"
p4winst.exe /v"/qb ADDLOCAL=P4EXP"
p4winst.exe /v"/qb REMOVE=P4EXP"
p4winst.exe /v"/qb REMOVE=ALL"
The commands for invoking the installer and configuring its arguments and property settings can be placed into a batch file, an example of which is given below.
REM Silent install of Perforce Windows Client (P4Win) @ECHO OFF REM Set the installer executable name SET INSTALLERCMD=p4winst.exe REM Set the arguments we'll pass to msiexec SET MSIARGS=/qb /l+*v .\p4winst.log^ INSTALLDIR=\"%ProgramFiles%\Perforce\"^ P4USER=%UserName%^ P4CLIENT=%UserName%-%ComputerName%^ P4PORT=perforce:1666 REM Invoke the installer %INSTALLERCMD% /v"%MSIARGS%"
Perforce client to connect as.
Path to application to use for comparing files.
Password for NETUSER. Required if INSTALLDIR, SERVROOT,
Path to server installation directory and server root, unless already
Server port number. Not the same as PRXYPORT or P4WEBPORT.
Path and/or file name of server journal file.
Path and/or file name of server log file.
Forces the proxy to be installed. Not installed by default, set to 1
P4Web client port number. Not the same as PRXYPORT or SERVPORT.
Select either guest or authenticated viewer mode.
Computer name or IP address and/or port number of Perforce server
Controls whether a log is written, 0 or 1.
Pre-2007.3 installers
To assist in automating installation of Perforce client programs across multiple
desktops, Perforce provides a scripted version of the Perforce Windows
Installer. The scripted version of the installer enables Perforce administrators to
standardize options and settings before installation, thereby speeding up the
process of deploying Perforce client programs throughout an organization.
The customizable element of the scripted installer is a configuration file named perforce.cfg. The Perforce Administrator edits this file, and places it on a shared network drive along with the expanded contents of the perforce.zip file. Perforce client programs can then be installed by running setup.exe from each desktop. It is important to run setup.exe from the folder in which it resides otherwise it will not be able to find perforce.cfg.
Here are some sample settings from the perforce.cfg file:
INSTTYPE=ClientOnly
(Install only the Perforce client programs, and not the Perforce Server)
INSTMODE=NoPrompt
(Install according to the settings in the configuration file without
displaying installation dialogs)
P4PORT=perforce:1666
(Configure a value for the Perforce Server machine and port number)
P4WEBPORT=8080
(Configure a value for the port where P4Web is listening)
Other settings and additional information are available in the comments included within the perforce.cfg file. As of release 2005.2, the P4Win performance variable naming convention has been modified. These details are also embedded within the perforce.cfg file for reference.
The scripted Core installer can be downloaded from ftp://ftp.perforce.com/perforce/r06.2/bin.ntx86/perforce.zip.
The P4Win scripted installer can be downloaded from ftp://ftp.perforce.com/perforce/r06.2/bin.ntx86/p4winst.zip.
The P4V scripted installer can be downloaded from ftp://ftp.perforce.com/perforce/r07.2/bin.ntx86/p4vinst.zip
To use the scripted installer:
- Download perforce.zip from the FTP site.
- Extract the contents of perforce.zip into a directory on your machine.
- In this directory, edit perforce.cfg as required.
- Place the unzipped contents of this directory, including your customized perforce.cfg, in a folder accessible from a Network Drive or into the root folder of a CD.
- From the network drive or CD, run setup.exe to install Perforce according to the settings you configured in perforce.cfg onto each desktop.
Note: the method to exclude certain binaries from being installed by the scripted installer is to remove those binaries from the directory where the perforce.zip (or p4winst.zip) file has been expanded. For example, if you wish to exclude the P4EXP from the install of P4Win, then unzip the p4winst.zip and remove the P4Exp.dll from the expanded directory prior to running setup.exe.
If you have any questions about the settings in perforce.cfg, please contact Perforce Support.
