Registering Plugin (Register)


I am trying to register my plugin before starting Rhino to automate some things, but I get the following error:
Unable to load LutraCAD.rhp plug-in: application initialization failed.

How am I trying to do this:

My.Computer.Registry.SetValue(“HKEY_CURRENT_USER\SOFTWARE\McNeel\Rhinoceros\5.0x64\Plug-Ins\XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX”, “Name”, “LutraCAD”)
My.Computer.Registry.SetValue(“HKEY_CURRENT_USER\SOFTWARE\McNeel\Rhinoceros\5.0x64\Plug-Ins\XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX”, “FileName”, “C:\LutraCAD\LutraCAD.rhp”)

But when Rhino starts it gives the error I told on the start.
What am I doing wrong?

The plugin is not Blocked, the location is correct, the name also…
If I drag and drop everything works perfect…

Thank you.

P.S. I have the most recent version of rhino installed and tried x86 and x64.

Could it be that you need to add

[assembly: AssemblyInformationalVersion("2")]

To your AssemblyInfo file?

Sadly enough, this is not working.

P.S. I dont have the Changes to MyPlugIn.cs in my MyPlugin.vb
I can’t add this part because It does not recognize PlugInID() PlugInName() etc.

Could this be the problem?

After you drag & drop, what difference in the Registry do you see?

When I add it like the links above:

No sub directories only my plugin id with these 2 values

When I drag n drop:

2 sub directories and lots more values.

Does the directory needs to be in the sub directory Plugin? Because I dont have that…???

EDIT: Oke I think Rhinoceros started faster than both the registry values could be added so it gave an error…
I just Thread.Sleep(1000) before starting and everything works perfect now.

Oke this is weird.

In my own application I add the 2 registry values.
When I start rhino like:

Dim psi = New ProcessStartInfo('RhinoLocation')
Dim myProcess As Process = Process.Start(psi)

It gives an error, BUT if I add the 2 values and open the EXE manually it works perfect…

Is it possible that this is a bug on Rhino side?

Hi Jordy,

Can I assume you’ve written an installer for your plug-in? Is there a reason you are not just using the Rhino Installer (RHI)?

– Dale

Hi Dale,

I want to make it as easy as possible for my users.
So I made a setup for my program (A client manager)
After this is started for the first time it adds the registries, opens rhino, load the plugin, runs a command from the plugin and closes rhino.
Then it is all ready to go for the user.

So I guess I got it all working.