How to Install to Specific Folder Mac

Bruno Del Sol bruno.delsol at bydesign.fr
Sun Aug 29 18:50:56 UTC 2021


Hi Das,

I use Packages default options to create a regular  installer as myapp.pkg. It handles 2 components :

- the file myapp.app goes into /Applications. In my case it is a straight Omnis.app totally unmodified, in your case I 
believe you have a signed one.

- the folder /Omnis/myapp goes into /Library/Application Support. It is the folder Omnis iinstalls into 
/Users/me/Library/Application Support in which I add the libs and others files needed by myapp


Then, in Packages I add a post-installation script that I pasted below. Basically this script just copies 
/Library/Application Support/Omnis/myapp into /Users/me/Library/Application Suppor/Omnis/myapp where it is needed. I 
didn't come with this idea, it is Alex Clay that posted a different version of this script a while ago on Github.

regards
Bruno

postinstall.sh
-----------------

#!/usr/bin/env bash
# This script is run after your app is installed.
APP_NAME="MyApp" # Customize with your app name

systemlibpath="/Library/Application Support/Omnis/MyApp"
apppath="/Applications/${APP_NAME}.app"
libpath="${HOME}/Library/Application Support/Omnis"
applibpath="${libpath}/${APP_NAME}"

# disable appnap on myapp to avoid mysql connection aborts
defaults write -app "${apppath}" NSAppSleepDisabled -bool YES

# Remove existing app support folder
if [ -d "${applibpath}" ]; then
     rm -r "${applibpath}"
fi

# Pre-create new app support folder
if [ ! -d "${libpath}" ]; then
     mkdir -p "${libpath}"
fi

cp -r "${systemlibpath}" "${libpath}"
sudo chown -R "${USER}" "${applibpath}"




By Design
http://www.bydesign.fr
Bruno Del Sol
bruno.delsol at bydesign.fr
46, rue de La Tour d'Auvergne
75009 Paris (France)

Le 29/08/2021 à 20:01, Das Goravani a écrit :
> Up til now I’ve never done a library update on the Mac
>
> I use First run install and do a whole installation of the Omnis folder inside App Support
>
> I use drop DMG and I put a library into drop on Applications
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com


More information about the omnisdev-en mailing list