mirror of
https://github.com/mtan93/Installomator.git
synced 2026-03-08 05:31:53 +00:00
Merge branch 'dev' into dev
This commit is contained in:
@@ -117,6 +117,10 @@ printlog "appversion: $appversion"
|
||||
|
||||
# MARK: Exit if new version is the same as installed version (appNewVersion specified)
|
||||
# credit: Søren Theilgaard (@theilgaard)
|
||||
if [[ $INSTALL == "force" ]]; then
|
||||
printlog "Using force to install, so not using updateTool."
|
||||
updateTool=""
|
||||
fi
|
||||
if [[ -n $appNewVersion ]]; then
|
||||
printlog "Latest version of $name is $appNewVersion"
|
||||
if [[ $appversion == $appNewVersion ]]; then
|
||||
@@ -129,9 +133,6 @@ if [[ -n $appNewVersion ]]; then
|
||||
displaynotification "$message" "No update for $name!"
|
||||
fi
|
||||
cleanupAndExit 0 "No newer version."
|
||||
else
|
||||
printlog "Using force to install anyway. Not using updateTool."
|
||||
updateTool=""
|
||||
fi
|
||||
else
|
||||
printlog "DEBUG mode 1 enabled, not exiting, but there is no new version of app."
|
||||
@@ -139,10 +140,6 @@ if [[ -n $appNewVersion ]]; then
|
||||
fi
|
||||
else
|
||||
printlog "Latest version not specified."
|
||||
if [[ $INSTALL == "force" ]]; then
|
||||
printlog "Using force to install, so not using updateTool."
|
||||
updateTool=""
|
||||
fi
|
||||
fi
|
||||
|
||||
# MARK: check if this is an Update and we can use updateTool
|
||||
@@ -169,14 +166,22 @@ else
|
||||
printlog "Downloading $downloadURL to $archiveName"
|
||||
if [[ $currentUser != "loginwindow" && $NOTIFY == "all" ]]; then
|
||||
printlog "notifying"
|
||||
displaynotification "Downloading $name update" "Download in progress …"
|
||||
if [[ $updateDetected == "YES" ]]; then
|
||||
displaynotification "Downloading $name update" "Download in progress …"
|
||||
else
|
||||
displaynotification "Downloading new $name" "Download in progress …"
|
||||
fi
|
||||
fi
|
||||
if ! curl --location --fail --silent "$downloadURL" -o "$archiveName"; then
|
||||
printlog "error downloading $downloadURL"
|
||||
message="$name update/installation failed. This will be logged, so IT can follow up."
|
||||
if [[ $currentUser != "loginwindow" && $NOTIFY == "all" ]]; then
|
||||
printlog "notifying"
|
||||
displaynotification "$message" "Error installing/updating $name"
|
||||
if [[ $updateDetected == "YES" ]]; then
|
||||
displaynotification "$message" "Error updating $name"
|
||||
else
|
||||
displaynotification "$message" "Error installing $name"
|
||||
fi
|
||||
fi
|
||||
cleanupAndExit 2
|
||||
fi
|
||||
@@ -199,7 +204,17 @@ fi
|
||||
printlog "Installing $name"
|
||||
if [[ $currentUser != "loginwindow" && $NOTIFY == "all" ]]; then
|
||||
printlog "notifying"
|
||||
displaynotification "Installing $name" "Installation in progress …"
|
||||
if [[ $updateDetected == "YES" ]]; then
|
||||
displaynotification "Updating $name" "Installation in progress …"
|
||||
else
|
||||
displaynotification "Installing $name" "Installation in progress …"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$installerTool" ]; then
|
||||
# installerTool defined, and we use that for installation
|
||||
printlog "installerTool used: $installerTool"
|
||||
appName="$installerTool"
|
||||
fi
|
||||
|
||||
case $type in
|
||||
|
||||
Reference in New Issue
Block a user