Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support install package for running startosinstall #122

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions macOSUpgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,16 @@ else
cancelFVAuthReboot=0
fi

## Install package static path to install after the OS installation is complete.
## This variable is OPTIONAL
## Use Parameter 10 in the JSS.
installPackagePathWithInstallComplication="${10}"
if [ "$installerVersionMajor" -lt 13 ] && [ -n "$installPackagePathWithInstallComplication" ]; then
# Installer of macOS less than 10.13 is not support install package option.
installPackagePathWithInstallComplication=""
/bin/echo "Installer of macOS less than 10.13 is not support install package option."
fi

## Title of OS
macOSname=$(/bin/echo "$OSInstaller" | /usr/bin/sed -E 's/(.+)?Install(.+)\.app\/?/\2/' | /usr/bin/xargs)

Expand Down Expand Up @@ -451,6 +461,18 @@ fi
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# APPLICATION
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
## Check if set install package static path to install after the OS installation is complete
if [ -n "$installPackagePathWithInstallComplication" ];then
## Since the package may be installed as side effects of events such as download_trigger defined in this script, this variables are checked at this timing.
if [ ! -e "$installPackagePathWithInstallComplication" ]; then
/bin/echo "The package does not exist in $installPackagePathWithInstallComplication. Please check your script arguments."
cleanExit 1
fi
taniguti marked this conversation as resolved.
Show resolved Hide resolved

## This variable may have space. Therefore, escape value with duble quotation
startosinstallOptions+=("--installpackage \"$installPackagePathWithInstallComplication\"")
/bin/echo "Script is configured for install package $installPackagePathWithInstallComplication."
fi

## Launch jamfHelper
jamfHelperPID=""
Expand Down