#!/bin/sh packagePath=$1 installDir=$2 volumeInstallDir=$3 appName=AkVirtualCamera targetDir=${volumeInstallDir}/${installDir}/${appName} # Remove old plugin rm -rf "/Library/CoreMediaIO/Plug-Ins/DAL/${appName}.plugin" resourcesDir=${targetDir}/${appName}.plugin/Contents/Resources # Reset permissions chmod a+x "${resourcesDir}/AkVCamAssistant" chmod a+x "${resourcesDir}/AkVCamManager" # Create a symlink to the plugin. ln -s "${targetDir}/${appName}.plugin" "/Library/CoreMediaIO/Plug-Ins/DAL/${appName}.plugin" # Set assistant daemon. service=org.webcamoid.cmio.AkVCam.Assistant daemonPlist=/Library/LaunchDaemons/${service}.plist cat << EOF > "${daemonPlist}" Label ${service} ProgramArguments ${resourcesDir}/AkVCamAssistant --timeout 300.0 MachServices ${service} StandardOutPath /tmp/AkVCamAssistant.log StandardErrorPath /tmp/AkVCamAssistant.log EOF # Load assistant daemon. launchctl enable "system/${service}" launchctl bootstrap system "${daemonPlist}"