Composer and Installing Apps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 09-28-2020 03:37 PM
I am using Composer and building a PKG.
The file system is /private/var/Mycompany/Apps/SweetApp.pkg
Then in my POSTINSTALL Script I have.
installer -pkg "$pathToPackage/SweetApp.pkg" -target /
But nothing installs. Do I need Sudo? Do I have to path out /usr/sbin/installer?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 09-28-2020 03:41 PM
try copying your pkg somwhere under /usr/local/YourCompanyApps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 09-28-2020 03:49 PM
Do I need this at the end or is this for an if statement to return if the install failed or not.
exit 0 ## Success
exit 1 ## Failure
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 09-29-2020 07:54 AM
yes, you should keep that at the end of your script in Composer. You can use logic within your script to determine an exit code for instance: after the installer runs, you can capture the exit code from the installation using $?. exitcode=$?
if [ $exitcode -ne 0 ]; then
{ exit 1 }
else
{ exit 0 }
or something like:
installstatus=$?
[ $installstatus ! -eq 0 ] && exit 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 09-29-2020 09:05 AM
I end my install commands with -allowUntrusted
/usr/sbin/installer -pkg "$pathToPackage/SweetApp.pkg" -tgt / -allowUntrusted
If that helps
