Confused about Exporting/Installing Expansions
-
I'm a bit confused about exporting an expansion and how to install it.
My goal is to use the encrypted format.
I have a project in HISE that includes an expansion. First, I compile the plugin. Then, to export the expansion, I go to Export → "Export Project as Full Expansion" and select HXI Full Instrument Expansion.
This generates a file called info.hxi in the project folder, which I understand to be the installer file.
To install the expansion in the compiled plugin, I'm using:
ExpansionHandler.installExpansionFromPackage(var packageFile, var sampleDirectory);
Where:
- packageFile is the .hxi file.
- sampleDirectory is the location where the samples should be extracted (I understand is an empty folder to extract the samples).
However, the installation isn’t working. The console returns "The sample directory does not exist". What am I doing wrong in the process?
-
@bendurso You don't want to use Full Expansions. Follow the instructions here - https://docs.hise.audio/working-with-hise/project-management/expansions/encrypted_expansion.html#expansion-types
The package files should be a hr1 file.
-
@d-healey Thanks! Yes, I’ve read those instructions. But how do I export the expansion to .hr1?
Does the .hr1 file compress all the folders within the expansion (samples, images, etc.)?
-
@bendurso said in Confused about Exporting/Installing Expansions:
But how do I export the expansion to .hr1?
Export >> Package Sample Monolith Files
Does the .hr1 file compress all the folders within the expansion (samples, images, etc.)?
It compresses the hxi and the samples - the hxi should contain the images I think.
-
@d-healey Nice thanks, I was missing that part. Now I compiled to hr1 with the hxi included. And I'm trying to install a hr1 expansion but still the console returns:
The sample directory does not exist
I'm using FileSystem.browse to select the .hr1 and if I print to console, it prints an object (I think is ok).
And if print the directory it's: /Volumes/Ben/RaizesIs there something wrong here?
-
@bendurso What are you passing for the sample directory?
-
@d-healey This:
/Volumes/Ben/RaizesJust an empty folder.
-
@bendurso But how are you passing it to the function?
-
@d-healey Oh, first I store the location in a json.
Then I import the json and add the location in the inline function
inline function InstallPackage() { local SampleFile = FileSystem.getFolder(FileSystem.AppData).getChildFile("sample_folder.json"); local SampleObject = SampleFile.loadAsObject(); local DirectoryName = SampleObject.SampleFolder; Console.print(DirectoryName); expHandler.installExpansionFromPackage(selectedInstrumentFile, DirectoryName); }
-
@bendurso I don't quite follow what you're doing.
You should ask the user where they want to install the samples, then pass that file object to the installExpansion function.
-
@d-healey I'm actually using this method, to store the location for future instruments. This way the user does not have to choose the location of the samples each time.
The error could be related to this? The output of the location looks the same..
-
@bendurso You need to pass the file object to the function - not the path.
-
@d-healey Oh, hehe, thanks! I was converting the result to a string, which was causing it to fail. Now there's no error.
However, I think there’s an issue with exporting the expansion since it’s not being installed properly.
First, I export "Project as Full Expansion" to generate the .hxi file (which should include expansion images, audio files, etc.). Then, I export using "Package Sample Monolith", selecting the expansion and the previously exported .hxi file.
Is this the correct method? The resulting .hr1 is not installing the expansion. No error in the console now.
-
@bendurso said in Confused about Exporting/Installing Expansions:
First, I export "Project as Full Expansion
You are not using full expansions, so don't do this.
Follow the documentation
-
@d-healey Ooh, I had read that part but since I had not found that section in Hise I omitted it. I finally found it and now it works fine! Thank you :)