HISE Logo Forum
    • Categories
    • Register
    • Login

    Setting(flag) to not have the plugin start the sample install process when the link file is missing

    Scheduled Pinned Locked Moved General Questions
    47 Posts 5 Posters 2.4k 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.
    • DanHD
      DanH @virtuscapeaudio
      last edited by

      @virtuscapeaudio this script is for making the link file which I just said you don’t need to do πŸ˜‚.

      But you could just let users choose where to store the samples and use this script after all.

      Better you try and understand what the scripts doing and how it works - it’s not too tricky.

      Did you find any other scripts for packages on the forum?

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

      virtuscapeaudioV 1 Reply Last reply Reply Quote 0
      • virtuscapeaudioV
        virtuscapeaudio @DanH
        last edited by

        @DanH OOOohhhh... my mistake.. so If im understanding this correctly, the process goes:

        Packages project:

        1. place plug-in files and ch1 files

        2. Include a LinkOSX file and place it ... where exactly?

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

          @virtuscapeaudio have you made the plugin yet? Exported and tested in a DAW?

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

          virtuscapeaudioV 1 Reply Last reply Reply Quote 0
          • virtuscapeaudioV
            virtuscapeaudio @DanH
            last edited by

            @DanH yes we are quietly live ;)

            www.virtuscapeaudio.com

            I'm just trying to get this together before make a huge announcement, etc

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

              @virtuscapeaudio well you must know where the link file is that tells the plugin where the samples are? Right? πŸ˜† That's where you'll need to install the link file on other people's systems.

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

              virtuscapeaudioV 1 Reply Last reply Reply Quote 0
              • virtuscapeaudioV
                virtuscapeaudio @DanH
                last edited by

                @DanH not enough coffee apparently haha. Thanks so much for taking the time to help!

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

                  @virtuscapeaudio have a look through this thread, I think I got most of my script from here:

                  Link Preview Image
                  Mac Installer issue that effects (I think) all of us

                  @dustbro I'm having one serious issue with this approach and I wonder if you've encountered this as well. When I rsync the application folder like above, if ...

                  favicon

                  Forum (forum.hise.audio)

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

                  virtuscapeaudioV 1 Reply Last reply Reply Quote 0
                  • virtuscapeaudioV
                    virtuscapeaudio @DanH
                    last edited by virtuscapeaudio

                    @DanH here's where I'm at with this...I'm manually copying the Samples folder and testing on my system before packaging everything up

                    With HISE I set the Redirect Sample Folder to: /Libary/Application Support/Virtuscape Audio/Rhodecase88/Samples

                    When I open the either AU/VST3 version it creates a NEW LinkOSX file at ~/Library/Application Support/Virtuscape Audio/Rhodecase88 (perhaps this is from linking previous versions from testing where i indeed was using ~/Library

                    I'm struggling to see where I place a LinkOSX as Packages can only go to one location.

                    ...trying this approach as most plug-ins by default are in /Library and not ~/Library

                    OSMonterey 12.2.1

                    virtuscapeaudioV 1 Reply Last reply Reply Quote 0
                    • virtuscapeaudioV
                      virtuscapeaudio @virtuscapeaudio
                      last edited by

                      @virtuscapeaudio could I perhaps define a set location for the Samples that I place in /Library in packages?

                      //Set Default Sample Location
                      const defaultSampleLocation = "/Library/Application Support/Virtuscape Audio/Rhodecase88/Samples";

                      ?

                      virtuscapeaudioV 1 Reply Last reply Reply Quote 0
                      • virtuscapeaudioV
                        virtuscapeaudio @virtuscapeaudio
                        last edited by

                        @virtuscapeaudio I see this but nothing in the documentation about it...Any ideas?
                        @d-healey

                        Screen Shot 2023-11-13 at 4.02.11 PM.png

                        Would that be relevant to this situation at all?

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

                          @virtuscapeaudio I haven't seen setSampleFolder API before - have you tried it? Looks promising because then you just have one line of script in your onInit and you're done (I'm assuming it would create / amend the link file in the plugin's system folder).

                          Otherwise....

                          HISE plugins will always have their system folder in ~/Library/Application Support/DevName. Other devs do it in ~/Library too, and some use /Library - there's no right or wrong. (Perhaps @Christoph could introduce a flag so we can choose /Library because the ~/Library is a pain πŸ˜† ).

                          So when you open a HISE plugin for the first time in your DAW it will create a folder inside ~/Library/Application Support/DevName, and within that plugin folder it will then create a link file (if it's an instrument with a sampler inside), an Expansions folder, General Settings.xml and a User Presets Folder. The link file will probably be a generic path like User/Shared/Music/PluginName/Samples or something.

                          If you don't want to use the HISE sample installer system (which installs the samples at a User defined location and creates the link file in the plugin system folder) then you have to roll your own.

                          Currently the options for OSX are (afaik):

                          1. Create an App in HISE which can download, and install the samples anywhere the user likes, and write the link file (you could also get your plugin to do this when opened for the first time - but normally a poor user experience),

                          2. Write a .sh shell post install script for Packages which, after the samples have been installed, either creates a link file (for user defined) or copies a premade link file (pre-defined) into the Plugin's system folder. The two scripts are quite different.

                          For Pre-Defined you set the Packages payload to deliver the files (or just the pre-made LinkFile) to the /Library/Application Support/DevName/PluginName location - Basically you create the Plugin's system folder in the wrong library (because Packages cannot access ~/Library). The post install script then copies that folder to the correct ~/Library location, and then deletes the now defunct /Library folder you just installed. Now, this method is useful for including other data sets, like LFO presets, Arp presets, audio files etc, as well as pre-defined Link files, because before the User even opens the plugin, all the data is positioned in the plugin's system folder, ready to go (which is what you want with the samples).

                          For User-Defined the shell script will take the path / location that the User chose during the install process (obviously set up the Packages project to allow the User to change install location), and then use that path to create the Link file (and the Plugin's system folder if necessary) in the ~/Library location. The MAJOR caveat with this method (at least for me because I haven't come across a way to get around this) is that you will need to define a default location for the samples within the shell script, and that if the User defines a different location for the samples then that path (let's say they chose an external drive called Audio) will always begin with the default location. So, for example, the default location has to be somewhere on the User's main hard drive, so lets say User/Shared/Music/DevName/PluginName/Samples - now when you install the samples to the Audio drive, rather than just having the location as Audio/PluginName/Samples it's actually the full default path on top of Audio, so, Audio/User/Shared/Music/DevName/PluginName/Samples, which makes little sense. IF SOMEONE KNOWS HOW TO GET AROUND THIS PLEASE SHARE! πŸ˜†

                          So a Pre-Defined shell script will look something like this (where you set the payload with the link file and anything else to install in /Library then copy to ~/Library):

                          #!/bin/sh
                          
                          sudo -u $USER mkdir -p $HOME/Library/Application\ Support/DevName/PluginName/
                          
                          /usr/bin/rsync -avurpE --remove-source-files /Library/Application\ Support/DevName/PluginName/ $HOME/Library/Application\ Support/DevName/PluginName/
                          
                          sudo find $HOME/Library/Application\ Support/DevName/PluginName/ -type d -user root -exec sudo chown -R $USER: {} +
                          
                          rm -rf /Library/Application\ Support/DevName/PluginName
                          
                          exit 0
                          

                          (Note the \ character is used when there is a 'space' in the path name.)

                          A User-Defined shell script (which takes the location set during the install) looks more like this:

                          #!/bin/sh
                          
                          # Write sample location selected by user to LinkOSX for HISE
                          
                          # First, remove LinkOSX file if it's already there
                          instrumentname="PluginName"
                          devname="DevName"
                          
                          FILE="$HOME/Library/Application Support/${devname}/${instrumentname}/LinkOSX"
                          if test -n "$FILE"; then
                          rm -R "$HOME/Library/Application Support/${devname}/${instrumentname}/LinkOSX"
                          fi
                          
                          # Second, use the environment variable from WhiteBox Packages to write the destination to a file
                          destfile=/Users/${USER}/Library/Application\ Support/${devname}/${instrumentname}/LinkOSX
                          printf "${DSTROOT}/Users/Shared/DevName/PluginName/Samples" > "$destfile"
                          
                          exit 0
                          
                          

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

                          virtuscapeaudioV 1 Reply Last reply Reply Quote 1
                          • virtuscapeaudioV
                            virtuscapeaudio @DanH
                            last edited by

                            @DanH Thank you, Dan!!!! I have a "great success!!" (-Borat voice) on my hands thanks to you!

                            I had some initial trouble, but ChatGPT helped me correct it.

                            I'm posting here incase it's useful to anyone at allScreen Shot 2023-11-14 at 10.36.57 AM.png
                            Screen Shot 2023-11-14 at 10.37.11 AM.png

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

                            26

                            Online

                            1.7k

                            Users

                            11.7k

                            Topics

                            102.0k

                            Posts