mirror of
https://github.com/mtan93/Installomator.git
synced 2026-03-27 21:04:02 +00:00
v0.5
updateTool now working. Improved log for this, as well as creating a finishing function so that we can call this when updateTool was used.
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
- If your MDM cannot call a script with parameters, the label can be set in the top of the script.
|
- If your MDM cannot call a script with parameters, the label can be set in the top of the script.
|
||||||
- If your MDM is not Jamf Pro, and you need the script to be installed locally on your managed machines, then take a look at [Theiles fork](https://github.com/Theile/Installomator/). This fork can be called from the MDM using a small script.
|
- If your MDM is not Jamf Pro, and you need the script to be installed locally on your managed machines, then take a look at [Theiles fork](https://github.com/Theile/Installomator/). This fork can be called from the MDM using a small script.
|
||||||
- Script `buildCaseStatement.sh` to help with creating labels have been improved.
|
- Script `buildCaseStatement.sh` to help with creating labels have been improved.
|
||||||
|
- Fixed a bug in a variable name that prevented updateTool to be used
|
||||||
|
|
||||||
|
|
||||||
## v0.4 - 2020-10-19
|
## v0.4 - 2020-10-19
|
||||||
|
|||||||
@@ -693,6 +693,7 @@ installAppInDmgInZip() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
runUpdateTool() {
|
runUpdateTool() {
|
||||||
|
printlog "Function called: runUpdateTool"
|
||||||
if [[ -x $updateTool ]]; then
|
if [[ -x $updateTool ]]; then
|
||||||
printlog "running $updateTool $updateToolArguments"
|
printlog "running $updateTool $updateToolArguments"
|
||||||
if [[ -n $updateToolRunAsCurrentUser ]]; then
|
if [[ -n $updateToolRunAsCurrentUser ]]; then
|
||||||
@@ -710,6 +711,25 @@ runUpdateTool() {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
finishing() {
|
||||||
|
printlog "Finishing…"
|
||||||
|
sleep 10 # wait a moment to let spotlight catch up
|
||||||
|
getAppVersion
|
||||||
|
|
||||||
|
if [[ -z $appversion ]]; then
|
||||||
|
message="Installed $name"
|
||||||
|
else
|
||||||
|
message="Installed $name, version $appversion"
|
||||||
|
fi
|
||||||
|
|
||||||
|
printlog "$message"
|
||||||
|
|
||||||
|
if [[ $currentUser != "loginwindow" && ( $NOTIFY == "success" || $NOTIFY == "all" ) ]]; then
|
||||||
|
printlog "notifying"
|
||||||
|
displaynotification "$message" "$name update/installation complete!"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# MARK: check minimal macOS requirement
|
# MARK: check minimal macOS requirement
|
||||||
autoload is-at-least
|
autoload is-at-least
|
||||||
@@ -2932,8 +2952,8 @@ microsoftteams)
|
|||||||
# Still using macadmin.software for version, as the path does not contain the version in a matching format. packageID can be used, but version is the same.
|
# Still using macadmin.software for version, as the path does not contain the version in a matching format. packageID can be used, but version is the same.
|
||||||
expectedTeamID="UBF8T346G9"
|
expectedTeamID="UBF8T346G9"
|
||||||
blockingProcesses=( Teams "Microsoft Teams Helper" )
|
blockingProcesses=( Teams "Microsoft Teams Helper" )
|
||||||
#updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate"
|
updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate"
|
||||||
#updateToolArguments=( --install --apps TEAM01 )
|
updateToolArguments=( --install --apps TEAM01 )
|
||||||
;;
|
;;
|
||||||
microsoftvisualstudiocode|\
|
microsoftvisualstudiocode|\
|
||||||
visualstudiocode)
|
visualstudiocode)
|
||||||
@@ -3117,11 +3137,14 @@ if ! cd "$tmpDir"; then
|
|||||||
cleanupAndExit 1
|
cleanupAndExit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# MARK: check if this is an Update
|
# MARK: check if this is an Update and we can use updateTool
|
||||||
getAppVersion
|
getAppVersion
|
||||||
if [[ -n $appVersion ]]; then
|
printlog "appversion: $appversion"
|
||||||
|
if [[ -n $appversion && -n "$updateTool" ]]; then
|
||||||
|
printlog "appversion & updateTool"
|
||||||
if [[ $DEBUG -eq 0 ]]; then
|
if [[ $DEBUG -eq 0 ]]; then
|
||||||
if runUpdateTool; then
|
if runUpdateTool; then
|
||||||
|
finishing
|
||||||
cleanupAndExit 0
|
cleanupAndExit 0
|
||||||
fi # otherwise continue
|
fi # otherwise continue
|
||||||
else
|
else
|
||||||
@@ -3223,22 +3246,8 @@ case $type in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# MARK: print installed application location and version
|
# MARK: Finishing — print installed application location and version
|
||||||
sleep 10 # wait a moment to let spotlight catch up
|
finishing
|
||||||
getAppVersion
|
|
||||||
|
|
||||||
if [[ -z $appversion ]]; then
|
|
||||||
message="Installed $name"
|
|
||||||
else
|
|
||||||
message="Installed $name, version $appversion"
|
|
||||||
fi
|
|
||||||
|
|
||||||
printlog "$message"
|
|
||||||
|
|
||||||
if [[ $currentUser != "loginwindow" && ( $NOTIFY == "success" || $NOTIFY == "all" ) ]]; then
|
|
||||||
printlog "notifying"
|
|
||||||
displaynotification "$message" "$name update/installation complete!"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# all done!
|
# all done!
|
||||||
cleanupAndExit 0
|
cleanupAndExit 0
|
||||||
|
|||||||
Reference in New Issue
Block a user