Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Is there a way using ArcObjects.net to find out what version of ArcGIS is installed on a machine (i.e. 9.3., 10.0, 10.1)?

share|improve this question
    
or even a registry location would be helpful. I just need a way for the program to figure out what version of ArcGIS the user has installed. File paths won't work because ArcGIS doesn't seem to uninstall the old folders in the AppData folder –  Nick Jan 17 '13 at 0:01

3 Answers 3

up vote 5 down vote accepted

In ArcObjects .NET, use the RuntimeManager e.g.:

Listing all installed runtimes:

var runtimes = RuntimeManager.InstalledRuntimes;
foreach (RuntimeInfo runtime in runtimes)
{
  System.Diagnostics.Debug.Print(runtime.Path);
  System.Diagnostics.Debug.Print(runtime.Version);
  System.Diagnostics.Debug.Print(runtime.Product.ToString());
}

or, to just get the currently active runtime:

bool succeeded = ESRI.ArcGIS.RuntimeManager.Bind(ProductCode.EngineOrDesktop);
if (succeeded)
{
  RuntimeInfo activeRunTimeInfo = RuntimeManager.ActiveRuntime;
  System.Diagnostics.Debug.Print(activeRunTimeInfo.Product.ToString());
}

Also in arcpy, you can use GetInstallInfo.

share|improve this answer
    
Reason for downvote? –  blah238 Jan 17 '13 at 0:55
    
I gave +1 so was surprised to see 0 when I looked back just now too - I also liked your ArcPy reminder. –  PolyGeo Jan 17 '13 at 1:08

On a Win7 64 bit PC this Registry Key may help. I have 10.0 installed, and it reads 10.0.2414.

\HKLM\software\wow6432Node\esri\Arcgis\RealVersion

share|improve this answer
1  
This one is useful for when ArcObjects is unavailable, I use when building installers. –  Kelly Thomas Jan 17 '13 at 0:32
2  
On 32-bit this key is HKLM\SOFTWARE\ESRI\ArcGIS\RealVersion –  mwalker Jan 17 '13 at 0:57
    
@mwalker Also on 64 bit with 10.1 I see HKLM\SOFTWARE\ESRI\ArcGIS\RealVersion, I wonder if this key exists at 10.0? –  Kirk Kuykendall Jan 17 '13 at 4:13
    
@Kirk, I do not have that key on 64-bit at 10.1 -- wonder why not. –  blah238 Jan 17 '13 at 4:23
    
@blah238 I've got 10.1 sp1, both desktop and server installed. Not sure which installation created the key. –  Kirk Kuykendall Jan 17 '13 at 5:03

There seems to be an interface called IArcGISVersion with a getVersions method which may be what you need.

UPDATE

Above relates to Java (thanks @blah238) - here is link to .NET (thanks @JasonScheirer)

share|improve this answer
    
That is for Java only. –  blah238 Jan 17 '13 at 0:16
1  
Link to the .Net version. –  Jason Scheirer Jan 17 '13 at 0:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.