-
Notifications
You must be signed in to change notification settings - Fork 103
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
Add the support for package installation #110
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,6 +109,10 @@ fi | |
userDialog="$9" | ||
if [[ ${userDialog:=0} != 1 ]]; then userDialog=0 ; fi | ||
|
||
##Specify path to postinstallation package. Use Parameter 10 in the JSS | ||
##Example: /Users/Shared/postinstall.pkg | ||
installPkg="${10}" | ||
|
||
##Title of OS | ||
##Example: macOS High Sierra | ||
macOSname=$(/bin/echo "$OSInstaller" | /usr/bin/sed 's/^\/Applications\/Install \(.*\)\.app$/\1/') | ||
|
@@ -120,8 +124,8 @@ title="$macOSname Upgrade" | |
heading="Please wait as we prepare your computer for $macOSname..." | ||
|
||
##Title to be used for userDialog | ||
description="This process will take approximately 5-10 minutes. | ||
Once completed your computer will reboot and begin the upgrade." | ||
description="Your computer will reboot in 5-10 minutes and begin the upgrade. | ||
This process will take approximately 30-40 minutes." | ||
|
||
##Description to be used prior to downloading the OS installer | ||
dldescription="We need to download $macOSname to your computer, this will \ | ||
|
@@ -261,7 +265,7 @@ fi | |
# CREATE FIRST BOOT SCRIPT | ||
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # | ||
|
||
/bin/mkdir -p /usr/local/jamfps | ||
/bin/mkdir /usr/local/jamfps | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If there is already this directory, It would be got an error. |
||
|
||
/bin/echo "#!/bin/bash | ||
## First Run Script to remove the installer. | ||
|
@@ -374,12 +378,16 @@ if [[ ${pwrStatus} == "OK" ]] && [[ ${spaceStatus} == "OK" ]]; then | |
eraseopt='--eraseinstall' | ||
/bin/echo " Script is configured for Erase and Install of macOS." | ||
fi | ||
##Check if installPackage is Enabled | ||
if [ ! -z "${installPkg}" ]; then | ||
pkgopt="--installpackage ${installPkg}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is something I would like to discuss with you. I would say @ecanault's work has partially good points. Steps (draft)
This is because it is difficult to put pkg on the local device beforehand. Cons There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Summary) It is of course possible to use macOSUpgrade.sh alone, but I understand that it is assumed to be used with JamfPro. Considering putting the pkg file in the path pointed to by "$ pkgotp", it seems more straightforward to do with JamfPro's Policy processing than processing in macOSUpgrade.sh. In other words, check the version of os etc. If there is no element added by the pkg file, pkg will be sent and installed. Even through, when adding "pkgopt" to macOSUpgrade.sh, there should be confirmation of the existence of the pkg file expected by this switch. There should also be verification of the package itself, if it might not be signed or the file has been corrupted. The implicit premise and expectation that management will definitely put the pkg file in its place as expected brings the possibility of interfering with stable operation. Thank you for your suggestions. @ecanault There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I have the same opinion as you. However, when the device does not have DEP, the |
||
/bin/echo " Script is configured for installing extra package." | ||
fi | ||
|
||
osinstallLogfile="/var/log/startosinstall.log" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. keep $osinstallLogfile |
||
if [ "$versionMajor" -ge 14 ]; then | ||
eval /usr/bin/nohup "\"$OSInstaller/Contents/Resources/startosinstall\"" "$eraseopt" --agreetolicense --nointeraction --pidtosignal "$jamfHelperPID" >> "$osinstallLogfile" & | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use |
||
"$OSInstaller/Contents/Resources/startosinstall" $pkgopt $eraseopt --agreetolicense --nointeraction --pidtosignal "$jamfHelperPID" & | ||
else | ||
eval /usr/bin/nohup "\"$OSInstaller/Contents/Resources/startosinstall\"" "$eraseopt" --applicationpath "\"$OSInstaller\"" --agreetolicense --nointeraction --pidtosignal "$jamfHelperPID" >> "$osinstallLogfile" & | ||
"$OSInstaller/Contents/Resources/startosinstall" $pkgopt $eraseopt --applicationpath "$OSInstaller" --agreetolicense --nointeraction --pidtosignal "$jamfHelperPID" & | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
fi | ||
/bin/sleep 3 | ||
else | ||
|
@@ -390,7 +398,6 @@ else | |
|
||
/bin/echo "Launching jamfHelper Dialog (Requirements Not Met)..." | ||
/Library/Application\ Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper -windowType utility -title "$title" -icon "$icon" -heading "Requirements Not Met" -description "We were unable to prepare your computer for $macOSname. Please ensure you are connected to power and that you have at least 15GB of Free Space. | ||
|
||
If you continue to experience this issue, please contact the IT Support Center." -iconSize 100 -button1 "OK" -defaultButton 1 | ||
|
||
fi | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM to description strings changes.