mirror of
https://github.com/MLBZ521/MacAdmin.git
synced 2026-03-20 16:00:25 +00:00
v1.4.0 = Added the installation of the Wolfram Script.pkg
+ Added support to nest and install the Wolfram Script.pkg inside a payloadless package for deploying Mathematica
This commit is contained in:
@@ -3,28 +3,66 @@
|
||||
###################################################################################################
|
||||
# Script Name: install_Mathematica.sh
|
||||
# By: Zack Thompson / Created: 1/10/2018
|
||||
# Version: 1.2 / Updated: 1/31/2018 / By: ZT
|
||||
# Version: 1.4.0 / Updated: 9/20/2019 / By: ZT
|
||||
#
|
||||
# Description: This script silently installs Mathematica.
|
||||
#
|
||||
###################################################################################################
|
||||
|
||||
/bin/echo "***** Install Mathematica process: START *****"
|
||||
echo "***** Install Mathematica process: START *****"
|
||||
|
||||
##################################################
|
||||
# Define Variables
|
||||
|
||||
# Set working directory
|
||||
pkgDir=$(/usr/bin/dirname $0)
|
||||
pkgDir=$(/usr/bin/dirname "${0}")
|
||||
|
||||
##################################################
|
||||
# Define Functions
|
||||
|
||||
exitCheck() {
|
||||
if [[ $1 != 0 ]]; then
|
||||
echo "Failed to install: ${2}"
|
||||
echo "Exit Code: ${1}"
|
||||
echo "***** Install Mathematica process: FAILED *****"
|
||||
exit 1
|
||||
else
|
||||
echo "${2} has been installed!"
|
||||
fi
|
||||
}
|
||||
|
||||
##################################################
|
||||
# Bits staged...
|
||||
|
||||
# Install Mathematica
|
||||
/bin/echo "Installing Mathematica..."
|
||||
/bin/mv "${pkgDir}/Mathematica.app" /Applications
|
||||
/bin/echo "Install complete!"
|
||||
# Check if Mathematic is already installed.
|
||||
if [[ -e "/Applications/Mathematica.app" ]]; then
|
||||
echo "Mathematica is currently installed, removing..."
|
||||
/bin/rm -rf "/Applications/Mathematica.app"
|
||||
fi
|
||||
|
||||
/bin/echo "***** Install Mathematica process: COMPLETE *****"
|
||||
echo "Installing Mathematica.app..."
|
||||
|
||||
# Install Mathematica
|
||||
/bin/mv "${pkgDir}/Mathematica.app" /Applications
|
||||
exitCode1=$?
|
||||
|
||||
# Function exitCheck
|
||||
exitCheck $exitCode1 "Mathematica.app"
|
||||
|
||||
# Get all of the pkgs.
|
||||
packages=$( /bin/ls "${pkgDir}/" | /usr/bin/grep .pkg )
|
||||
|
||||
# Loop through each .pkg in the directory...
|
||||
while IFS=.pkg read pkg; do
|
||||
echo "Installing ${pkg}..."
|
||||
/usr/sbin/installer -dumplog -verbose -pkg "${pkgDir}/${pkg}" -allowUntrusted -target /
|
||||
exitCode2=$?
|
||||
|
||||
# Function exitCheck
|
||||
exitCheck $exitCode2 "${pkg}"
|
||||
|
||||
done < <(echo "${packages}")
|
||||
|
||||
echo "***** Install Mathematica process: COMPLETE *****"
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user