HISE Unzipping
-
@Casmat nope, now you've went full gibberish :)
If you want to delete the zip file, pass in
result
as lambda and delete it when the extraction is finished (obj.Status == 2
) according to the docs:FileSystem.browse(FileSystem.Downloads, false, "*", function(result) { var fileToDelete = result; // you can't pass in function parameters as lambda result.extractZipFile(FileSystem.getFolder(FileSystem.Desktop), true, function [fileToDelete](obj) { if(obj.Status == 2) { fileToDelete.deleteFileOrDirectory(); } }); });
EDIT: forgot that you can't pass in arguments as lambda, now it should work.
-
@Christoph-Hart oooh! That's why you're Christoph Hart and i'm not!
-
@Casmat oh and check my edit, I made a mistake.
-
@Christoph-Hart got it! Thanks for checking up!:grinning_face_with_smiling_eyes:
-
@Christoph-Hart Oh wait... that deletes the original zip file, I'm trying to delete the extracted file inside the zip...
-
@Casmat lol why? sounds like a software version of this:
-
@Christoph-Hart yeah, context probably helps! I am planning to package hr1 files in an expansion and other thingys for users to import and I was planning to put them all into a zip and send that zip to the user, when unzipping the zip file to access its contents, I’d want to delete the unzipped portion when all the installation is done to clear space. Hence the question of how to delete unzipped files!
-
@Casmat An hr file is already a compressed archive, there is no reason to zip a zip file.
Send the user multiple zip files
-
@d-healey yup, but I’m planning on including other content that could be used for the player plugin that hr1 files wouldn’t be useful in, and creating a single zip file package would make a more seamless installation process for users
-
@Casmat How big will your zip files be?
-
@d-healey have no clue, variable range, from couple mb to couple Gb. I was maybe thinking of creating a temp folder somewhere in the app data, then unzipping there and deleting the temp folder as a whole?
-
@Casmat Max size of a zip on Windows is 4GB (but I wouldn't go over 3). So you're going to be going the multiple zip route
-
@d-healey got you! So is this as simple as putting the zip through something like winzip and hise supporting multi file archives?
-
@Casmat The zip standard doesn't support multi-part archives like rar. You have to roll your own. Just add _part1, _part2, etc. to the end of the file name and extract them in a loop.
-
@d-healey ahh, I see! I have a question on the appdata folder, how do I do develop things that use the appdata folder in the development phase without compiling a vst? Is there a folder which replicates the appdata location?
-
-
@d-healey amazing, thanks David!