Importing Expansions
-
Hey!
I'm off to adding an import/delete expansion system in my plugin. I'd like to know how you guys manage the importation of the expansions. Basically, I'd like to have a file that the user downloads, this would be the expansion file, like "instrument.filetype". When a user presses import on the preset browser in the plugin, it'd prompt a selection of this file and import the samples/samplemaps/resources in the expansion. I'd also like to run a script in my AdditionalSourceCode folder in the expansions to set the expansion right. This is basically what David Healey did in his Rhapsody, but I'm wondering how he the whole thing works in hise, like whats in the file that the user downloads, how I can make it, and how I can try and go about this process. I'd also want to eventually put into place a encryption/license process and I saw in the docs that there's a separate .hxi/.hxp filetype which goes with that.
Thanks!
-
@Casmat If you want the simplest solution you can use the built in expansion installer.
Go to the project directory tab in the left hand side bar of HISE. And at the bottom of that tab you'll see the expansion toolbar. Click this button to encode your expansion
This will create an hxi file.
From the Export menu you can select to export your samples as an archive, and this will display a popup. Choose HR as the format and further down you can select the hxi file you created previously.
This will produce one or more hr files that contain the expansion data (the hxi) and the samples. You can send these to your users.
Then with your installer system you just need to call
ExpansionHandler.installExpansionFromPackage()
and pass it the first hr file and the target sample directory.Now why aren't I using this for Rhapsody... the problem for me is this combines the data and the samples, but I often provide updates to one or the other and sometimes both. With large sample libraries I don't want my users to have to redownload multiple GB of samples for each update. So I went with a custom system using zip files (which have the .lwz extension instead of .zip to confuse Safari).
-
@d-healey Amazing explanation! Thanks so much! If I did go your route since it seems logical for my use case as well, do you think it'd still be possible to have the same high level of encryption the regular HISE encoded ones are like with just zip files? I know that zip files have AES 256 encryption available which should do half the trick, but would that work with HISE in decoding it with the password and do you think it'd still work with a wordpress website for authentication (jwt auth, woocommerce license manager, etc)?
Thanks!
-
@Casmat There is zero encryption with zip files. You should still be able to do the hxi to hxp encoding thing though.
I don't know anything about encrypting files via WooCommerce license manager. I don't do that for my stuff.
-
@d-healey In the docs, it says that there's intermediate and encypted level encryptions with the encrypted having user credential matching. Is the hxi the intermediate and the hxp the full encrypted?
-
-
@d-healey Thanks! One last thing, how would removing an expansion go on the user end. I didn't see any function to remove installed expansions, or maybe I cant see . What would I need to delete to remove all traces of an expansion?
Edit: is it just as straightforward as deleting the .hxp file or is there more to it?
-
@Casmat Yeah just delete the files, and put lots of safety checks to make sure you don't delete the wrong files :)
-
@d-healey Thanks a ton!