mirror of
https://github.com/mtan93/Installomator.git
synced 2026-03-08 05:31:53 +00:00
Merge branch 'dev' of https://github.com/scriptingosx/Installomator into dev
This commit is contained in:
@@ -35,6 +35,9 @@ BLOCKING_PROCESS_ACTION=prompt_user
|
||||
# - silent_fail exit script without prompt or installation
|
||||
# - prompt_user show a user dialog for each blocking process found
|
||||
# abort after three attempts to quit
|
||||
# - prompt_user_then_kill
|
||||
# show a user dialog for each blocking process found,
|
||||
# attempt to quit two times, kill the process finally
|
||||
# - kill kill process without prompting or giving the user a chance to save
|
||||
|
||||
|
||||
@@ -259,12 +262,18 @@ checkRunningProcesses() {
|
||||
printlog "killing process $x"
|
||||
pkill $x
|
||||
;;
|
||||
prompt_user)
|
||||
prompt_user|prompt_user_then_kill)
|
||||
button=$(displaydialog "Quit “$x” to continue updating? (Leave this dialogue if you want to activate this update later)." "The application “$x” needs to be updated.")
|
||||
if [[ $button = "Not Now" ]]; then
|
||||
cleanupAndExit 10 "user aborted update"
|
||||
else
|
||||
runAsUser osascript -e "tell app \"$x\" to quit"
|
||||
if [[ $i = 3 && $BLOCKING_PROCESS_ACTION = "prompt_user_then_kill" ]]; then
|
||||
printlog "killing process $x"
|
||||
pkill $x
|
||||
else
|
||||
printlog "telling app $x to quit"
|
||||
runAsUser osascript -e "tell app \"$x\" to quit"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
silent_fail)
|
||||
|
||||
Reference in New Issue
Block a user