From c55cc788bba09ca3d0070ca66303c973379a3b25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Wed, 9 Feb 2022 09:21:46 +0100 Subject: [PATCH 1/4] Update functions.sh --- fragments/functions.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/fragments/functions.sh b/fragments/functions.sh index a851077..54e427b 100644 --- a/fragments/functions.sh +++ b/fragments/functions.sh @@ -220,13 +220,21 @@ getAppVersion() { fi fi - # get app in /Applications, or /Applications/Utilities, or find using Spotlight - if [[ -d "/Applications/$appName" ]]; then + # get app in targetDir, /Applications, or /Applications/Utilities + if [[ -d "$targetDir/$appName" ]]; then + applist="$targetDir/$appName" + elif [[ -d "/Applications/$appName" ]]; then applist="/Applications/$appName" + if [[ $type =~ '^(dmg|zip|tbz|app.*)$']]; then + targetDir="/Applications" + fi elif [[ -d "/Applications/Utilities/$appName" ]]; then applist="/Applications/Utilities/$appName" - else - applist=$(mdfind "kind:application $appName" -0 ) + if [[ $type =~ '^(dmg|zip|tbz|app.*)$']]; then + targetDir="/Applications/Utilities" + fi + #else + # applist=$(mdfind "kind:application $appName" -0 ) fi if [[ -z applist ]]; then printlog "No previous app found" DEBUG From dd83f6bd75bcb17eb6520b63043d93f597432581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Wed, 9 Feb 2022 09:41:03 +0100 Subject: [PATCH 2/4] Update functions.sh --- fragments/functions.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fragments/functions.sh b/fragments/functions.sh index 54e427b..38ac3d3 100644 --- a/fragments/functions.sh +++ b/fragments/functions.sh @@ -241,6 +241,9 @@ getAppVersion() { else printlog "App(s) found: ${applist}" DEBUG fi + if [[ $type =~ '^(dmg|zip|tbz|app.*)$']]; then + printlog "targetDir for installation: $targetDir" INFO + fi appPathArray=( ${(0)applist} ) From c3714d855c6dd6bdce63167d7a1dd7e78bceedf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Wed, 9 Feb 2022 09:46:24 +0100 Subject: [PATCH 3/4] Missing spaces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After manually moving Firefox to Utilities I have tested with this: ``` $ sudo /Installomator/utils/assemble.sh firefox DEBUG=0 INSTALL=force 2022-02-09 09:44:04 : INFO : firefox : setting variable from argument DEBUG=0 2022-02-09 09:44:04 : INFO : firefox : setting variable from argument INSTALL=force 2022-02-09 09:44:04 : REQ : firefox : ################## Start Installomator v. 9.1beta, date 2022-02-09 2022-02-09 09:44:04 : INFO : firefox : ################## Version: 9.1beta 2022-02-09 09:44:04 : INFO : firefox : ################## Date: 2022-02-09 2022-02-09 09:44:04 : INFO : firefox : ################## firefox 2022-02-09 09:44:04 : INFO : firefox : BLOCKING_PROCESS_ACTION=tell_user 2022-02-09 09:44:04 : INFO : firefox : NOTIFY=success 2022-02-09 09:44:04 : INFO : firefox : LOGGING=INFO 2022-02-09 09:44:04 : INFO : firefox : LOGO=/System/Applications/App Store.app/Contents/Resources/AppIcon.icns 2022-02-09 09:44:04 : INFO : firefox : Label type: dmg 2022-02-09 09:44:04 : INFO : firefox : targetDir for installation: /Applications/Utilities 2022-02-09 09:44:04 : INFO : firefox : found app at /Applications/Utilities/Firefox.app, version 97.0, on versionKey CFBundleShortVersionString 2022-02-09 09:44:04 : INFO : firefox : appversion: 97.0 2022-02-09 09:44:04 : INFO : firefox : Label is not of type “updateronly”, and it’s set to use force to install or ignoring app store apps, so not using updateTool. 2022-02-09 09:44:04 : INFO : firefox : Latest version of Firefox is 97.0 2022-02-09 09:44:04 : INFO : firefox : There is no newer version available. 2022-02-09 09:44:04 : REQ : firefox : Downloading https://download.mozilla.org/?product=firefox-latest&os=osx&lang=en-US to Firefox.dmg 2022-02-09 09:44:16 : REQ : firefox : no more blocking processes, continue with update 2022-02-09 09:44:16 : REQ : firefox : Installing Firefox 2022-02-09 09:44:16 : INFO : firefox : Mounting /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/tmp.NMItuUfS/Firefox.dmg 2022-02-09 09:44:24 : INFO : firefox : Mounted: /Volumes/Firefox 2022-02-09 09:44:24 : INFO : firefox : Verifying: /Volumes/Firefox/Firefox.app 2022-02-09 09:44:33 : INFO : firefox : Team ID matching: 43AQ936H96 (expected: 43AQ936H96 ) 2022-02-09 09:44:33 : INFO : firefox : Downloaded version of Firefox is 97.0 on versionKey CFBundleShortVersionString, same as installed. 2022-02-09 09:44:33 : INFO : firefox : Using force to install anyway. 2022-02-09 09:44:33 : INFO : firefox : App has LSMinimumSystemVersion: 10.12.0 2022-02-09 09:44:33 : INFO : firefox : Copy /Volumes/Firefox/Firefox.app to /Applications/Utilities 2022-02-09 09:44:40 : INFO : firefox : Changing owner to st 2022-02-09 09:44:40 : INFO : firefox : Finishing... 2022-02-09 09:44:50 : INFO : firefox : targetDir for installation: /Applications/Utilities 2022-02-09 09:44:50 : INFO : firefox : found app at /Applications/Utilities/Firefox.app, version 97.0, on versionKey CFBundleShortVersionString 2022-02-09 09:44:50 : INFO : firefox : Installed Firefox, version 97.0 2022-02-09 09:44:50 : INFO : firefox : notifying 2022-02-09 09:44:50 : REQ : firefox : ################## End Installomator, exit code 0 ``` --- fragments/functions.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fragments/functions.sh b/fragments/functions.sh index 38ac3d3..25b53a5 100644 --- a/fragments/functions.sh +++ b/fragments/functions.sh @@ -225,12 +225,12 @@ getAppVersion() { applist="$targetDir/$appName" elif [[ -d "/Applications/$appName" ]]; then applist="/Applications/$appName" - if [[ $type =~ '^(dmg|zip|tbz|app.*)$']]; then + if [[ $type =~ '^(dmg|zip|tbz|app.*)$' ]]; then targetDir="/Applications" fi elif [[ -d "/Applications/Utilities/$appName" ]]; then applist="/Applications/Utilities/$appName" - if [[ $type =~ '^(dmg|zip|tbz|app.*)$']]; then + if [[ $type =~ '^(dmg|zip|tbz|app.*)$' ]]; then targetDir="/Applications/Utilities" fi #else @@ -241,7 +241,7 @@ getAppVersion() { else printlog "App(s) found: ${applist}" DEBUG fi - if [[ $type =~ '^(dmg|zip|tbz|app.*)$']]; then + if [[ $type =~ '^(dmg|zip|tbz|app.*)$' ]]; then printlog "targetDir for installation: $targetDir" INFO fi From b30d4da703f496dd6e8d6dd1a8f896822f7e6a12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Wed, 9 Feb 2022 14:04:23 +0100 Subject: [PATCH 4/4] Update functions.sh --- fragments/functions.sh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/fragments/functions.sh b/fragments/functions.sh index 25b53a5..419275d 100644 --- a/fragments/functions.sh +++ b/fragments/functions.sh @@ -225,25 +225,29 @@ getAppVersion() { applist="$targetDir/$appName" elif [[ -d "/Applications/$appName" ]]; then applist="/Applications/$appName" - if [[ $type =~ '^(dmg|zip|tbz|app.*)$' ]]; then - targetDir="/Applications" - fi +# if [[ $type =~ '^(dmg|zip|tbz|app.*)$' ]]; then +# targetDir="/Applications" +# fi elif [[ -d "/Applications/Utilities/$appName" ]]; then applist="/Applications/Utilities/$appName" - if [[ $type =~ '^(dmg|zip|tbz|app.*)$' ]]; then - targetDir="/Applications/Utilities" - fi - #else +# if [[ $type =~ '^(dmg|zip|tbz|app.*)$' ]]; then +# targetDir="/Applications/Utilities" +# fi + else # applist=$(mdfind "kind:application $appName" -0 ) + printlog "name: $name, appName: $appName" + applist=$(mdfind "kind:application AND name:$name" -0 ) +# printlog "App(s) found: ${applist}" DEBUG +# applist=$(mdfind "kind:application AND name:$appName" -0 ) fi if [[ -z applist ]]; then printlog "No previous app found" DEBUG else printlog "App(s) found: ${applist}" DEBUG fi - if [[ $type =~ '^(dmg|zip|tbz|app.*)$' ]]; then - printlog "targetDir for installation: $targetDir" INFO - fi +# if [[ $type =~ '^(dmg|zip|tbz|app.*)$' ]]; then +# printlog "targetDir for installation: $targetDir" INFO +# fi appPathArray=( ${(0)applist} )