fixed wrong status icons

This commit is contained in:
Armin Briegel
2022-08-02 16:51:56 +02:00
parent a308ccbc29
commit 719ca81bcb
4 changed files with 51 additions and 37 deletions

View File

@@ -7,6 +7,20 @@ if ! is-at-least 10.14 $installedOSversion; then
exit 98
fi
# check Swift Dialog presence and version
DIALOG_CMD="/usr/local/bin/dialog"
if [[ -x $DIALOG_CMD ]]; then
# Swift Dialog is not installed, clear cmd file variable to ignore
DIALOG_CMD_FILE=""
fi
if ! is-at-least 1.11.2 "$(/usr/local/bindialog --version)"; then
# list item progress is only available with SD 1.11.2 and higher
DIALOG_LIST_ITEM_NAME=""
fi
# MARK: argument parsing
if [[ $# -eq 0 ]]; then
if [[ -z $label ]]; then # check if label is set inside script

View File

@@ -14,17 +14,15 @@ cleanupAndExit() { # $1 = exit code, $2 message, $3 level
printlog "Debugging enabled, Deleting tmpDir output was:\n$deleteTmpOut" DEBUG
fi
# # If displaying progres, quit dialog
# if [[ $DIALOG_PROGRESS == "main" || $DIALOG_PROGRESS == "list" ]]; then
# quitDialog "$DIALOGCMDFILE"
# fi
# If we closed any processes, reopen the app again
reopenClosedProcess
if [[ -n $2 && $1 -ne 0 ]]; then
printlog "ERROR: $2" $3
updateDialog "fail" "Error ($1; $2)"
else
printlog "$2" $3
updateDialog "success" ""
fi
printlog "################## End Installomator, exit code $1 \n" REQ
@@ -846,7 +844,6 @@ runUpdateTool() {
finishing() {
printlog "Finishing..."
updateDialog "wait" "Finishing..."
sleep 3 # wait a moment to let spotlight catch up
getAppVersion
@@ -931,7 +928,7 @@ readDownloadPipe() {
fi
if [[ $char == % ]]; then
updateDialog $progress "Downloading $name - $progress%"
updateDialog $progress "Downloading..."
progress=""
keep=0
fi
@@ -976,11 +973,11 @@ updateDialog() {
local cmd_file=${4:-$DIALOG_CMD_FILE}
local progress=""
if [[ state =~ [0-9]* \
|| state == "reset" \
|| state == "increment" \
|| state == "complete" \
|| state == "indeterminate" ]]; then
if [[ $state =~ '^[0-9]' \
|| $state == "reset" \
|| $state == "increment" \
|| $state == "complete" \
|| $state == "indeterminate" ]]; then
progress=$state
fi
@@ -995,7 +992,7 @@ updateDialog() {
echo "progress: $progress" >> $cmd_file
fi
if [[ $message != "" ]]; then
echo "progresstext: $message" >> $cmd_file
echo "progresstext: $name - $message" >> $cmd_file
fi
else
# list item has a value, so we update the progress and text in the list

View File

@@ -168,6 +168,8 @@ fi
# MARK: check if this is an Update and we can use updateTool
if [[ (-n $appversion && -n "$updateTool") || "$type" == "updateronly" ]]; then
printlog "appversion & updateTool"
updateDialog "wait" "Updating..."
if [[ $DEBUG -ne 1 ]]; then
if runUpdateTool; then
finishing
@@ -257,8 +259,10 @@ if [[ $currentUser != "loginwindow" && $NOTIFY == "all" ]]; then
printlog "notifying"
if [[ $updateDetected == "YES" ]]; then
displaynotification "Updating $name" "Installation in progress …"
updateDialog "wait" "Updating..."
else
displaynotification "Installing $name" "Installation in progress …"
updateDialog "wait" "Installing..."
fi
fi
@@ -295,8 +299,12 @@ case $type in
;;
esac
updateDialog "wait" "Finishing..."
# MARK: Finishing — print installed application location and version
finishing
updateDialog "success" "$appversion"
# all done!
cleanupAndExit 0 "All done!" REQ