I am building a C# application that exports a CSV file to be used with the Visio org chart wizard.
How can I check that an installation of Visio exists, and what path?
The most obvious method is checking if C:\Program Files\Office12\ORGWIZ.EXE exists, but that is fairly dependant on having Visio 2007 installed..
My other thought is checking the registry, but what is the most reliable source? I’ve looked under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ where there are version numbers, but underneath them is a Visio\InstallRoot which would be perfect except for checking each versions..
I read elsewhere that I could check Uninstall information under Software\Microsoft\Windows\CurrentVersion\Uninstall\, but that looks fairly complicated for Windows components…
I would do a lookup for
HKEY_CLASSES_ROOT\Visio.Application in the registry.
If it doesn’t exist, no install.
If it does exist, the CurVer sub key will give you something like Visio.Application.12
That tells you the DEFAULT version that is installed (might be others)
HKEY_CLASSES_ROOT\Visio.Application.12 Sub Key CLSID will give you a guid:
{00021A20-0000-0000-C000-000000000046}
HKEY_CLASSES_ROOT\CLSID{00021A20-0000-0000-C000-000000000046} in turn will give you
Sub Key “LocalServer32”
Which will contain the path to the EXE.
C:\PROGRA~1\MICROS~4\Office12\VISIO.EXE /Automation
As you can see, in my case it has the short path form.