From d84aafe4f96427bd196c5567543508f11272963c Mon Sep 17 00:00:00 2001 From: wattsy74 <49881777+wattsy74@users.noreply.github.com> Date: Fri, 1 Oct 2021 15:53:29 +0100 Subject: [PATCH] Update !Script-Template.sh --- !Script-Template.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/!Script-Template.sh b/!Script-Template.sh index 4e2a587..d495213 100755 --- a/!Script-Template.sh +++ b/!Script-Template.sh @@ -28,10 +28,10 @@ # The url of the webpage to scrape for the latest version number and download link. releaseNotesUrl='https://vendorweb.com/product_history/release_notes' -# Installation Method, are we using a DMG or PKG to install the app? +# Installation Method, are we using a DMG, PKG or ZIP to install the app? installMethod="PKG" -# This is the name of the file we download this might be a dmg or a pkg. +# This is the name of the file we download this might be a dmg, a pkg or a zip. dnldfile='Application Name.pkg' # The name of the application once it is installed without the .app extension @@ -164,13 +164,21 @@ /usr/bin/hdiutil detach $(/bin/df | /usr/bin/grep "${appName}" | awk '{print $1}') -quiet /bin/sleep 10 - else - + else if [[ $installMethod = "PKG"]]; then # Open the PKG with installer cd /tmp /usr/sbin/installer -pkg ${dnldfile} -target / - + + else + + # Expand the archive + cd /tmp + unzip $dnlndfile + + # Move the file to the Applications folder + mv "{appName}.app" "/Applications/${appName}.app" + /bin/sleep 10 fi # Clean up after the installation