Continuing the discussion from Can UI.openpanel show the Plugins directory on OS X?:
Not quite correct. It is a path for user specific application data.
Except that since 2014 the plugins ARE in the User path. They are considered user files.
We needed them moved into the user path because we were accessing them directly, moving them around, etc.
But I understand, for the non-developer, and non-power users who know only clicking an “Install Plugin” button, that they wouldn’t be getting into this folder. Which is what the the application OEM usually wants.
The ones to not touch are the ones in the %ProgramData%
path.
So where to write extension settings if not in the extension’s folder and not in the registry ?
We could go up several folder levels and create our own version independant “company” folder. Let us call the user “Dan”, the plugin “Widget” and the developer / company “SuperGeek”.
On Windows the application data path is: %AppData%
Which is: C:/Users/Dan/AppData/Roaming/
On Windows the Plugin is here:
%AppData%/SketchUp/SketchUp 2015/SketchUp/Plugins/SuperGeek_Widget
The first folder is a company folder (the DevTeam chose to go with the Trimble division name, just in case SketchUp gets sold again, I suppose.)
The second folder is the versioned folder, the third is the application folder (there is also a “LayOut” and a “StyleBuilder” folder.)
The fourth folder is the “Plugins” folder, and the last is the specific extension folder.
Some developers might attempt to stay within the “SketchUp” folder hierarchy, by using a path like:
%AppData%/SketchUp/SuperGeek_Widget
or
%AppData%/SketchUp/SuperGeek/Widget
To be totally correct “SuperGeek” should consider himself a ‘company’ and be outside of the entire “SketchUp” company folder hierarchy.
So his data settings path would be like:
%AppData%/SuperGeek/Widget
His settings would be version independent of the SketchUp version, and not need any migration when the user updates SketchUp. (Provided that the format for his extension settings do not change.)
This is why I always tell new developers not to use trademarked names for their developer namespace module name. It could clash with folder name by the actual trademark owner, in the %AppData% folder.
I suppose, if we could all agree upon an appropriate folder name, we could create a specific sub-folder of the %AppData% folder, to serve for only SketchUp Extension or Plugin settings.
What about %AppData%/SketchUpPluginData
?
or
how about sub-folder of %AppData%/SketchUp
like:
%AppData%/SketchUp/ExtData
?