Hello! I was able to figure out a method for offline licensing using an RSA signed .xml file and wanted to set it up such that the plugin remembers the filepath the user provided such that it can use to re-verify whenever the plugin is loaded.
How can I store this kind of information permanently? Any suggestions appreciated, thanks!
I put my UI preset here. You can do something similar:
inline auto static const kPath =
juce::File::getSpecialLocation(juce::File::userApplicationDataDirectory)
.getChildFile("Audio")
.getChildFile("Presets")
.getChildFile(JucePlugin_Manufacturer)
.getChildFile(JucePlugin_Name);
inline auto static const kUIPath =
kPath.getChildFile("ui.xml");
I’m not sure I understand. Does this UI preset work as a way to store things permanently? Thanks!
Some ideas:
Require the file to be placed into a predetermined location as suggested above.
Have a ‘data.xml’ file in a predetermined location, and once your plugin prompts the user for the license file location, you write that location to this data.xml file with the location of the license file, providing a location to lookup via a known file.
Use the registry on windows and dat files on Mac.
1 Like
Exactly, I store plugin window size, colour scheme, etc (all settings permanently shared by all plugin instances) in this XML file. For license you may choose a different folder under juce::File::userApplicationDataDirectory.
I see, thank you! So you write different attributes directly onto the file, and then pull them at startup? And this is just using the juce::File and juce::XML objects?
Yes. I am using juce::PropertiesFile and juce::XmlDocument. And I use apvts to hold those values. Anything similar should work.