HISE Logo Forum
    • Categories
    • Register
    • Login

    [bug] Encrypted expansions magically turning into file based

    Scheduled Pinned Locked Moved Bug Reports
    expansionencryptedfile based
    16 Posts 2 Posters 630 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.
    • d.healeyD
      d.healey @Christoph Hart
      last edited by

      @Christoph-Hart https://github.com/davidhealey/HiseDownloadManagerToolkit/blob/master/Expansions.js#L372

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

      Christoph HartC 1 Reply Last reply Reply Quote 0
      • Christoph HartC
        Christoph Hart @d.healey
        last edited by

        @d-healey Ah OK, so inside Expansion.unloadExpansion() would be the most reasonable place to set this flag, right?

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

          @Christoph-Hart Sounds reasonable to me

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

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

            Is there ever a reason to create the expansion xml automatically in the destructor?

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

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

              Ok I added the flag and it works! But I realised there is another scenario we haven't considered.

              What about when the user has HISE running and then goes into their OS file browser and deletes the expansion files. The xml will still be recreated by the destructor.

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

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

                @Christoph-Hart Any suggestions?

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

                Christoph HartC 1 Reply Last reply Reply Quote 0
                • Christoph HartC
                  Christoph Hart @d.healey
                  last edited by

                  I think it should be safe to assume that if the directory doesn't exist, it shouldn't write that data to the file so this would handle this case too.

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

                    @Christoph-Hart The problem is that if the directory does exist but the content is removed (as in my video) the files are recreated.

                    We need to make sure the files are never recreated by the compiled project I think, unless you know a reason why they should be.

                    I guess it would also be good to also not create the files if the directory exists but is empty, that would prevent it happening when running in HISE.

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

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

                      I think I've found a suitable solution, can you see any issues with it?

                      ~Expansion()
                      {
                          if (root.isDirectory() && root.getNumberOfChildFiles(File::TypesOfFileToFind::findFiles, "expansion_info.xml") > 0)
                              saveExpansionInfoFile();
                      }
                      

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

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

                        @Christoph-Hart This solution good for a pull request?

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

                        Christoph HartC 1 Reply Last reply Reply Quote 0
                        • Christoph HartC
                          Christoph Hart @d.healey
                          last edited by

                          Instead of

                          root.getNumberOfChildFiles(File::TypesOfFileToFind::findFiles, "expansion_info.xml") > 0
                          

                          you can just write

                          root.getChildFile("expansion_info.xml").existsAsFile()
                          

                          this will prevent iterating over the entire directory with the same outcome.

                          d.healeyD 1 Reply Last reply Reply Quote 1
                          • d.healeyD
                            d.healey @Christoph Hart
                            last edited by

                            @Christoph-Hart Ah nice, ok. I'll make that change and create a pull request. Thanks for your help!

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

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

                            18

                            Online

                            1.7k

                            Users

                            11.8k

                            Topics

                            102.6k

                            Posts