HISE Logo Forum
    • Categories
    • Register
    • Login

    Installer permissions ...again

    Scheduled Pinned Locked Moved General Questions
    29 Posts 5 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.
    • d.healeyD
      d.healey @DanH
      last edited by

      @DanH said in Installer permissions ...again:

      Are there examples of other devs using an app to install the plugin files?

      I do it with Rhapsody, but I use the user library folder.

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

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

        @Lindon I don't think moving the files will be an issue. As for running the installer from within HISE I don't know, but presumably it will bring up the Packages installer process etc when run.

        DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
        https://dhplugins.com/ | https://dcbreaks.com/
        London, UK

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

          I think you guys are misunderstanding what Lindon is trying to do. He's trying to make an app that puts files in the Library folder. He's not using an installer program like Packages.

          @Lindon startAsProcess can launch an external program (and presumably a script). There is also a setExecutePermission function that might be helpful here.

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

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

            @DanH said in Installer permissions ...again:

            @Lindon I don't think moving the files will be an issue. As for running the installer from within HISE I don't know, but presumably it will bring up the Packages installer process etc when run.

            no, I dont mean to run Packages at all - I dont use PAckages any more...

            So

            1. Run the HISE-based installer, it writes the VST3 to the User folder structure
            2. run a shell script (from within the HISE installer) to copy the vst3 to the System folder...so I assume this is File.startAsProcess(String parameters);

            See that assumption right there? Often a bad thing...

            Now the plugin is in both places (best outcome).

            HISE Development for hire.
            www.channelrobot.com

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

              @Lindon oh right haha! Did seem a bit strange running packages at the end 😆

              I'm not sure you'd want the plugin in both locations. could confuse the user should they want to uninstall or update etc. That shell script deletes the original folder after copying.

              If the User/Library location works ok why not use that? do DAWs generally check both locations? I find most plugins install into the ~/Library though which seems the safer option.

              DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
              https://dhplugins.com/ | https://dcbreaks.com/
              London, UK

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

                @d-healey said in Installer permissions ...again:

                I think you guys are misunderstanding what Lindon is trying to do. He's trying to make an app that puts files in the Library folder. He's not using an installer program like Packages.

                @Lindon startAsProcess can launch an external program (and presumably a script). There is also a setExecutePermission function that might be helpful here.

                Thanks yeah - this is what Im trying to do. Not sure setExecutePermission does much more than allow the file to be executable - its not sudo -ing anything, or chmod -ing and Im worried that the shell script will just run into the same permissions problem I have already... I guess I can try it next time I'm on the mac.

                HISE Development for hire.
                www.channelrobot.com

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

                  This post is deleted!
                  1 Reply Last reply Reply Quote 0
                  • oskarshO
                    oskarsh @Lindon
                    last edited by

                    @Lindon Ah now I understand. That is possible.

                    To move from the home directory to the root directory you will need sudo rights. You can keep your HISE app without Root priviliges (best practice) and simply ask for the root password when its needed. Here is a simple shell script which opens a dialog to ask for the password then does a sudo action. In your case it should copy the folder.

                    #!/bin/bash
                    
                    # Prompt for password
                    PASSWORD=$(osascript -e 'Tell application "System Events" to display dialog "Please enter your password:" default answer "" with hidden answer' -e 'text returned of result' 2>/dev/null)
                    
                    if [ -z "$PASSWORD" ]; then
                        echo "User canceled or did not enter a password."
                        exit 1
                    fi
                    
                    # Use the captured password to execute a command as sudo
                    echo "$PASSWORD" | sudo -S echo "This is a placeholder for your command"
                    
                    # Replace the echo command above with the command you need to run as sudo
                    # For example:
                    # echo "$PASSWORD" | sudo -S your-command-here
                    
                    LindonL 1 Reply Last reply Reply Quote 1
                    • LindonL
                      Lindon @oskarsh
                      last edited by

                      @oskarsh said in Installer permissions ...again:

                      @Lindon Ah now I understand. That is possible.

                      To move from the home directory to the root directory you will need sudo rights. You can keep your HISE app without Root priviliges (best practice) and simply ask for the root password when its needed. Here is a simple shell script which opens a dialog to ask for the password then does a sudo action. In your case it should copy the folder.

                      #!/bin/bash
                      
                      # Prompt for password
                      PASSWORD=$(osascript -e 'Tell application "System Events" to display dialog "Please enter your password:" default answer "" with hidden answer' -e 'text returned of result' 2>/dev/null)
                      
                      if [ -z "$PASSWORD" ]; then
                          echo "User canceled or did not enter a password."
                          exit 1
                      fi
                      
                      # Use the captured password to execute a command as sudo
                      echo "$PASSWORD" | sudo -S echo "This is a placeholder for your command"
                      
                      # Replace the echo command above with the command you need to run as sudo
                      # For example:
                      # echo "$PASSWORD" | sudo -S your-command-here
                      

                      Thanks - I will give this a go....

                      HISE Development for hire.
                      www.channelrobot.com

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

                        @oskarsh well almost immedately bumping into my lack of MacOS knowledge... Im starting out with a simple copy command (cp)

                        cp /Users/lindonparker/Library/Audio/Plug-Ins/VST3/LoopBoss.vst3 /Library/Audio/Plug-Ins/VST3/LoopBoss.vst3

                        But the mac tells me this:

                        cp: /Users/lindonparker/Library/Audio/Plug-Ins/VST3/LoopBoss.vst3 is a directory (not copied).

                        HISE Development for hire.
                        www.channelrobot.com

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

                          @Lindon

                          ah.....

                          cp -r

                          HISE Development for hire.
                          www.channelrobot.com

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

                            @Lindon You should really use ChatGPT for this, I've stopped writing my own shell scripts a year ago. Do a simple sanity check and let the AI explain its code.

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

                              @oskarsh said in Installer permissions ...again:

                              You should really use ChatGPT for this,

                              Only if you understand the commands it produces. If it makes a mistake and you run a bad script it can cause all kinds of problems.

                              I was lazy with one script I was working on and didn't thoroughly read the output from GPT. I wanted to rename some files but I ended up prefixing every file in my home folder :p took me a while to put that right, fortunately it wasn't anything destructive.

                              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

                              49

                              Online

                              1.7k

                              Users

                              11.7k

                              Topics

                              101.8k

                              Posts