It looks like quite simple a question. However, as far as Revit products especially versions earlier than 2012 are concerned, it becomes different. Let us address the issue in this post.
Revit tried to be independent on Windows registries in the past. It was good if viewed from the maintenance perspective of end users since it could be sure that no garbage would be left over in the registry when deletion or un-installation and Revit would not malfunction due to registry issues.
However, if viewed from the development perspective of third parties, things are totally different. Things would become just tricky. People may remember in the old days that it was hard to locate the Revit installation places. We had to look for a flag file such as Revit.Exe or Revit.Ini on the whole hard drive of interest. Supposing there are a few such hard drives with huge capacities and each of which has a few partitions, e.g. C, D, E, F, G, H, I, J, K, L M, N and the Revit of concern is installed on the last partition, what can be imagined if this approach is applied? It will take minutes or even hours to just find the Revit locations. Really a pain, isn’t it?
In fact, the Uninstall keys could be reliably and efficiently used to detect where Revit products are installed and to get some other useful information as well. For example, the following uninstall key specifies the install/uninstall information about the Autodesk Revit Architecture 2011 x64:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{94D463D0-2B13-4181-9512-B27004B1151A}
The DisplayName value indicates what it is; the InstallLocation where it is; the Publisher who makes it; the VersionMajor which major version it is; the VersionMinor which minor version it is; etc.
It may be easy to hard code the uninstall GUIDs of all Revit products such as the {94D463D0-2B13-4181-9512-B27004B1151A} in this case and retrieve the InstallLocation value from the key to know the install location of the products such as the Revit Architecture 2011 here, but it is apparently error prone, cumbersome, and not flexible enough. There are a few reasons.
• There are quite many different Revit versions.
• There are a few different Revit flavors.
• There are quite some different languages.
• There are x64 and x86 bitnesses.
• There may be some updates and patches for each product, version, flavor and language.
If it were me, I would iterate through all the Uninstall keys and check the Publisher value first to know whether the product is from Autodesk, seek a particular keyword such as Revit in the DisplayName value to know what product family it is in, parse the value further to know if it is exactly the product we care about if necessary, then check the VersionMajor and the VersionMinor to know what version the Revit is, read the Language value to know what language the Revit is in, and finally retrieve the install location from the InstallLocation value.
RevitAddinWidget provides a Revit Locator which lists out all installed Revit products on the computer and can navigate to the installation folder of the selected Revit product right away.
Related posts:
Deploy & Install: Revit Application Addin Manifest
Deploy & Install: Revit Command Addin Manifest
Deploy & Install: Revit Addin Roaming Folders
Deploy & Install: The Registry of Revit 2011
Deploy & Install: The Registry of Revit 2012
Deploy & Install: Where Are Revit Products Installed
Deploy & Install: Manifest Navigator of RevitAddinWidget
Deploy & Install: RegEdit Launcher of RevitAddinWidget
Deploy & Install: Revit Locator of RevitAddinWidget
Deploy & Install: Manifest Encoding
Deploy & Install: Manifest Loading
Deploy & Install: Manifest ClientId
Deploy & Install: Manifest ClientId and AddinId
Deploy & Install: Manifest Integrity
Deploy & Install: Revit Manifest Organizer
Deploy & Install: Create New Of Revit Manifest Organizer
Deploy & Install: Check Integrity New Of Revit Manifest Organizer
Deploy & Install: Detect Duplicate New Of Revit Manifest Organizer
Deploy & Install: View Selected Of Revit Manifest Organizer
Deploy & Install: Edit Selected Of Revit Manifest Organizer
Deploy & Install: Merge Selected Of Revit Manifest Organizer
Deploy & Install: Dismantle Selected Of Revit Manifest Organizer
Deploy & Install: Copy/Move/Delete Selected Of Revit Manifest Organizer
Deploy & Install: Miscellaneous Of Revit Manifest Organizer
Deploy & Install: Create Revit Manifest Files Programmatically With C#
Deploy & Install: Programmatically Detect Windows Versions And Find Revit Addin Roaming Folders
Deploy & Install: Revit Addin Project Output And API Dependencies
Deploy & Install: Revit Addin Projects and Visual Studio Setup Custom Actions
Deploy & Install: Deploy Revit Manifest Files with C# Using Installer Custom Actions
Recent Comments