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.

What is the best way to verify that a machine has ArcInfo Workstation installed? A code sample in VBA, VB or C# would be great!

share|improve this question
2  
Set up a remote system event viewer looking for Fortran errors? ;) –  JasonBirch Jul 22 '10 at 20:45
add comment

3 Answers

They say it's acceptable to answer your own question, so here goes ...

Workstation should install a key in Window's registry. So just search the registry to see if it exists.

Here's an example in VB.Net:

Dim key As Microsoft.Win32.RegistryKey 
key= Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\\ESRI\\ArcInfo\\Workstation\\8.0") 
if key is Nothing then 
  'Workstation is not installed.
end if 
share|improve this answer
    
Does it remove that key on uninstall? –  JasonBirch Jul 22 '10 at 20:58
    
Good question Jason. I'm not sure. –  Robert Claypool Jul 22 '10 at 21:02
2  
the registry key may not be in the same location on 64bit systems (even for 32bit programs). –  matt wilkie Jul 23 '10 at 4:52
add comment

If you don't have access to poke around in the registry (happens to me often) a poor-mans method would be to look for the system environment variable ARCHOME. If that's there, check under that for the existence of the executable file ARCHOME\bin\arc.exe (or, on Unix, $ARCHOME\bin\arc.exe).

Because the default "Program Files" folder contains spaces, you are more likely to find ARCHOME at somewhere like : "C:\arcgis\arcexe10x".

ARCHOME is required to be set for ArcInfo Workstation to operate correctly, and it will be removed from the environment on uninstall.

share|improve this answer
add comment

Here's a VBS fragment I used for uninstalling Google Earth via a startup script. You can use these WMI objects to poll machines for the ArcInfo Workstation installation, assuming it's registered in the product catalogue.

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
 & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSoftware = objWMIService.ExecQuery _
 ("SELECT * FROM Win32_Product WHERE Name = 'Google Earth'")
For Each objSoftware in colSoftware
 objSoftware.Uninstall()
Next

Reference:

Documentation for the Win32_Product class.
WMI Made Easy for C#

share|improve this answer
add comment

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.