Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

developer:installingandregisteringaplugin [2015/09/14] (current)
Line 1: Line 1:
 +====== Registering Plug-ins for Rhino 5 ======
 +> **Developer:​** //​[[developer:​cplusplusplugins|C++]],​ [[developer:​dotnetplugins|.NET]]//​
 +> **Summary:​** //​Step-by-step instructions for registering your plug-in.//
 +> **Note:** //To register plug-ins for Rhino 4, [[developer:​installingandregisteringaplugin:​v4|view this article]].//​
 +=====Overview=====
 +While a Rhino plug-in can simply be distributed as an **RHP** file, and loaded using Rhino'​s **PlugInManager** command, it is often necessary to install the plug-in as part of a product installation process. To install plug-ins from an installer, your installer will be required to access a number of entries in the Windows Registry.
  
 +While reading this article, it is helpful to use the standard Windows Registry editing tool, **REGEDIT.EXE**,​ to follow along and see how Rhino'​s Registry entries are structured.
 +
 +=====Finding the Rhino Registry Key=====
 +
 +Rhino plug-ins are registered in the following locations in the Windows Registry:
 +
 +====On 32-bit Windows====
 +**Rhino 5 32-bit**
 +<​code>​
 +HKEY_LOCAL_MACHINE\Software\McNeel\Rhinoceros\5.0\Plug-ins
 +</​code>​
 +
 +====On 64-bit Windows====
 +**Rhino 5 64-bit**
 +<​code>​
 +HKEY_LOCAL_MACHINE\Software\McNeel\Rhinoceros\5.0x64\Plug-ins
 +</​code>​
 +**Rhino 5 32-bit**
 +<​code>​
 +HKEY_LOCAL_MACHINE\Software\Wow6432Node\McNeel\Rhinoceros\5.0\Plug-ins
 +</​code>​
 +
 +=====Registering Your Plug-in=====
 +To register your plug-in with Rhino, you will need to create a new Registry key in the following locations depending on the Rhino version. The name of the Registry key will be your plug-in'​s GUID, the value returned by your plug-in'​s CRhinoPlugIn::​PlugInID() derived member, formatted as a string. For example:
 +
 +====On 32-bit Windows====
 +**Rhino 5 32-bit**
 +<​code>​
 +HKEY_LOCAL_MACHINE\SOFTWARE\McNeel\Rhinoceros\5.0\Plug-ins\<​your_plugin_guid>​
 +</​code>​
 +
 +====On 64-bit Windows====
 +**Rhino 5 64-bit**
 +<​code>​
 +HKEY_LOCAL_MACHINE\Software\McNeel\Rhinoceros\5.0x64\Plug-ins\<​your_plugin_guid>​
 +</​code>​
 +**Rhino 5 32-bit**
 +<​code>​
 +HKEY_LOCAL_MACHINE\Software\Wow6432Node\McNeel\Rhinoceros\5.0\Plug-ins\<​your_plugin_guid>​
 +</​code>​
 +
 +Under this new Registry key, create two new value names, **Name** and **FileName** that contain strings that identify your plug-in'​s name and the full path to the .RHP file, respectively. For example, if I had created a new plug-in named "​FooBar"​ that I has installed in Rhino'​s plug-ins folder, The registry would look like the following:
 +
 +====On 32-bit Windows====
 +**Rhino 5 32-bit**
 +<​code>​
 +HKEY_LOCAL_MACHINE\SOFTWARE\McNeel\Rhinoceros\5.0\Plug-Ins\F3CF4A28-EA9E-4E08-BABA-5FC6645A5D72
 +
 +Value: ​ Name
 +Type:   ​REG_SZ
 +Data:   ​FooBar
 +
 +Value: ​ FileName
 +Type:   ​REG_SZ
 +Data:   ​C:​\Program Files\Rhinoceros 5\Plug-Ins\FooBar.rhp
 +</​code>​
 +
 +====On 64-bit Windows====
 +**Rhino 5 64-bit**
 +<​code>​
 +HKEY_LOCAL_MACHINE\Software\McNeel\Rhinoceros\5.0x64\Plug-ins\F3CF4A28-EA9E-4E08-BABA-5FC6645A5D72
 +
 +Value: ​ Name
 +Type:   ​REG_SZ
 +Data:   ​FooBar
 +
 +Value: ​ FileName
 +Type:   ​REG_SZ
 +Data:   ​C:​\Program Files\Rhinoceros 5 (64-Bit)\Plug-Ins\FooBar.rhp
 +</​code>​
 +**Rhino 5 32-bit**
 +<​code>​
 +HKEY_LOCAL_MACHINE\Software\Wow6432Node\McNeel\Rhinoceros\5.0\Plug-ins\F3CF4A28-EA9E-4E08-BABA-5FC6645A5D72
 +
 +Value: ​ Name
 +Type:   ​REG_SZ
 +Data:   ​FooBar
 +
 +Value: ​ FileName
 +Type:   ​REG_SZ
 +Data:   ​C:​\Program Files (x86)\Rhinoceros 5\Plug-Ins\FooBar.rhp
 +</​code>​
 +
 +=====Automatic Loading=====
 +Rhino will attempt to load your plug-in the next time Rhino launches if the **Name** and **FileName** Registry values and data are present in your plug-in'​s Registry key. Rhino will briefly display a **Preparing plug-ins for first use** dialog if the plug-in loads correctly.
 +
 +When your plug-in loads for the first time, the rest of the normal Registry keys/value pairs in your plug-in'​s Registry key will be filled in.
 +
 +=====Other Useful Values=====
 +There are other useful key values that are found in the following locations depending on the Rhino version:
 +
 +<​code>​
 +HKEY_LOCAL_MACHINE\SOFTWARE\McNeel\Rhinoceros\5.0\Install
 +</​code>​
 +
 +**InstallPath** - contains the full path to the Rhino installation folder.
 +
 +**Path** - contains the full path to the System folder under the Rhino folder.
 +
 +=====Hints=====
 +Look in the Registry with **REGEDIT.EXE** and confirm that existing plug-ins follow these conventions.
 +
 +Use the right-click context menu in **REGEDIT.EXE** to access the "Copy Key Name" and "​Rename"​ functions so you can get accurate copies of names and values in the Registry.
 +
 +Test your installer to handle all of these situations:
 +
 +  - No Rhino is installed on the computer.
 +  - Only the Rhino Evaluation or Beta editions are installed.
 +  - Rhino is too old to run your plug-in.
 +  - Your plug-in is already installed.
 +  - The user wants to uninstall your plug-in and its Registry entries.
 +
 +\\
 +
 +{{tag>​Developer cplusplus dotnet}}
developer/installingandregisteringaplugin.txt ยท Last modified: 2015/09/14 (external edit)