HISE Logo Forum
    • Categories
    • Register
    • Login

    HISE Unzipping

    Scheduled Pinned Locked Moved Scripting
    26 Posts 3 Posters 1.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • CasmatC
      Casmat @Christoph Hart
      last edited by Casmat

      @Christoph-Hart im confused, which brackets? 😖

      like this?

      FileSystem.browse(FileSystem.Downloads, false, "*", function(result)
      {
      	result.extractZipFile(FileSystem.getFolder(FileSystem.Desktop), true, function(obj)
      	{
      		if(obj.Status == 1)
      		{
      			reg name = obj.CurrentFile;
      			FileSystem.getFolder(FileSystem.Desktop).getChildFile(name).deleteFileOrDirectory();
      		}
      	});
      });
      

      ^ doesnt work...

      i make music

      1 Reply Last reply Reply Quote 0
      • CasmatC
        Casmat @Christoph Hart
        last edited by

        @Christoph-Hart this would suffice, right?

        FileSystem.browse(FileSystem.Downloads, false, "*", function(result)
        {
        	result.extractZipFile(FileSystem.getFolder(FileSystem.Desktop), true, function(obj)
        	{
        		if(obj.Status == 1)
        		{
        			reg name = obj.CurrentFile;
        		}
        		if(!obj.Status == undefined)
        		{
        			FileSystem.getFolder(FileSystem.Desktop).getChildFile(name).deleteFileOrDirectory();
        		}
        	});
        });
        

        i make music

        Christoph HartC 1 Reply Last reply Reply Quote 0
        • Christoph HartC
          Christoph Hart @Casmat
          last edited by Christoph Hart

          @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.

          CasmatC 2 Replies Last reply Reply Quote 2
          • CasmatC
            Casmat @Christoph Hart
            last edited by

            @Christoph-Hart oooh! That's why you're Christoph Hart and i'm not!

            i make music

            Christoph HartC 1 Reply Last reply Reply Quote 0
            • Christoph HartC
              Christoph Hart @Casmat
              last edited by

              @Casmat oh and check my edit, I made a mistake.

              CasmatC 1 Reply Last reply Reply Quote 0
              • CasmatC
                Casmat @Christoph Hart
                last edited by

                @Christoph-Hart got it! Thanks for checking up!:grinning_face_with_smiling_eyes:

                i make music

                1 Reply Last reply Reply Quote 0
                • CasmatC
                  Casmat @Christoph Hart
                  last edited by

                  @Christoph-Hart Oh wait... that deletes the original zip file, I'm trying to delete the extracted file inside the zip...

                  i make music

                  Christoph HartC 1 Reply Last reply Reply Quote 0
                  • Christoph HartC
                    Christoph Hart @Casmat
                    last edited by

                    @Casmat lol why? sounds like a software version of this:

                    funny.gif

                    CasmatC 1 Reply Last reply Reply Quote 3
                    • CasmatC
                      Casmat @Christoph Hart
                      last edited by

                      @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!

                      i make music

                      d.healeyD 1 Reply Last reply Reply Quote 0
                      • d.healeyD
                        d.healey @Casmat
                        last edited by d.healey

                        @Casmat An hr file is already a compressed archive, there is no reason to zip a zip file.

                        Send the user multiple zip files

                        Libre Wave - Freedom respecting instruments and effects
                        My Patreon - HISE tutorials
                        YouTube Channel - Public HISE tutorials

                        CasmatC 1 Reply Last reply Reply Quote 0
                        • CasmatC
                          Casmat @d.healey
                          last edited by Casmat

                          @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

                          i make music

                          d.healeyD 1 Reply Last reply Reply Quote 0
                          • d.healeyD
                            d.healey @Casmat
                            last edited by

                            @Casmat How big will your zip files be?

                            Libre Wave - Freedom respecting instruments and effects
                            My Patreon - HISE tutorials
                            YouTube Channel - Public HISE tutorials

                            CasmatC 1 Reply Last reply Reply Quote 0
                            • CasmatC
                              Casmat @d.healey
                              last edited by Casmat

                              @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?

                              i make music

                              d.healeyD 1 Reply Last reply Reply Quote 0
                              • d.healeyD
                                d.healey @Casmat
                                last edited by

                                @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

                                Libre Wave - Freedom respecting instruments and effects
                                My Patreon - HISE tutorials
                                YouTube Channel - Public HISE tutorials

                                CasmatC 1 Reply Last reply Reply Quote 0
                                • CasmatC
                                  Casmat @d.healey
                                  last edited by

                                  @d-healey got you! So is this as simple as putting the zip through something like winzip and hise supporting multi file archives?

                                  i make music

                                  d.healeyD 1 Reply Last reply Reply Quote 0
                                  • d.healeyD
                                    d.healey @Casmat
                                    last edited by

                                    @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.

                                    Libre Wave - Freedom respecting instruments and effects
                                    My Patreon - HISE tutorials
                                    YouTube Channel - Public HISE tutorials

                                    CasmatC 1 Reply Last reply Reply Quote 0
                                    • CasmatC
                                      Casmat @d.healey
                                      last edited by

                                      @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?

                                      i make music

                                      d.healeyD 1 Reply Last reply Reply Quote 0
                                      • d.healeyD
                                        d.healey @Casmat
                                        last edited by

                                        @Casmat

                                        d92962b0-488f-460e-a59d-742541d3f1e7-image.png

                                        Libre Wave - Freedom respecting instruments and effects
                                        My Patreon - HISE tutorials
                                        YouTube Channel - Public HISE tutorials

                                        CasmatC 1 Reply Last reply Reply Quote 0
                                        • CasmatC
                                          Casmat @d.healey
                                          last edited by

                                          @d-healey amazing, thanks David!

                                          i make music

                                          1 Reply Last reply Reply Quote 0
                                          • First post
                                            Last post

                                          36

                                          Online

                                          1.8k

                                          Users

                                          12.1k

                                          Topics

                                          105.0k

                                          Posts