Skip to content

Instantly share code, notes, and snippets.

@rtrouton
Created March 17, 2016 19:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rtrouton/3189010e42b67e14ecf8 to your computer and use it in GitHub Desktop.
Save rtrouton/3189010e42b67e14ecf8 to your computer and use it in GitHub Desktop.
Postinstall script for installing DNAStar Lasergene 13.x and later
#!/bin/bash
# Determine working directory
install_dir=`dirname $0`
# Install DNAStar using InstallBuilder's unattended mode
$install_dir/"DNASTAR Lasergene Installer.app/Contents/MacOS/installbuilder.sh" --mode unattended
# When installing DNAStar with root privileges using InstallBuilder's unattended mode, it will install
# files and directories using the following permissions:
#
# Owner: system (aka root): read/write/execute permissions
#
# Group: staff: read/execute permissions
#
# Everyone: read/execute permissions
#
#
# This section fixes the permissions on the referenced files so that they're set to the following:
#
# Owner: system (aka root): read/write/execute permissions
#
# Group: admin: read/write/execute permissions
#
# Everyone: read/execute permissions
#
# Fixing /Applications/DNASTAR
/usr/bin/find "$3/Applications/DNASTAR" ! -group admin -exec chown root:admin {} \;
/usr/bin/find "$3/Applications/DNASTAR" ! -perm 775 -exec chmod 775 {} \;
# Fixing /Library/Application Support/DNASTAR
/usr/bin/find "$3/Library/Application Support/DNASTAR" ! -group admin -exec chown root:admin {} \;
/usr/bin/find "$3/Library/Application Support/DNASTAR" ! -perm 775 -exec chmod 775 {} \;
# Fixing DNAStar-installed fonts
# This section fixes the permissions on the referenced font files so that they're set to the following:
#
# Owner: system (aka root): read/write/execute permissions
#
# Group: wheel: read/execute permissions
#
# Everyone: read/execute permissions
#
/usr/bin/find "$3/Library/Fonts/protein chem &spaceBW" ! -group wheel -exec chown root:wheel {} \;
/usr/bin/find "$3/Library/Fonts/protein chem &spaceBW" ! -perm 755 -exec chmod 755 {} \;
/usr/bin/find "$3/Library/Fonts/ProtePla" ! -group wheel -exec chown root:wheel {} \;
/usr/bin/find "$3/Library/Fonts/ProtePla" ! -perm 755 -exec chmod 755 {} \;
/usr/bin/find "$3/Library/Fonts/ProteSpaBW" ! -group wheel -exec chown root:wheel {} \;
/usr/bin/find "$3/Library/Fonts/ProteSpaBW" ! -perm 755 -exec chmod 755 {} \;
# Read the the DNAStar install log into /var/log/install.log then delete
# the DNAStar install log from /Applications/DNASTAR
if [[ -e "$3/Applications/DNASTAR/Lasergene 13 Install.log" ]]; then
/bin/cat "$3/Applications/DNASTAR/Lasergene 13 Install.log"
/bin/rm "$3/Applications/DNASTAR/Lasergene 13 Install.log"
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment