English

FAQ: Can Python be used to determine what version of ArcGIS is installed?

Question

Can Python be used to determine what version of ArcGIS is installed?

Answer

Yes, in the new version of the Geoprocessor Programming Model for ArcGIS 9.3, there is a method that will output the version of ArcGIS that is installed on the machine.

The method is called gp.GetInstallInfo(), and it outputs a python dictionary. The information in the dictionary can be used by other methods in the script.

The items in the dictionary are as follows:

SourceDir: Source directory
InstallDate: Date of installation
SPBuild: Service pack build
ProductName: Product name
BuildNumber: The build number
InstallType: The installation type
Version: The product version
SPNumber: Service pack build number
Installer: Account installed by
InstallDir: Install location
InstallTime: Time of installation

Code:
import arcgisscripting
gp = arcgisscripting.create(9.3)

print gp.GetInstallInfo("desktop")


Note:
There are other installation types that can be used by this method: engine, server .net, and server java.

Sample Output:
Code:
{'SourceDir': u'\\\\data\\ArcGIS_Desktop\\Desktop\\', 'InstallDate': u'6/17/2008',
'SPBuild': u'N/A', 'ProductName': u'ArcGIS Desktop', 'BuildNumber': u'09.30.00.01770', 'InstallType': u'N/A',
'Version': u'9.3', 'SPNumber': u'N/A', 'Installer': u'user123', 'InstallDir': u'C:\\Program Files\\ArcGIS\\',
'InstallTime': u'8:20:21'}

Related Information