Revit Install Path and Product GUIDs

Things were a bit hectic with many cases toward the end of last week, so less posts.
By chance and luck, I was able to spontaneously join a ski tour on Sunday.
The danger of avalanches is currently pretty high in most of Switzerland, and the weather was bad with lots of snow as well, so we evaded those problems by going way down south into Ticino and climbing Motto Crostel, 2302 m, from Faido and Tengia at 1099 m.
We even got some sun and spots of deep blue sky in the late afternoon.
Now I am finishing off this post that I started working on a while ago so that I have something prepared for tomorrow morning before I get bogged down in real work again, on the Revit installation path and the Revit product GUIDs.

Installation of a Revit add-in requires knowledge of the Revit program folder path, either just to modify Revit.ini or to actually install the add-in into the same folder.

Revit Add-in Folder

The easiest way to make full use of some of the more complex .NET framework features which involve security settings and access rights, for example application settings and resource handling, is to install a class assembly in the same directory as the executable defining the AppDomain loading the it, i.e. Revit.exe in the Revit executable folder, which is the Program subdirectory under the Revit main installation folder.
One example of this is making use of the using System.Configuration namespace to store application settings.
The general recommendation for both AutoCAD.NET and Revit add-ins is for the installer to install the external command into the main application executable folder.

However, it is not absolutely necessary to install a Revit add-in in the same directory as Revit.exe.
I leave all my sample applications in the binary directory where they are built, and some shipping add-ins from Autodesk create their own installation folders, by default under C:/Program Files/Autodesk, such as:

  • Batch Print for Revit 2009
  • Worksharing Monitor for Autodesk Revit 2010
  • STL Export for Autodesk Revit 2010

Revit Install Path

In any case, an installer will need to determine the Revit install path.

Revit is designed to write as little as possible into the Windows registry.
Though it adds some entries to the Windows registry at session start-up, by default it will clean up those entries again when it exits.
Fortunately, Windows maintains some independent uninstall information in the registry, and this includes the installation folder path.
The uninstall information is located under the following registry key:


HKEY_LOCAL_MACHINE
SOFTWARE
Microsoft
Windows
CurrentVersion
Uninstall

If the 32-bit version of Revit is installed on a 64-bit OS machine, the registry path is placed under the Wow6432Node key, so it becomes:


HKEY_LOCAL_MACHINE
SOFTWARE
Wow6432Node
Microsoft
Windows
CurrentVersion
Uninstall

For each version of Revit, the installer will add uninstall information under a sub-key named according to a version specific GUID.
These GUIDs depend on the Revit version and flavour.
There are also separate GUIDs for the 32 and 64 bit versions.
The Revit product GUID is thus independent of the Revit language and only depends on the 32 or 64 bit version, major version number and flavour, which is one of RAC, RME or RST, for Revit Architecture, MEP and Structure.

To find the GUID for any specific Revit product version and language that you are interested in, simply search for the product name under the Uninstall key.
For instance, for Revit Architecture 2009, search for the string “Revit Architecture 2009”.
The search result will be located in a sub-key named “{A3A37DA6-70C0-497C-BCB1-148E9EC1D32E}”, so the uninstall information for an 32 bit English version of Revit Architecture 2009 on a 32-bit OS is located under the following registry key:


HKEY_LOCAL_MACHINE
SOFTWARE
Microsoft
Windows
CurrentVersion
Uninstall
{A3A37DA6-70C0-497C-BCB1-148E9EC1D32E}

Revit Product GUIDs

Here is a set of GUIDs for various versions of Revit, including the upcoming 2010 release:

2010 64 bit RAC {2A8EEE2F-4A9E-43d8-AA07-EC8A316B2DEB}
RME {A1BD042B-8A6F-4e37-92A3-78921BB45B05}
RST {BC9C0A08-DEA4-4138-A7FB-8F68866DB0C1}
32 bit RAC {572FBF5D-3BAA-42ff-A468-A54C2C0A17C3}
RME {5C8281B1-B927-495a-A0FF-AB4BDFAE505C}
RST {939D29FC-B82D-42a7-BB1E-8E3F121505CC}
2009 64 bit RAC {D2466208-7348-4214-B01E-7BC8729E2BD3}
RME {4A98F976-01B5-40e8-A496-AEFD85C3A446}
RST {B354FCF5-CF64-4fa2-AA84-9D9B2A6FA649}
32 bit RAC {A3A37DA6-70C0-497C-BCB1-148E9EC1D32E}
RME {E3781DCB-A650-4E66-9B74-67A1B17F052C}
RST {C4B3B3C3-2EE9-48D3-9BF5-4443F7ECF759}
2008 RAC {4A11206C-4377-49E8-911E-B11548658FF3}
RME {60A2743E-C881-4880-94ED-96445E38616F}
RST {8D0AE0BB-4FE5-491D-A284-3B363F02E639}
9.0 Revit Building {D11DB6CB-0332-4735-B312-B919741D975E}
3 RST {3F11CEE0-D30D-41ce-8522-922B5D8BB324}
8.1 Revit Building {7EBC0489-5E47-498D-BE31-B094484612E9}
2 RST {BE814F63-629D-4fd8-B628-1437AC10F9D4}

Comments

9 responses to “Revit Install Path and Product GUIDs”

  1. You’ve been kicked – a good thing ;-)
    http://www.cadkicks.com/adkrevitarch/Revit_Install_Path_and_Product_GUIDs
    Excellent info – bookmarked for future reference.

  2. Hi Jose,
    Thank you for the good kick :-)
    Cheers, Jeremy.

  3. Jeremy,
    I am creating a setup project for my Revit External Application, and I am trying to edit the Revit.ini through the setup.
    I have read tons of pages on MSDN about Custom Action,
    implemented it, but never worked.
    I know the changes to Revit.ini could be done through a DLL that uses StreamReader and StreamWriter, this is the easy part. but I can’t get them to be executed by the windows installer.
    Here is what I did for testing:
    1. Created compiled a DLL with a single method that sends a message box.
    2. I added a custom action to the setup project in my solution where I browsed and added the DLL created in step 1 to the Install folder in the Custom Action editor.
    3. It never executed.
    I tried that with a DLL, DLL compiled as a windows application, an exe, … you name it.
    Please help or at least guide me to where I can find the solution before I loose my eyes staring for hours at websites trying to find it.
    Regards,
    Nadim

  4. Dear Nadim,
    I have very little experience with installers, so I cannot do much to help you here. I can point you to the MidasLink sample application, which does include an installer, but the source code is only available to ADN members:
    http://thebuildingcoder.typepad.com/blog/2009/04/revit-structure-resources.html#midaslink
    You can also have a look at the Revit SDK ModifyIniFile sample, which shows how to parse and modify Revit.ini, but that is really no big deal.
    Except for that, I suggest discussing the issue with your peers:
    http://thebuildingcoder.typepad.com/blog/2009/10/revit-api-forums.html
    Cheers, Jeremy

  5. Nadim Ayche Avatar
    Nadim Ayche

    You’re the best.
    Thanks.

  6. Jeremy,
    I did a publish command for my company a few weeks ago.
    The following bug showed up after the command is been in use on other machines.
    It basically happens with PDF plots, here is exception message and stacktrace
    [
    The files already exist!
    at Autodesk.Revit.PrintManager.SubmitPrint()
    at PJF.Revit.Plotting.PlotUtilities.PlotExecute(Document& xDoc, String& xPrinterName, PaperSize& xPaperSize, ZoomType& xZoomType, Int32& xZoom, PageOrientationType& xPageOrientation) in C:\PJF Revit 2009\Plotting\PlotUtilities.cs:line 168
    at PJF.Revit.Plotting.Plot.Execute(ExternalCommandData commandData, String& message, ElementSet elements) in C:\PJF Revit 2009\Plotting\PlotForm.cs:line 147
    ]
    basically, it happens at the final SubmitPrint() method.
    And it happens only when the file is already plotted before.
    Oddly enough, this happens only if a copy of the pdf file is already saved on the My Document. if I go to My Documents and delete the pdf file, it works fine again.
    Have you come across this? Any idea why this SubmitPrint() method is confilicting with an existing pdf plot in the My Documents?
    your help and guidance are highly appreciated.
    Regards,
    Nadim

  7. Dear Nadim,
    Nope, I have not come across this before, but then I never print anything. Have you tried checking for existence of the file and deleting it if found before you launch the print?
    Cheers, Jeremy.

  8. I found the problem.
    Basically, it is caused by the PrintManager.PrintToFileName property.
    I did work around it; however, I think the problem is in the Revit UI setup for printing electronic files.
    Example: when you print a pdf, the pdf printer will give you the choice to pick a folder to save at. It will overrite it if you choose to.
    With that said, I don’t undertand why the Revit asks you to put a path for the file before. It is redudant. It will be overriden by the pdf printer anyway. and it is causing this issue. IF you can pass it on to Revit Developers would be great.
    I hope this help.
    Thanks.

  9. Dear Nadim,
    Congratulations on finding a solution and thank you very much for letting us know.
    Cheers, Jeremy.

Leave a Reply to Jeremy TammikCancel reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading