Copy protection questions, and installer vs. self-installing

Hi all:

I am finishing up the copy protection for my program. The basic idea: I have a “preferences” file, that works in conjunction with my plugin. The preferences file will be used to store the user info + the key information (the user provides a path to a keyfile when first opening the plugin, that has this info, and the info will be copied into the preferences file). Each time the plugin is initialized, it checks this preferences file to make sure everything is kosher.


  • Where should this file live? On the Mac, I had presumed /Library/Application Support/ValhallaDSP/[myPluginName], but there might be some permissions issues. Any other good recommended locations for this type of file? How about for Windows? Ideally, it would work on Win XP / Vista / 7.

  • Should the plugin be packaged in an installer, or should it be “self-installing”? In other words, the plugin could look for the preferences file when it is first opened, and if that file isn’t there, it could create a blank preferences file, then prompt the user to provide the path to the keyfile. For that matter, my RTAS plugin could write the initial presets to /Library/Application Support/Digidesign/Plug-In Settings - but there might be a permissions issue. What do y’all recommend? Packagemaker/Nullsoft Scriptable Installer, or building the “installer” into the AU/VST/RTAS itself?


Sean Costello

If you use the ApplicationProperties class, it takes care of all the platform-specific locations for you!

Wha? Do you mind explaining this in a bit more detail? This class has fairly sparse documentation, so I am not sure what it provides. I suspect the answer is “it provides awesome things,” but a bit more info would be great.


Sean Costello

Just create one, call setStorageParameters(), then getUserSettings() to get a place to stick all your settings. Have a search through the demo code for examples, it’s used in the jucer.

Not used in either version of the Jucer, as far as I can tell. It shows up in the audio plugin host example.

BTW, where should I be looking for the file created, for both OSX and Windows? I like to see what I am writing into…

EDIT: OK, it looks like the user settings file is located at ~/Library/Preferences/[fileName].settings. I’m not seeing the common settings file being saved - do I need to write specifically to that file to ensure that it gets saved?


One last question, that I’ll be able to read any answers in the morning (your evening):

For a plugin, where would be the best place to call setStorageParameters()? In the constructor for the editor, or in the constructor for the plugin itself? I presume that any copy protection checks that require user input should be left out of the plugin constructor, as that will cause messages to come up when the DAW is booted, which is annoying. But the setStorageParameters() function may not be as annoying.


Sean Costello

You could also use PropertiesFile::createDefaultAppPropertiesFile() directly, instead of the ApplicationProperties stuff - maybe that’s what the jucer uses, I can’t remember exactly. Have a read through the PropertiesFile comments to understand how it gets saved.

It looks like the Jucer has some code to create a “singleton” that ends up being very close to what ApplicationProperties provides. I haven’t looked at it too closely because, well, ApplicationProperties seems to be working well for me.

And this whole PropertySet thing - damn! Now THAT is useful stuff for creating keyfiles!

Sean Costello

Hello Sean,
I have something similar working and had no issue with permissions.