Issue creating RHI Python installer in rhino 7

Hi, I’d like to create a new installer for my Rhino.Python commands, For now i have 2 commands that work properly inside Rhino 7. I created the __plugin__.py where I put the 3 lines described here.

id="{11cab2e9-db32-4274-9d45-50917b9a1d97}"
version="1.0"
title="BatchRotate"

In my folder there are both commands, while BatchRotate is the name of just one of them. Can I zip the folder and rename it to Plugin.rhi anyway? Or should I make a plugin for each command? Also Should I zip the \Dev folder or the content of it? I tried with just the content and I get the error

03/30/2022 09:51:11	6740	Info	Start: rhiexec
					version 7.16.22067.13001
					64-bit
					unknown   10.0.19044.0
03/30/2022 09:51:11	6740	Info	arguments: 
					"C:\Users\Stefano\AppData\Roaming\McNeel\Rhinoceros\7.0\Plug-ins\PythonPlugins\Stefano_Plug-In (11cab2e9-db32-4274-9d45-50917b9a1d97)\dev\Plugin.rhi"
03/30/2022 09:51:11	6740	Info	Logging started: 2022/03/30 09:51:11
03/30/2022 09:51:11	6740	Debug	Unknown	InstallerDialog_Load starting	(0%)
03/30/2022 09:51:11	6740	Debug	Unknown	InstallerDialog_Load ending	(0%)
03/30/2022 09:51:11	6740	Debug	Unknown	ShowInitializationDialog starting	(0%)
03/30/2022 09:51:11	6740	Debug	Unknown	ShowPanel starting	(0%)
03/30/2022 09:51:11	6740	Debug	Unknown	SwapPanel starting	(0%)
03/30/2022 09:51:11	6740	Debug	Unknown	SwapPanel ending	(0%)
03/30/2022 09:51:11	6740	Debug	Unknown	ShowPanel ending	(0%)
03/30/2022 09:51:11	6740	Debug	Unknown	ShowInitializationDialog ending	(0%)
03/30/2022 09:51:11	6740	Info	Initializing	INIT START: 	(0%)
03/30/2022 09:51:11	6740	Info	Unknown	Package not recognized as Localization Package	(0%)
03/30/2022 09:51:11	6740	Info	Unknown	Found 0 plug-ins	(0%)
03/30/2022 09:51:11	6740	Info	Unknown	Recognized payload as Python plugin	(0%)
03/30/2022 09:51:11	6740	Info	Initializing	Initializing Installer	(0%)
03/30/2022 09:51:12	6740	Error	Exception: System.ArgumentException
					Message: Version string portion was too short or too long.
					Source: mscorlib
					StackTrace:    at System.Version.VersionResult.SetFailure(ParseFailureKind failure, String argument)
					   at System.Version.TryParseVersion(String version, VersionResult& result)
					   at System.Version.Parse(String input)
					   at System.Version..ctor(String version)
					   at RhiExec.PythonPluginInfo.LoadPluginPyFile(String plugin_py)
					   at RhiExec.PythonPluginInfo.Initialize(Package package)
					   at RhiExec.InstallerPythonPlugin.get_Plugin()
					   at RhiExec.InstallerPythonPlugin.Initialize(AsyncReporter progress)
					   at RhiExec.Engine.Engine.Init(String packagePath, AsyncReporter progress)
					   at System.Threading.Tasks.Task`1.InnerInvoke()
					   at System.Threading.Tasks.Task.Execute()
					--- End of stack trace from previous location where exception was thrown ---
					   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
					   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
					   at RhiExec.View.InstallerDialog.<InstallerDialogShown>d__3.MoveNext()
					
03/30/2022 09:51:12	6740	Debug	Unknown	ShowPanel starting	(0%)
03/30/2022 09:51:12	6740	Debug	Unknown	SwapPanel starting	(0%)
03/30/2022 09:51:12	6740	Debug	Unknown	SwapPanel ending	(0%)
03/30/2022 09:51:12	6740	Debug	Unknown	ShowPanel ending	(0%)

Here is screenshot of my folder with __plugin__.py open

Thank you to anyone who can help.

@will - is this something you can help with?

I would highly recommend writing your python scripts as normal scripts and use the script compiler that ships with Rhino to compile these scripts into a plug-in with commands. RHI is no longer the recommended approach to plug-in distribution. The script compiler will create an rhp and a yak package that can be published to the package manager. If you really want an rhi, you could use the rhp created by the script compiler.

Thank you, where can I find documentation to do what you say?

Create python scripts that run how you want them to with RunPythonScript.

The script compiler is located on the tools menu in Rhino. It helps build a project that you can place these python scripts into and then build a plug-in.

Thank you, I use it to create scripts, then turn them into commands. I would like to make a rhi plug in to pass my scripts to my less tech savvy colleagues. So they can just double click on The installer and get the commands.
Thank you again.

Hello.
When distributing the plugins in rhp format every time one needs to unlock the files.
How do I no longer need this unlocking.

Thanks

Hi @Aniger_Calçados,

Use Yak.exe to create a package that contains your plug-in.

Users can install the package by scripting the _-PackageManager _Install command. If you want to distribute your plug-in to anyone, then push it to our package server.

– Dale

1 Like

@dale I think this has been discussed in the past, the Package Manager is not ideal for my plugin - it has a tiny usage base right now of 3 people. It makes much more sense to have some form of drag and drop installer available. Was there any thought or work being put into a solution closer to the .RHI format?

Cheers

DK

Hi @kiteboardshaper,

You can use a .yak package almost just like a .rhi file. You can drag and drop it on top of a running Rhino 7 (or later), or you can install it using the scripted PackageManager command, as mentioned above.

– Dale

OK - I did not know that - I had been led to think it was only suitable for use with the online package manager. I need to do a clean install of Rhino on one of my spare machines and give it a go.

Any clue as to the folder location it gets installed into?

Thanks

DK

On Windows:

%APPDATA%\McNeel\Rhinoceros\packages

On macOS:

~/Library/Application Support/McNeel/Rhinoceros/packages

– Dale

1 Like

What does this command look like in other languages?
Italian
Spanish
Etc…

Hi @Aniger_Calçados,

The underscore character, or _, that precedes the command and option names ensures that the English version of these names are used.

https://docs.mcneel.com/rhino/7/help/en-us/index.htm#information/rhinoscripting.htm?Highlight=underscore

– Dale

1 Like

That worked! Thanks Dale, can’t see why I never checked/tried that before.

Cheers

DK

Hi @dale

I created the YAK file, with the plugin and the manifest file. But when dragging it into Rhino, it looked like any other drawing file. Opened the dialog box… Import, Open, etc…

YAK file embedded YAK.EXE
Can be it?
I copied the files to the plugin folder.
How do I run without copying these files.
I’m running at DOS prompt

Make sure you are using the latest service release of Rhino 7.

– Dale

Yak Install <package>