HISE Logo Forum
    • Categories
    • Register
    • Login

    extractZipFile problem

    Scheduled Pinned Locked Moved General Questions
    81 Posts 5 Posters 4.0k 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.
    • LindonL
      Lindon @Matt_SF
      last edited by

      @Matt_SF -hmm yeah it looks like even yours ISNT creating temp.VST3

      @Christoph-Hart - I think the problem here is about access permissions, to create(or remove) anything in

      C://Program Files/Common Files/VST3

      requires administrator permission - and this is usually the state of affairs in all "normal" windows environments, I think here that the calls are being unsuccessful because they dont have this level of permission, so we need:

      1. the existing calls to provide some level of feedback about the error that is occurring, and not to behave as if all is well in subsequent calls...

      2. Some way of setting the user to Administrator for these calls...

      Otherwise I have no way of writing anything to this folder...and my installer really needs to do this..

      Of course I could be totally wrong, not -as we all know- such an unusual situation...

      HISE Development for hire.
      www.channelrobot.com

      Matt_SFM 1 Reply Last reply Reply Quote 0
      • Matt_SFM
        Matt_SF @Lindon
        last edited by Matt_SF

        @Lindon aaah I just remebered... for the test example you posted, I've scratched my head on this before. Actually the file isn't created unless you write something in it :

        var tempVSTFolder = FileSystem.fromAbsolutePath("/Library/Audio/Plug-Ins/VST3");		
        Console.print("temp VST is a real DIR?:" + tempVSTFolder.isDirectory());
        Console.print(".........is VST Folder writable?:" + tempVSTFolder.hasWriteAccess());
        		
        var tempCompanyVSTFolder = tempVSTFolder.createDirectory("TEMPTESTCo");
        Console.print("temp **COMPANY** VST is a real DIR?:" + tempCompanyVSTFolder.isDirectory());
        Console.print("is Co Folder writable?:" + tempCompanyVSTFolder.hasWriteAccess());
        
        var tempVSTFile = tempCompanyVSTFolder.getChildFile("temp.VST3");
        tempVSTFile.writeString("Write something in the file to create it");
        
        Console.print("...does the file exist?:" + tempVSTFile.isFile());
        
        Interface: temp VST is a real DIR?:1
        Interface: .........is VST Folder writable?:1
        Interface: temp **COMPANY** VST is a real DIR?:1
        Interface: is Co Folder writable?:1
        Interface: ...does the file exist?:1
        

        But that doesn't explain why unzipping a file doesn't work on your machine...

        Would this be a workaround for your issue ? Maybe create the folder, write a dummy txt file so the folder is actually created, then write the file you need in that folder ?

        Develop branch
        Win10 & VS17 / Ventura & Xcode 14. 3

        LindonL 1 Reply Last reply Reply Quote 0
        • LindonL
          Lindon @Matt_SF
          last edited by Lindon

          @Matt_SF - nope no change there...

          var tempVSTFolder = FileSystem.fromAbsolutePath("C:/Program Files/Common Files/VST3");		
          Console.print("temp VST is a real DIR?:" + tempVSTFolder.isDirectory());
          Console.print(".........is VST Folder writable?:" + tempVSTFolder.hasWriteAccess());
          
          
          var tempCompanyVSTFolder = tempVSTFolder.createDirectory("TEMPTESTCo");
          Console.print("temp **COMPANY** VST is a real DIR?:" + tempCompanyVSTFolder.isDirectory());
          Console.print("is Co Folder writable?:" + tempCompanyVSTFolder.hasWriteAccess());
          var tempVSTFile = tempCompanyVSTFolder.getChildFile("temp.txt");
          tempVSTFile.writeString("temp value here");
          
          Console.print("...does the file exist?:" + tempVSTFile.isFile());
          Console.print("is writable?:" + tempVSTFile.hasWriteAccess());
          

          still no file and no folder...

          HISE Development for hire.
          www.channelrobot.com

          Matt_SFM 1 Reply Last reply Reply Quote 0
          • Matt_SFM
            Matt_SF @Lindon
            last edited by

            @Lindon damn...
            What's weird is that, if you need admin rights to execute these kind of functions - even in HISE - you should be prompted to grant access to the system folders or not...

            Develop branch
            Win10 & VS17 / Ventura & Xcode 14. 3

            LindonL 1 Reply Last reply Reply Quote 0
            • LindonL
              Lindon @Matt_SF
              last edited by

              @Matt_SF said in extractZipFile problem:

              @Lindon damn...
              What's weird is that, if you need admin rights to execute these kind of functions - even in HISE - you should be prompted to grant access to the system folders or not...

              yeah, something's not right....

              HISE Development for hire.
              www.channelrobot.com

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

                What happens if you start HISE as administrator (via right click)?

                There‘s not much you can do here on my side - either you have the permission or not.

                LindonL 2 Replies Last reply Reply Quote 0
                • LindonL
                  Lindon @Christoph Hart
                  last edited by

                  @Christoph-Hart - yeah that works - I guess the end-user will have to run the installer as admin..

                  Thanks.

                  HISE Development for hire.
                  www.channelrobot.com

                  1 Reply Last reply Reply Quote 0
                  • LindonL
                    Lindon @Christoph Hart
                    last edited by Lindon

                    @Christoph-Hart said in extractZipFile problem:

                    What happens if you start HISE as administrator (via right click)?

                    There‘s not much you can do here on my side - either you have the permission or not.

                    -- tell me how does this not trip up inno then? (Because I don't think it has permission..)

                    Unless of course inno tells the os(Windows) that it intends to change something and requires admin access, at which point(before the UI appears) Windows pops its "Will you allow this app to do its thing?" dialog. If so, and I think this is the case, what do we need in HISE to enable this windows call on execution?

                    HISE Development for hire.
                    www.channelrobot.com

                    LindonL d.healeyD 2 Replies Last reply Reply Quote 0
                    • LindonL
                      Lindon @Lindon
                      last edited by

                      Or can I just set the "Run as Administrator" Flag in the compiled apps properties , and this would make my downloaded app run as administrator every time?

                      It should be clear I have no idea about this , anyone have any experience?

                      HISE Development for hire.
                      www.channelrobot.com

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

                        @Lindon An Inno installer will prompt for permission I think

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

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

                          @d-healey said in extractZipFile problem:

                          @Lindon An Inno installer will prompt for permission I think

                          yeah -- and I think I might know how to make my app ask for permissions too.... just testing with a 3rd party now....

                          HISE Development for hire.
                          www.channelrobot.com

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

                            @Lindon Excellent, let us know your results. I need this feature too, in fact I've already implemented it but I didn't test it on Windows and MacOS yet, I might try this afternoon if I have some time.

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

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

                              @d-healey sadly the simple "set in my window for all users" - doesnt work...we need a mechanism to define our app to open in admin mode...

                              HISE Development for hire.
                              www.channelrobot.com

                              LindonL 1 Reply Last reply Reply Quote 0
                              • LindonL
                                Lindon @Lindon
                                last edited by

                                looks like it could be a setting in the manifest file in the Linker...

                                Link Preview Image
                                C++: Run program as administrator

                                Some programs are automatically asking for administrator rights when you run them. These programs are marked with a little shield in the bottom right corner: Now I'm wondering how I could accompl...

                                favicon

                                Stack Overflow (stackoverflow.com)

                                HISE Development for hire.
                                www.channelrobot.com

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

                                  @Lindon Working on a test project now, I'll report my results.

                                  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

                                    Something I just saw in the docs which might be of interest but isn't a solution to the problem:

                                    This method will extract a standard ZIP file (without password protection) to the given target directory (which can be either a file path String or a File object).

                                    So you don't need to use FileSystem.fromAbsolutePath(), you can just pass in the string.

                                    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

                                      I can confirm the issue on my system, can't extract to anywhere on the C drive. I'll keep investigating.

                                      I've made a simple little test application for anyone who wants to play around with this. A test zip file is included in the project folder.

                                      zipExtractor.zip

                                      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

                                        @Lindon Yep you're correct. Add /MANIFESTUAC:level='requireAdministrator' to the linker flags section in Projucer and when your app starts you'll be prompted to give permission. Not sure how this will affect plugins, I'm going to test it now.

                                        9089f61b-033c-4551-8c54-051428091fe1-image.png

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

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

                                          @d-healey yeah I did this the other way(via VisualStudio)

                                          213cda59-82bc-4a50-9512-3dbc05d1b2e9-image.png

                                          and this seems to work too...

                                          HISE Development for hire.
                                          www.channelrobot.com

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

                                            @Lindon I tested in a plugin and it doesn't work. I assume that the plugin takes on the same privilege level as the host.

                                            I'm going to test on MacOS now.

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

                                            LindonL 2 Replies Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            55

                                            Online

                                            1.7k

                                            Users

                                            11.7k

                                            Topics

                                            101.8k

                                            Posts