Files
MacAdmin/Software/Matlab/install_MatLab.sh
Zack T f741789e6e v1.4 = Updated to work for both 2017a and 2017b
+ 2017a and 2017b have different installation parameters, separated these out
 + Added some exit check logic
2018-01-26 23:22:28 -07:00

51 lines
1.5 KiB
Bash

#!/bin/sh
###################################################################################################
# Script Name: install_MatLab.sh
# By: Zack Thompson / Created: 3/6/2017
# Version: 1.4 / Updated: 1/25/2018 / By: ZT
#
# Description: This script installs MatLab.
#
###################################################################################################
/bin/echo "***** Install Matlab process: START *****"
##################################################
# Define Variables
# Set working directory
pkgDir=$(/usr/bin/dirname $0)
# Version that's being updated (this will be set by the build_Matlab.sh script)
version=
##################################################
# Bits staged...
# Install MatLab with option file.
/bin/echo "Installing Matlab..."
if [[ $version == "2017a" ]]; then
# -mode silent did not work in the option file for me.
exitStatus=$("${pkgDir}/install" -mode silent -inputFile "${pkgDir}/installer_input.txt")
else
# I'm assuming all future version will be packaged in this manner...(/hoping)..?
exitStatus=$("${pkgDir}/InstallForMacOSX.app/Contents/MacOS/InstallForMacOSX" -inputFile "${pkgDir}/installer_input.txt")
fi
exitCode=$?
if [[ $exitCode != 0 ]]; then
/bin/echo "Exit Code: ${exitCode}"
fi
if [[ $exitStatus == *"End - Unsuccessful"* ]]; then
/bin/echo "ERROR: Install failed!"
/bin/echo "ERROR Content: ${exitStatus}"
/bin/echo "***** Install Matlab process: FAILED *****"
exit 1
fi
/bin/echo "Install complete!"
/bin/echo "***** Install Matlab process: COMPLETE *****"
exit 0