ArcGIS Desktop silent install script

Document created by curtvprice Champion on Oct 3, 2014Last modified by curtvprice Champion on Aug 30, 2017
Version 15Show Document
  • View in full screen mode

Here's an example install script, in good old DOS batch language. This could probably be easily tweaked to run in PowerShell if you're into that.

 

This script works with 10.2.x or later (edit for the version you are installing)

 

For more information about how silent installs work, msiexec options, etc., see the deployment guides referenced in Enterprise Deployment Resources

 

@echo off


:: Check for administrative access
net session >nul 2>&1
echo.
if %errorLevel% == 0 (
  echo Administrative permissions confirmed.
) else (
  echo Current permissions inadequate
  echo ArcGIS Desktop install failed
  goto :eof
)

setlocal

:: Source media folder
:: This folder expected to contain:
::  Esri\Desktop\SetupFiles
::  Esri\BackgroundGP\SetupFiles
::  Esri\DataInterop\SetupFiles

set SRC=G:\Installs\ArcGIS_105

:: Set the value below to major version
set ARCVER=10.5

:: Install folder (must be a "letter-drive" path)
:: default is C:\Program Files(x86), etc., C:\ArcGIS is easier to manage
set INSTALLPATH=C:\ArcGIS
set INSTALLDRIVE=C:

:: Set log file path, prefix at install script runtime
:: Example logfile name: "ArcInstall_20120925_1623_Desktop.txt"
set DATESTAMP=%DATE:~10,4%%DATE:~4,2%%DATE:~7,2%
set TIMESTAMP=%TIME:~,2%%TIME:~3,2%
set TIMESTAMP=%TIMESTAMP: =0%
set LOG_PATH=%TEMP%\ArcInstall_%DATESTAMP%_%TIMESTAMP%

set MSIEXEC=%WINDIR%\system32\msiexec.exe
set REG=%WINDIR%\system32\reg.exe

@echo on
:: Install ArcGIS Desktop
%MSIEXEC% /i "%SRC%\Esri\Desktop\SetupFiles\setup.msi" ROOTDRIVE=%INSTALLDRIVE% ^
 INSTALLDIR="%INSTALLPATH%" INSTALLDIR1="%INSTALLDRIVE%\Python27" ADDLOCAL=ALL ^
 SOFTWARE_CLASS=Professional SEAT_PREFERENCE=Fixed DESKTOP_CONFIG=TRUE ^
ESRI_LICENSE_HOST=27000@xx.xx.net" ^
 /l+ie "%LOG_PATH%_Desktop.txt" /qb- /passive /norestart

:: Verify ArcGIS Desktop install - stop install if test fails
@echo off
if defined ProgramFiles(x86) ( set k=HKLM\SOFTWARE\Wow6432Node\ESRI\Desktop%ARCVER% ) ^
  else ( set k=HKLM\SOFTWARE\ESRI\Desktop%ARCVER% )
:: if reg query produces an error, ArcGIS was not installed
%REG% query %k% /v InstallDir >>"%LOG_PATH%_Desktop.txt" 2>&1 || ^
  (echo. & echo ** ArcGIS Desktop install failed ** &  ^
    echo Check file paths in script "%0" and &  ^
    echo log file "%LOG_PATH%_Desktop.txt" & goto :eof  )
@echo on

:: Desktop 64-bit background geoprocessing (optional - Windows x64 only)
if defined ProgramFiles(x86) ^
%MSIEXEC% /i "%SRC%\Esri\BackgroundGP\SetupFiles\Setup.msi" ^
ROOTDRIVE=%INSTALLDRIVE% INSTALLDIR=%INSTALLDRIVE%\Python27 ^
/l+ie "%LOG_PATH%_DesktopBackgroundGP.txt" /qb- /passive /norestart

:: Data Interoperability extension (optional)
%MSIEXEC% /i "%SRC%\Esri\DataInterop\SetupFiles\Setup.msi"     ^
INSTALLDIR="%INSTALLPATH%\Data Interoperability Extension" ^
/l+ie "%LOG_PATH%_DataInterop.txt" ^
/qb- /passive /norestart
2 people found this helpful

Attachments

    Outcomes