I am trying to understand the process of installing Rhino plugIns on the user’s PC.
I need the user to agree/disagree on the plugin license, and to store the answer, how can we store the answer in the setting/ the rhp or dll file?
Most typical usage of license agreement check is to make it in your own plugin installer. Not the one provided by .rhi file or by yak package.
If you would like to use Rhino plugin installers, in theory you could provide such check in plugin OnLoad and store result in plugin settings Settings.SetString() or Settings.SetBool(), but be aware that this would require user to already have plugin downloaded/installed to initialize its loading. It is up to you to decide will it be ok with your plugin license agreement.
According to topic below McNeel will not provide a tool to accept plugin EULA before it is downloaded from yak server, since it is responsibility of plugin developer.
for the situation of “agree/disagree” do we also need to build a path to the user’s staged RUI file.
var sb = new StringBuilder();
as I understood, I only need to store in the settings and that is all?
hey @mlukasz87, I have another question.
I open a form to ask the user to agree/disagree on the license, and apparently, the Setting.SetBool() doesn’t set the “true” value immediately, but when I close the file and reopen it, it does work. but I need to set in the settings the changes while the file is still running, on a different discussion in the form they used rhinoscriptsyntax .sleep(4000) but there is no rhinoscriptsyntax, in c#, I also tried PlugIn.SavePluginSettings(AvocadoPlugIn.Instance.Id) then Rhino.RhinoApp.Wait();
didn’t help, how can wait for it to save/ change the value? thanks again!
protected override LoadReturnCode OnLoad(ref string errorMessage)
//check for previously used version
string plugin_version = Settings.GetString("PlugInVersion", null);
plugin_version = "0.0.0.0";
//make action when new version of plugin is loaded
if (0 != string.Compare(Version, plugin_version, StringComparison.OrdinalIgnoreCase))
//ask user to accept EULA during plugin load if not asked before for this version
bool plugin_EULA_accepted = Settings.GetBool("AcceptedEULA", false);
var form = new Views.MyEULADialog(); //my dialog returns bool value of EULA check
bool result = form.ShowModal(RhinoEtoApp.MainWindow);
if (result == true)
plugin_EULA_accepted = true;
"You did not accept EULA so bye, plugin will not load. Restart Rhino to try again.",
"My Plugin Name",
@dale@mlukasz87 I have a small question, once we store the answer in the plugin settings, does it mean that different Rhino users (with different license agreement answers) can access the plugin from the same computer? does it store the answer in the rhino license?
As far as I know, plugin settings are stored in .xml file, which is stored inside folder “settings” next to folder with .rhp file. All those folders are stored in user app data folder in Windows.
This would mean that each user use seperate plugin settings .xml file, however it would be better if @dale could confirm this. I am not aware if there are any other locations where plugin settings could be stored.
What @mlukasz87 says is correct. Settings are a per-user configuration and not shared with other Rhino users. If you want your EULA answered only once per system, then you’ll need to come up with another method than the sample posted above.