Where are you guys putting stuff?
-
Okay, so I have a bunch of objects that need saving to disk, in this case sequenced gate information, nothing too complex. So I'd like the end-user to be able to use the OS dialogs to save and load these objects...all fine so far.
I would (probably) like to send a fair few "presets" for these objects too..so the user isn't starting out with nothing on day 1. So I would like a (simple) way to include these in the installer and packager.
Sure I can include these in the program itself and just write them to a well understood location the first time the program starts, but its a pain to load up several hundred objects into the code base, so I'd like to avoid this.
My first thought was AppData - which for the program isn't a problem - it knows where this is on Windows and on MacOS. But... it is a problem for the packager...
On the Mac the program may be installed in one of two places(depending on how the user has their Mac set up)
Macintosh HD/Users//Library/Applications Support//
Macintosh HD/Library/Applications Support//-- or at last thats my understanding...if I'm wrong please let me know...
So I would like a single (on each OS) consistent place that is known ahead of time that:
- I can reach from the program
- I can reach from the WhiteBox packager on MacOS
- I can reach from the Windows installer
Whats everyone doing?
-
@lindon on mac I use a post install shell script to move the folders from the user/...app support etc to the library/....app support. AFAIK that's the only way to get the files into the right place - you can't install direct into 'library' and that's where it needs to go. Within the payload I have a folder called Data and within that I have my lfo, wave and stepper shapes.
PC = similar, but you can install straight into appdata/roaming...
-
@danh - thanks - do you have a copy of the post install shell script you'd be prepared to share?
-
@lindon of course, it was largely from a thread on here anyway, and with the help of @Casey-Kolb. This is copying the whole developer name folder, you may wish to narrow it down to your plugin's folder only
#!/bin/sh sudo -u $USER mkdir -p $HOME/Library/Application\ Support/YOURDEVNAME/ /usr/bin/rsync -avurpE --remove-source-files /Library/Application\ Support/YOURDEVNAME/ $HOME/Library/Application\ Support/YOURDEVNAME/ sudo find $HOME/Library/Application\ Support/YOURDEVNAME/ -type d -user root -exec sudo chown -R $USER: {} + rm -rf /Library/Application\ Support/YOURDEVNAME exit 0
-
@lindon said in Where are you guys putting stuff?:
Macintosh HD/Users//Library/Applications Support//
I'm using the user library on mac. That's where HISE extracts everything by default.
I made a video on post install scripts... lemme see if I can make a link