HISE Logo Forum
    • Categories
    • Register
    • Login

    File.move to user library on a Mac - help!

    Scheduled Pinned Locked Moved Scripting
    20 Posts 6 Posters 833 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.
    • A
      aaronventure @tomekslesicki
      last edited by

      @tomekslesicki BackgroundTask.runProcess(var command, var args, var logFunction)

      the command is the string of a command, like "bash", and args are any args that would follow a terminal command.

      Inyour case

      const scriptStr = "myScript";
      
      BackgroundTask.runProcess("bash", ["-c", scriptStr], function(thread, isFinished, data)
      {
          // Function body
      });
      

      The function will execute every time the terminal would output something, as well as once more on isFinished == 1. Data is the the terminal output string.

      Be careful regarding escaping for new lines, paths etc. It'll take some trial and error.

      Try the docs example in an empty project and try with very simple stuff like making curl calls to a test API endpoint, or just calling help commands for an app, etc.

      T 1 Reply Last reply Reply Quote 0
      • T
        tomekslesicki @aaronventure
        last edited by

        @aaronventure Perfect, thanks so much!

        griffinboyG 1 Reply Last reply Reply Quote 0
        • griffinboyG
          griffinboy @tomekslesicki
          last edited by

          @tomekslesicki

          Congrats on launching the new installer system

          T 1 Reply Last reply Reply Quote 0
          • T
            tomekslesicki @griffinboy
            last edited by

            @griffinboy thank you!

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

              @tomekslesicki kind of unrelated, but I realized an issue with file permissions on macOS that I wasn't aware of and this also might be the reason for why the move operation fails with your users:

              usually you would expect that the user has read & write access to its user app data directory. However if you create the app data folder during your installation routine while having elevated admin privileges, it will inherit the user rights and treat it as a folder outside the user domain. This will lead to all subsequent read & write operations to that folder to fail which is super catastrophic as it will not store the link file, settings or license files.

              We ran into that issue a few days ago when beta testing an update and it turns out that our installer created these folders after copying the plugin files to the global plugin folder (which requires admin privileges, hence the entire script ran with elevated privileges).

              I could reproduce this very easily with a non-admin account, but other beta testers even experienced that issue with an admin account, which sounds super fishy...

              T 1 Reply Last reply Reply Quote 2
              • T
                tomekslesicki @Christoph Hart
                last edited by

                @Christoph-Hart from what I see, File.createDirectory() creates read-only folders, even if the parent folder is set to read & write. At least on Windows.

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

                  @tomekslesicki said in File.move to user library on a Mac - help!:

                  File.createDirectory() creates read-only folders

                  Not here. But you could always call this after

                  fb42dd7c-d60e-4945-a63e-0f25bf9826a1-image.png

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

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

                    @d-healey thank you, but this doesn't seem to work when I test it. Shoud it be (false, false) or (fase, true)?

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

                      @tomekslesicki Either, depends on if you want it to apply to all sub-folders.

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

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

                        @d-healey that's what I thought. The 2nd true will mean that subfolders are supposed to be affected, too, right?

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

                          @tomekslesicki Yes

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

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

                            @d-healey thank you!

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

                            15

                            Online

                            1.7k

                            Users

                            11.8k

                            Topics

                            103.0k

                            Posts