After a plugin is compiled to a .rhp file, is that all that has to be installed on the users PC or do any of the dll references or resources need to installed also? I have one text file that I store some settings in. I know that file will have to be installed, but I’m wondering about the button graphic files and dll’s in references and resources.
All the dependencies and resources that are not part of the RHP assembly need to be distributed along with the RHP. Basically, the RHP is a DLL of which the extension has been changed.
But: would you distribute the plug-in without testing if it works? I know I wouldn’t, so build your distribution and test if it works on a clean Rhino installation.
I’ll definitely test, I just don’t have a PC at the moment that has a clean install of rhino, so I’m trying to get a head start on it. So would the files displayed in resources and references in the project be considered part of the assembly?
Look at the bin directory where your plug-in is built. Are there any extra files in that directory?
Also, are you aware of the Settings property on the plug-in and command classes? You may be able to eliminate the need for a separate text file if you use those properties.
I wasn’t aware of a setting property. I have 8 parameters that I have to save on exit then load on startup. Can you post a quick sample of how to use that feature?
I think there are a whole bunch of files in the bin directory. I’m not in front of it now, but I know there is more than just the rhp file. Are you saying that what ever is in the bin directory needs to get installed in plugin folder in Rhino?
Both the command and plug-in classes have a Settings property that will handle what you describe. For example, if you are in a command’s RunCommand function
protected override Result RunCommand(RhinoDoc doc, RunMode mode)
double default_radius = Settings.GetDouble("DefaultRadius", 0);
bool use_diameter_mode = Settings.GetBool("DiameterMode",false);
// do something with these values
// .... maybe use them as default when asking the user for input
// If the values have changed and you want to save them
The files in the bin directory are what are needed (except the .pdb file which is only needed for debugging purposes.)