10.8.5 and plugin installers - also High Sierra


#1

Hi guys,
every now and then I receive a support request because our plugins cannot load the license file and it ALWAYS happen on 10.8.5 and caused by inability to correctly write in “Music\Audio Music Apps”. The process (working fine on every other OSX version) is to create a folder (if doesn’t exists) when the plugin is run.

Anybody experienced the same issue?

Thanks!


#2

Maybe the folder has root permission only, there are installers from a certain plugin company which have falsely created the folder with root ownership only.


#3

We had some reports like that. but it’s not always 10.8.5 on our cases.
your best workflow is like this (copying from our plug-in latest code with no issues for a pretty big number of actual users):

This happens within our plug-in:

    const File licenseDir (<ManufactuerPath>);
    if (! licenseDir.exists())
    {
        if (licenseDir.createDirectory() != Result::ok())
        {
            errorLabel_.setText ("Failed to create license folder.", dontSendNotification);
            return;
        }
    }

    auto licenseFile = licenseDir.getChildFile ("license.bin");
    if (licenseFile.exists())
    {
        if (!licenseFile.deleteFile())
        {
            errorLabel_.setText ("Failed deleting old license file.", dontSendNotification);
            return;
        }
    }

    auto outputStream = ScopedPointer<FileOutputStream> (licenseFile.createOutputStream());
    if (outputStream == nullptr || outputStream->failedToOpen()) {
        errorLabel_.setText ("Failed to open license file for writing.", dontSendNotification);
        return;
    }
    outputStream->write (authFilePayload_.getData(), authFilePayload_.getSize());

This happens during the preinstall installer script:

# Fix permissions for "Audio Music Apps" folder -
# Some program[s] ruin the permissions for that folder.
for userdir in /Users/*; do
MUSIC_FOLDER="$userdir/Music"
if [ -e "$MUSIC_FOLDER" ]; then
    chmod 777 "$MUSIC_FOLDER"
    AUDIO_APPS_FOLDER="$MUSIC_FOLDER/Audio Music Apps"
    if [ -e "$AUDIO_APPS_FOLDER" ]; then
        chmod 777 "$AUDIO_APPS_FOLDER"
        OUR_FOLDER="$AUDIO_APPS_FOLDER/<ManufactuerPath>"
        if [ -e "$SR_FOLDER" ]; then
            chmod -R 777 "$OUR_FOLDER"
        fi
    fi
fi
done

#4

Wouldn’t it be better to fix the wrong ownership instead of give others read and write rights?


#5

Thank you, guys. What I do in mine is the following

#!/bin/sh

#create Audio Music Apps
mkdir -p /Users/$USER/Music/Audio\ Music\ Apps/Manufacturer/Licenses
mkdir -p /Users/$USER/Music/Audio\ Music\ Apps/Manufacturer/Settings
mkdir -p /Users/$USER/Music/Audio\ Music\ Apps/Manufacturer/Presets/PluginName

rsync -a /usr/local/tmpManu/ /Users/$USER/Music/Audio\ Music\ Apps/Manufacturer/Presets/PluginName/

rm -rf /usr/local/tmpAud

chown -R $USER /Users/$USER/Music/Audio\ Music\ Apps/

exit 0

It already changes the ownership to the current user and works for anywhere but 10.8.5


#6

@zioaxiom, I see you’re not doing any permission changes? only ownership?
Maybe worth changing permission?

@chkn , you might be correct. I don’t think it should hurt but the correct way might be changing ownership to the actual user…


#7

A sudden update from a customer who installed High Sierra. Looks like the “Audio Music Apps” folder is not being created, but an alias is created instead. That’s utterly new to me.