Site Tools


Differences

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

Link to this comparison view

developer:installingandregisteringaplugin [2012/06/14]
brian
developer:installingandregisteringaplugin [2013/05/31] (current)
dale [Automatic Loading]
Line 1: Line 1:
-====== Registering Plug-ins ======+====== Registering Plug-ins for Rhino 5 ======
 > **Developer:** //[[developer:cplusplusplugins|C++]], [[developer:dotnetplugins|.NET]]// > **Developer:** //[[developer:cplusplusplugins|C++]], [[developer:dotnetplugins|.NET]]//
 > **Summary:** //Step-by-step instructions for registering your plug-in.// > **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===== =====Overview=====
-While a Rhino plug-in can simply be distributed as an .RHP file, and activated/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 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. 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 Current Rhino===== +=====Finding the Rhino Registry Key===== 
-Because it is possible for more than one copy of Rhino to be installed on a computer, you can determine the most recently used copy of Rhino looking for the **MostRecent** registry value name, which can be found in the following key locations depending on the Rhino version:+ 
 +Rhino plug-ins are registered in the following locations in the Windows Registry:
  
 +====On 32-bit Windows====
 +**Rhino 5 32-bit**
 <code> <code>
-HKEY_LOCAL_MACHINE\SOFTWARE\McNeel\Rhinoceros\3.0 +HKEY_LOCAL_MACHINE\Software\McNeel\Rhinoceros\5.0\Plug-ins
-  or +
-HKEY_LOCAL_MACHINE\SOFTWARE\McNeel\Rhinoceros\4.0+
 </code> </code>
-    
-Note, on a 64-bit version of Windows, 32-bit programs use a different software key. 
  
 +====On 64-bit Windows====
 +**Rhino 5 64-bit**
 <code> <code>
-HKEY_LOCAL_MACHINE\Software\WOW6432node+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> </code>
  
-Thus, Rhino's 3.0 and 4.0 use the following locations on x64 version of Windows:+=====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> <code>
-HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432node\McNeel\Rhinoceros\3.0 +HKEY_LOCAL_MACHINE\SOFTWARE\McNeel\Rhinoceros\5.0\Plug-ins\<your_plugin_guid> 
-  or +</code>
-HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432node\McNeel\Rhinoceros\4.0 +
-</code> +
  
-For the sake of brevity, this article assumes a 32-bit version of Windows. But the same information applies to x64 versions, just with the above path modification.+====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>
  
-The data in this value is a 10-character date string (REG_SZ) in the form of YYYY-MM-DD that identifies the build date of RhinoAn example date string is "2006-05-19which identifies Rhino 3.0 SR5b. If the **MostRecent** value does not existor if the string value is empty, then Rhino is not installed on the computer, or the installation is damaged.+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 "FooBarthat I has installed in Rhino's plug-ins folderThe registry would look like the following:
  
-As mentioned above, it is possible for more than one copy of Rhino to be installed on a computer. (Exception: Rhino 4.0 is designed to have just one active installation.) To discover all of the Rhino editions on the system would require enumerating all of the date keys found in the following locations depending on the Rhino version:+====On 32-bit Windows==== 
 +**Rhino 5 32-bit** 
 +<code> 
 +HKEY_LOCAL_MACHINE\SOFTWARE\McNeel\Rhinoceros\5.0\Plug-Ins\F3CF4A28-EA9E-4E08-BABA-5FC6645A5D72
  
-   HKEY_LOCAL_MACHINE\SOFTWARE\McNeel\Rhinoceros\3.0 +Value:  Name 
-     or +Type:   REG_SZ 
-   HKEY_LOCAL_MACHINE\SOFTWARE\McNeel\Rhinoceros\4.0+Data:   FooBar
  
-Typically, plug-ins are only registered with the most recently used version of Rhino. Most users have only one Rhino installed.+Value:  FileName 
 +Type:   REG_SZ 
 +Data:   C:\Program Files\Rhinoceros 5\Plug-Ins\FooBar.rhp 
 +</code>
  
-=====Finding the Rhino Registry Key=====+====On 64-bit Windows==== 
 +**Rhino 5 64-bit** 
 +<code> 
 +HKEY_LOCAL_MACHINE\Software\McNeel\Rhinoceros\5.0x64\Plug-ins\F3CF4A28-EA9E-4E08-BABA-5FC6645A5D72
  
-If the **MostRecent** Registry value contains a valid date string, then you can find Rhino's Registry key in the following locations depending on the Rhino version:+Value Name 
 +Type:   REG_SZ 
 +Data:   FooBar
  
-   HKEY_LOCAL_MACHINE\SOFTWARE\McNeel\Rhinoceros\3.0\<date>\Install +Value:  FileName 
-     or +Type:   REG_SZ 
-   HKEY_LOCAL_MACHINE\SOFTWARE\McNeel\Rhinoceros\4.0\<date>\Install+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
  
-where <date> is the string value identified by the **MostRecent** value.+Value:  Name 
 +Type:   REG_SZ 
 +Data:   FooBar
  
-In this key, you will find the **Edition** key value that will identify the edition, or type, of RhinoBeta, Release, or Evaluation. If the value of **Edition** is Evaluation, then the Evaluation version of Rhino was either the most recently installed or most recently run edition. Every time Rhino is installed, or run and then closed, the **MostRecent** key value is modified to reflect that Rhino's build date.+Value FileName 
 +Type:   REG_SZ 
 +Data:   C:\Program Files (x86)\Rhinoceros 5\Plug-Ins\FooBar.rhp 
 +</code>
  
-If the value of **Edition** is "Release", then the Commercial version of Rhino version of Rhino was either the most recently installed or most recently run editionThis includes any Rhino that can be installed from Rhino CD, including Commercial, Educational, and Not-for-Resale versions. Note, these versions only differ in their CD keys.+=====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 **Preparing plug-ins for first use** dialog if the plug-in loads correctly.
  
-=====Using the Edition Value===== +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.
-**Beta** - Unless your intent is for your plug-in to run with Beta editions of Rhino, you will probably want to avoid installing your plug-in on these editions. For one reason, Rhino 3.0 and 4.0 Beta editions have long since expired and no longer run. Also, for your plug-in to work with Beta editions, they are requried to be built with the same SDK version. +
- +
-**Commercial** - This edition should be your primary target. +
- +
-**Evaluation** - Supporting this edition is a good way for customers to evaluate your plug-in. Note, when the Rhino evaluation period has expired, it will no longer load all 3rd-party plug-ins.+
  
 =====Other Useful Values===== =====Other Useful Values=====
 There are other useful key values that are found in the following locations depending on the Rhino version: There are other useful key values that are found in the following locations depending on the Rhino version:
  
-   HKEY_LOCAL_MACHINE\SOFTWARE\McNeel\Rhinoceros\3.0\<date>\Install +<code
-     or +HKEY_LOCAL_MACHINE\SOFTWARE\McNeel\Rhinoceros\5.0\Install 
-   HKEY_LOCAL_MACHINE\SOFTWARE\McNeel\Rhinoceros\4.0\<date>\Install+</code>
  
-**Default Language** - identifies the language used by Rhino.+**InstallPath** - contains the full path to the Rhino installation folder.
  
-**InstallPath** - contains the full path to the [[rhino:rhinoceros|RhinoCeros]] installation folder. +**Path** - contains the full path to the System folder under the Rhino folder.
- +
-**LicenseNodeType** - identifies if Rhino is installed as standalone or as a network node. +
- +
-**Path** - contains the full path to the System folder under the [[rhino:rhinoceros|RhinoCeros]] folder. +
- +
-=====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: +
- +
-   HKEY_LOCAL_MACHINE\SOFTWARE\McNeel\Rhinoceros\3.0\<date>\Plug-Ins +
-     or +
-   HKEY_LOCAL_MACHINE\SOFTWARE\McNeel\Rhinoceros\4.0\<date>\Plug-Ins +
- +
-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: +
- +
-   HKEY_LOCAL_MACHINE\SOFTWARE\McNeel\Rhinoceros\3.0\<date>\Plug-ins\<your_plugin_guid> +
-     or +
-   HKEY_LOCAL_MACHINE\SOFTWARE\McNeel\Rhinoceros\4.0\<date>\Plug-ins\<your_plugin_guid> +
- +
-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, respectivly. For example, if I had created a new plug-in named "FooBar" that I has installed in Rhino's system folder, The registry would look like the following: +
- +
-   HKEY_LOCAL_MACHINE\SOFTWARE\McNeel\Rhinoceros\3.0\<date>\Plug-Ins\F3CF4A28-EA9E-4E08-BABA-5FC6645A5D72 +
-     or +
-   HKEY_LOCAL_MACHINE\SOFTWARE\McNeel\Rhinoceros\4.0\<date>\Plug-Ins\F3CF4A28-EA9E-4E08-BABA-5FC6645A5D72 +
- +
-   Value:  Name +
-   Data:   FooBar (REG_SZ) +
- +
-   Value:  FileName +
-   Data:   C:\Program Files\Rhinoceros 3.0\System\FooBar.rhp  (REG_SZ) +
- +
-=====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 fill be filled in.+
  
 =====Hints===== =====Hints=====
Line 125: Line 121:
  
 {{tag>Developer cplusplus dotnet}} {{tag>Developer cplusplus dotnet}}
- 
developer/installingandregisteringaplugin.1339701248.txt.gz · Last modified: 2012/10/15 (external edit)