From 315398b3fcb3239e01d9fc3853eb443d90f8ca99 Mon Sep 17 00:00:00 2001 From: Armin Briegel <1933192+scriptingosx@users.noreply.github.com> Date: Thu, 23 Jul 2020 13:54:49 +0200 Subject: [PATCH 01/46] updated version --- Installomator.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Installomator.sh b/Installomator.sh index 4e84dda..08aac0e 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -8,8 +8,8 @@ # inspired by the download scripts from William Smith and Sander Schram # with additional ideas and contribution from Isaac Ordonez, Mann consulting -VERSION='0.3' -VERSIONDATE='20200609' +VERSION='0.4' +VERSIONDATE='20200723' export PATH=/usr/bin:/bin:/usr/sbin:/sbin From 8544796b7556472dcdf5a3345ea18e2a1a467724 Mon Sep 17 00:00:00 2001 From: Armin Briegel <1933192+scriptingosx@users.noreply.github.com> Date: Thu, 23 Jul 2020 14:18:38 +0200 Subject: [PATCH 02/46] re-added citrixworkspace --- Installomator.sh | 14 +++++++------- Labels.txt | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Installomator.sh b/Installomator.sh index 08aac0e..4b543cd 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -441,13 +441,13 @@ webexteams) downloadURL="https://binaries.webex.com/WebexTeamsDesktop-MACOS-Gold/WebexTeams.dmg" expectedTeamID="DE8Y96K9QP" ;; -#citrixworkspace) - # credit: Erik Stam (@erikstam) - #name="Citrix Workspace" - #type="pkgInDmg" - #downloadURL="https://downloads.citrix.com/17596/CitrixWorkspaceApp.dmg?__gda__=1588183500_fc68033aef7d6d163d8b8309b964f1de" - #expectedTeamID="S272Y5R93J" - #;; +citrixworkspace) + #credit: Erik Stam (@erikstam) + name="Citrix Workspace" + type="pkgInDmg" + downloadURL="https:"$(curl -s -L "https://www.citrix.com/downloads/workspace-app/mac/workspace-app-for-mac-latest.html#ctx-dl-eula-external" | grep "dmg?" | sed "s/.*rel=.\(.*\)..id=.*/\1/") + expectedTeamID="S272Y5R93J" + ;; privileges) # credit: Erik Stam (@erikstam) name="Privileges" diff --git a/Labels.txt b/Labels.txt index 0ac878f..494a467 100644 --- a/Labels.txt +++ b/Labels.txt @@ -12,6 +12,7 @@ bbedit bettertouchtool boxdrive brave +citrixworkspace code42 coderunner cyberduck From adf34cb6f3173ff7d62220040c6d38e3db3bbe2e Mon Sep 17 00:00:00 2001 From: Armin Briegel <1933192+scriptingosx@users.noreply.github.com> Date: Fri, 24 Jul 2020 12:36:16 +0200 Subject: [PATCH 03/46] updated credit for citrixworkspace --- Installomator.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Installomator.sh b/Installomator.sh index 4b543cd..7f6cf66 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -442,7 +442,7 @@ webexteams) expectedTeamID="DE8Y96K9QP" ;; citrixworkspace) - #credit: Erik Stam (@erikstam) + #credit: Erik Stam (@erikstam) and #Philipp on MacAdmins Slack name="Citrix Workspace" type="pkgInDmg" downloadURL="https:"$(curl -s -L "https://www.citrix.com/downloads/workspace-app/mac/workspace-app-for-mac-latest.html#ctx-dl-eula-external" | grep "dmg?" | sed "s/.*rel=.\(.*\)..id=.*/\1/") From 7d6f4db736ff20270576902d20212b417bd14465 Mon Sep 17 00:00:00 2001 From: Armin Briegel <1933192+scriptingosx@users.noreply.github.com> Date: Mon, 27 Jul 2020 16:13:56 +0200 Subject: [PATCH 04/46] added camtasia --- Installomator.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Installomator.sh b/Installomator.sh index 7f6cf66..adcc45b 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -778,6 +778,13 @@ egnyte) expectedTeamID="FELUD555VC" blockingProcesses=( NONE ) ;; +camtasia) + name="Camtasia 2020" + type="dmg" + downloadURL=https://download.techsmith.com/camtasiamac/releases/Camtasia.dmg + expectedTeamID="7TQL462TU8" + ;; + # MARK: add new labels above here From 0a96de84496b19796b236d5a269a3b4bd42412c7 Mon Sep 17 00:00:00 2001 From: Armin Briegel <1933192+scriptingosx@users.noreply.github.com> Date: Mon, 27 Jul 2020 16:16:49 +0200 Subject: [PATCH 05/46] fixed one printlog to many --- Installomator.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Installomator.sh b/Installomator.sh index adcc45b..17ff2d8 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -9,7 +9,7 @@ # with additional ideas and contribution from Isaac Ordonez, Mann consulting VERSION='0.4' -VERSIONDATE='20200723' +VERSIONDATE='20200727' export PATH=/usr/bin:/bin:/usr/sbin:/sbin @@ -1166,7 +1166,7 @@ mountDMG() { # mount the dmg printlog "Mounting $tmpDir/$archiveName" # always pipe 'Y\n' in case the dmg requires an agreement - if ! dmgmount=$(printlog 'Y'$'\n' | hdiutil attach "$tmpDir/$archiveName" -nobrowse -readonly | tail -n 1 | cut -c 54- ); then + if ! dmgmount=$(echo 'Y'$'\n' | hdiutil attach "$tmpDir/$archiveName" -nobrowse -readonly | tail -n 1 | cut -c 54- ); then cleanupAndExit 3 "Error mounting $tmpDir/$archiveName" fi From 7f264733a7cd33af296b6cf79ad7c59aacdcfe70 Mon Sep 17 00:00:00 2001 From: Armin Briegel <1933192+scriptingosx@users.noreply.github.com> Date: Sun, 9 Aug 2020 16:53:51 +0200 Subject: [PATCH 06/46] added snagit2020 --- Installomator.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Installomator.sh b/Installomator.sh index 17ff2d8..47bb686 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -784,6 +784,13 @@ camtasia) downloadURL=https://download.techsmith.com/camtasiamac/releases/Camtasia.dmg expectedTeamID="7TQL462TU8" ;; +snagit2020) + # credit: Isaac Ordonez, Mann consulting (@mannconsulting) + name="Snagit 2020" + type="dmg" + downloadURL="https://download.techsmith.com/snagitmac/releases/Snagit.dmg" + expectedTeamID="7TQL462TU8" + ;; # MARK: add new labels above here From 42ec52887018a43ac53ac48eaff3ca85a0a0ba2c Mon Sep 17 00:00:00 2001 From: Raptor399 Date: Sun, 23 Aug 2020 12:03:36 +0200 Subject: [PATCH 07/46] Some GitHub repos return multiple files matching the filetype, e.g. "filename.dmg", "filename.dmg.DIGEST", etc. Only return the file that ends in the filetype. --- Installomator.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Installomator.sh b/Installomator.sh index 47bb686..f44a1c3 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -147,7 +147,7 @@ downloadURLFromGit() { # $1 git user name, $2 git repo name | awk -F '"' "/browser_download_url/ && /$archiveName/ { print \$4 }") else downloadURL=$(curl --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" \ - | awk -F '"' "/browser_download_url/ && /$filetype/ { print \$4 }") + | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4 }") fi if [ -z "$downloadURL" ]; then printlog "could not retrieve download URL for $gitusername/$gitreponame" From 65f5c57772930c197ef34e3a64d10b190781b54a Mon Sep 17 00:00:00 2001 From: Raptor399 Date: Sun, 23 Aug 2020 12:17:53 +0200 Subject: [PATCH 08/46] Add label for KeePassXC --- Installomator.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Installomator.sh b/Installomator.sh index f44a1c3..cc9a089 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -791,6 +791,12 @@ snagit2020) downloadURL="https://download.techsmith.com/snagitmac/releases/Snagit.dmg" expectedTeamID="7TQL462TU8" ;; +keepassxc) + name="KeePassXC" + type="dmg" + downloadURL="$(downloadURLFromGit keepassxreboot keepassxc)" + expectedTeamID="G2S7P7J672" + ;; # MARK: add new labels above here From da5f99639accc1f7b69b1608e8b5a6de4aec9e62 Mon Sep 17 00:00:00 2001 From: AP Orlebeke Date: Sun, 23 Aug 2020 23:39:51 -0400 Subject: [PATCH 09/46] Add VSCodium --- Installomator.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Installomator.sh b/Installomator.sh index 47bb686..c62f8da 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -791,6 +791,15 @@ snagit2020) downloadURL="https://download.techsmith.com/snagitmac/releases/Snagit.dmg" expectedTeamID="7TQL462TU8" ;; +vscodium) + name="VSCodium" + type="dmg" + downloadURL=$(curl -fs "https://api.github.com/repos/HandBrake/HandBrake/releases/latest" \ + | awk -F '"' "/browser_download_url/ && /dmg/ && ! /sig/ && ! /CLI/ && ! /sha256/ { print \$4 }") + expectedTeamID="C7S3ZQ2B8V" + appName="VSCodium.app" + blockingProcesses=( Electron ) + ;; # MARK: add new labels above here From 965cf310e4c6a9940c2b035c56e94970e2042ba6 Mon Sep 17 00:00:00 2001 From: AP Orlebeke Date: Sun, 23 Aug 2020 23:54:53 -0400 Subject: [PATCH 10/46] Add AirServer --- Installomator.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Installomator.sh b/Installomator.sh index 47bb686..5041519 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -791,6 +791,12 @@ snagit2020) downloadURL="https://download.techsmith.com/snagitmac/releases/Snagit.dmg" expectedTeamID="7TQL462TU8" ;; +airserver) + name="AirServer" + type="dmg" + downloadURL="https://www.airserver.com/download/mac/latest" + expectedTeamID="6C755KS5W3" + ;; # MARK: add new labels above here From 7438aa403c6764da49da644f3b1bb3b4e193f730 Mon Sep 17 00:00:00 2001 From: AP Orlebeke Date: Sun, 23 Aug 2020 23:57:58 -0400 Subject: [PATCH 11/46] Fix URL --- Installomator.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Installomator.sh b/Installomator.sh index c62f8da..4b1252a 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -794,7 +794,7 @@ snagit2020) vscodium) name="VSCodium" type="dmg" - downloadURL=$(curl -fs "https://api.github.com/repos/HandBrake/HandBrake/releases/latest" \ + downloadURL=$(curl -fs "https://api.github.com/repos/VSCodium/vscodium/releases/latest" \ | awk -F '"' "/browser_download_url/ && /dmg/ && ! /sig/ && ! /CLI/ && ! /sha256/ { print \$4 }") expectedTeamID="C7S3ZQ2B8V" appName="VSCodium.app" From a4df3399b4864ae9149da2a6e5c9fb21ddb522b1 Mon Sep 17 00:00:00 2001 From: AP Orlebeke Date: Mon, 24 Aug 2020 00:15:40 -0400 Subject: [PATCH 12/46] Add AutoPkgr --- Installomator.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Installomator.sh b/Installomator.sh index 47bb686..242bcec 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -791,7 +791,13 @@ snagit2020) downloadURL="https://download.techsmith.com/snagitmac/releases/Snagit.dmg" expectedTeamID="7TQL462TU8" ;; - +autopkgr) + name="AutoPkgr" + type="dmg" + downloadURL=$(curl -fs "https://api.github.com/repos/lindegroup/autopkgr/releases/latest" \ + | awk -F '"' "/browser_download_url/ && /dmg/ && ! /sig/ && ! /CLI/ && ! /sha256/ { print \$4 }") + expectedTeamID="JVY2ZR6SEF" + ;; # MARK: add new labels above here From c99aabccbb888e789968ae4e6510ef5b3700ce56 Mon Sep 17 00:00:00 2001 From: AP Orlebeke Date: Mon, 24 Aug 2020 00:30:01 -0400 Subject: [PATCH 13/46] Add DetectX Swift --- Installomator.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Installomator.sh b/Installomator.sh index 47bb686..afb9ad3 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -791,6 +791,12 @@ snagit2020) downloadURL="https://download.techsmith.com/snagitmac/releases/Snagit.dmg" expectedTeamID="7TQL462TU8" ;; +detectxswift) + name="DetectX Swift" + type="zip" + downloadURL="https://s3.amazonaws.com/sqwarq.com/PublicZips/DetectX_Swift.app.zip" + expectedTeamID="MAJ5XBJSG3" + ;; # MARK: add new labels above here From 950835724351f6fb8ee9b85bd01fce1ce4dc851b Mon Sep 17 00:00:00 2001 From: AP Orlebeke Date: Mon, 24 Aug 2020 00:47:35 -0400 Subject: [PATCH 14/46] Add VirtualBox --- Installomator.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Installomator.sh b/Installomator.sh index 47bb686..103f5b5 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -791,6 +791,14 @@ snagit2020) downloadURL="https://download.techsmith.com/snagitmac/releases/Snagit.dmg" expectedTeamID="7TQL462TU8" ;; +virtualbox) + name="VirtualBox" + type="pkgInDmg" + pkgName="VirtualBox.pkg" + downloadURL=$(curl -fs "https://www.virtualbox.org/wiki/Downloads" \ + | awk -F '"' "/OSX.dmg/ { print \$4 }") + expectedTeamID="VB5E2TV963" + ;; # MARK: add new labels above here From 37b36c8c13d29ba2a00eb38080804e8132de1102 Mon Sep 17 00:00:00 2001 From: AP Orlebeke Date: Mon, 24 Aug 2020 01:05:28 -0400 Subject: [PATCH 15/46] Add label --- Labels.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Labels.txt b/Labels.txt index 494a467..6feeae5 100644 --- a/Labels.txt +++ b/Labels.txt @@ -7,6 +7,7 @@ appcleaner aquaskk atom autodmg +autopkgr aviatrix bbedit bettertouchtool From 2d1777ca6ef504c2a0903369994464de5e0ee8de Mon Sep 17 00:00:00 2001 From: AP Orlebeke Date: Mon, 24 Aug 2020 01:06:11 -0400 Subject: [PATCH 16/46] Add label --- Labels.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Labels.txt b/Labels.txt index 494a467..80aa8e6 100644 --- a/Labels.txt +++ b/Labels.txt @@ -90,6 +90,7 @@ things torbrowser tunnelbear umbrellaroamingclient +virtualbox visualstudiocode vlc webexmeetings From a32b5fc0a21421845a0a1194bb79d031e4ce7d37 Mon Sep 17 00:00:00 2001 From: AP Orlebeke Date: Mon, 24 Aug 2020 01:06:42 -0400 Subject: [PATCH 17/46] Add label --- Labels.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Labels.txt b/Labels.txt index 494a467..f3f4ba2 100644 --- a/Labels.txt +++ b/Labels.txt @@ -18,6 +18,7 @@ coderunner cyberduck depnotify desktoppr +detectxswift discord docker dropbox From ec7e4793728d99369c102cdc78af0e4826d6e7fe Mon Sep 17 00:00:00 2001 From: AP Orlebeke Date: Mon, 24 Aug 2020 01:07:52 -0400 Subject: [PATCH 18/46] Add label --- Labels.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Labels.txt b/Labels.txt index 494a467..7be56af 100644 --- a/Labels.txt +++ b/Labels.txt @@ -3,6 +3,7 @@ adobereaderdc adobereaderdc-install adobereaderdc-update +airserver appcleaner aquaskk atom From 2ddbd2ab1ecf0e9043b58af47c4e77ff997bd7eb Mon Sep 17 00:00:00 2001 From: AP Orlebeke Date: Mon, 24 Aug 2020 01:08:40 -0400 Subject: [PATCH 19/46] Add label --- Labels.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Labels.txt b/Labels.txt index 494a467..351930e 100644 --- a/Labels.txt +++ b/Labels.txt @@ -92,6 +92,7 @@ tunnelbear umbrellaroamingclient visualstudiocode vlc +vscodium webexmeetings webexteams whatsapp From be0f0a9cd043e33f186ec249217d97bca010c678 Mon Sep 17 00:00:00 2001 From: Armin Briegel <1933192+scriptingosx@users.noreply.github.com> Date: Tue, 25 Aug 2020 14:31:24 +0200 Subject: [PATCH 20/46] updated Labels.txt. and added credits for new labels --- CHANGELOG.md | 8 ++++++-- Installomator.sh | 10 ++++++++++ Labels.txt | 3 +++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1aaf739..28035fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ -## v0.3 - 2020-07- +## v0.4 - 2020- + +- change `downloadFromGit` to match file types better (#58) + +## v0.3 - 2020-07-23 - added several new labels for total of 98 - removed the powershell labels, since the installer is not notarized @@ -16,4 +20,4 @@ improved logging - several new applications: count increased from 62 in 0.1 to 87 in 0.2 -## v0.1 - 2020-05-12 \ No newline at end of file +## v0.1 - 2020-05-12 diff --git a/Installomator.sh b/Installomator.sh index bdb2979..a086498 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -792,18 +792,23 @@ snagit2020) expectedTeamID="7TQL462TU8" ;; virtualbox) + # credit: AP Orlebeke (@apizz) name="VirtualBox" type="pkgInDmg" pkgName="VirtualBox.pkg" downloadURL=$(curl -fs "https://www.virtualbox.org/wiki/Downloads" \ | awk -F '"' "/OSX.dmg/ { print \$4 }") expectedTeamID="VB5E2TV963" + ;; detectxswift) + # credit: AP Orlebeke (@apizz) name="DetectX Swift" type="zip" downloadURL="https://s3.amazonaws.com/sqwarq.com/PublicZips/DetectX_Swift.app.zip" expectedTeamID="MAJ5XBJSG3" + ;; autopkgr) + # credit: AP Orlebeke (@apizz) name="AutoPkgr" type="dmg" downloadURL=$(curl -fs "https://api.github.com/repos/lindegroup/autopkgr/releases/latest" \ @@ -811,11 +816,14 @@ autopkgr) expectedTeamID="JVY2ZR6SEF" ;; airserver) + # credit: AP Orlebeke (@apizz) name="AirServer" type="dmg" downloadURL="https://www.airserver.com/download/mac/latest" expectedTeamID="6C755KS5W3" + ;; vscodium) + # credit: AP Orlebeke (@apizz) name="VSCodium" type="dmg" downloadURL=$(curl -fs "https://api.github.com/repos/VSCodium/vscodium/releases/latest" \ @@ -823,7 +831,9 @@ vscodium) expectedTeamID="C7S3ZQ2B8V" appName="VSCodium.app" blockingProcesses=( Electron ) + ;; keepassxc) + # credit: Patrick Atoon (@raptor399) name="KeePassXC" type="dmg" downloadURL="$(downloadURLFromGit keepassxreboot keepassxc)" diff --git a/Labels.txt b/Labels.txt index f1e63fd..78eb9f1 100644 --- a/Labels.txt +++ b/Labels.txt @@ -14,6 +14,7 @@ bbedit bettertouchtool boxdrive brave +camtasia citrixworkspace code42 coderunner @@ -42,6 +43,7 @@ jamfmigrator jamfpppcutility jamfreenroller karabinerelements +keepassxc krisp malwarebytes microsoftautoupdate @@ -79,6 +81,7 @@ santa sfsymbols signal slack +snagit2020 sonos sonoss1 sonoss2 From 961816236f02c2592c8f3bb038d58634acc91010 Mon Sep 17 00:00:00 2001 From: AP Orlebeke Date: Tue, 25 Aug 2020 19:58:58 -0400 Subject: [PATCH 21/46] Add SizeUp and label --- Installomator.sh | 7 ++++++- Labels.txt | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Installomator.sh b/Installomator.sh index a086498..56ba026 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -839,7 +839,12 @@ keepassxc) downloadURL="$(downloadURLFromGit keepassxreboot keepassxc)" expectedTeamID="G2S7P7J672" ;; - +sizeup) + name="SizeUp" + type="zip" + downloadURL="https://www.irradiatedsoftware.com/download/SizeUp.zip" + expectedTeamID="GVZ7RF955D" + ;; # MARK: add new labels above here diff --git a/Labels.txt b/Labels.txt index 78eb9f1..b279ac3 100644 --- a/Labels.txt +++ b/Labels.txt @@ -80,6 +80,7 @@ royaltsx santa sfsymbols signal +sizeup slack snagit2020 sonos From 3d4c1b45c98e60a22b0b868d935b718803b5dbdb Mon Sep 17 00:00:00 2001 From: AP Orlebeke Date: Tue, 25 Aug 2020 20:04:40 -0400 Subject: [PATCH 22/46] Add iStat Menus and label --- Installomator.sh | 6 ++++++ Labels.txt | 1 + 2 files changed, 7 insertions(+) diff --git a/Installomator.sh b/Installomator.sh index a086498..94e35ef 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -839,6 +839,12 @@ keepassxc) downloadURL="$(downloadURLFromGit keepassxreboot keepassxc)" expectedTeamID="G2S7P7J672" ;; +istatmenus) + name="iStat Menus" + type="zip" + downloadURL="https://download.bjango.com/istatmenus/" + expectedTeamID="Y93TK974AT" + ;; # MARK: add new labels above here diff --git a/Labels.txt b/Labels.txt index 78eb9f1..54a9346 100644 --- a/Labels.txt +++ b/Labels.txt @@ -38,6 +38,7 @@ googlejapaneseinput grandperspective handbrake icons +istatmenus iterm2 jamfmigrator jamfpppcutility From bd49d7ca97cbc2963260615b4d68fd1ed434c3c0 Mon Sep 17 00:00:00 2001 From: AP Orlebeke Date: Tue, 25 Aug 2020 20:07:46 -0400 Subject: [PATCH 23/46] Add blocking processes --- Installomator.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/Installomator.sh b/Installomator.sh index 94e35ef..5394be8 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -844,6 +844,7 @@ istatmenus) type="zip" downloadURL="https://download.bjango.com/istatmenus/" expectedTeamID="Y93TK974AT" + blockingProcesses=( "iStat Menus" "iStatMenusAgent" "iStat Menus Status" ) ;; From 5c5dadfe9b40ba4cf3168f7793fa1f31f173488a Mon Sep 17 00:00:00 2001 From: AP Orlebeke Date: Tue, 25 Aug 2020 20:18:14 -0400 Subject: [PATCH 24/46] Add Alfred and label --- Installomator.sh | 7 +++++++ Labels.txt | 1 + 2 files changed, 8 insertions(+) diff --git a/Installomator.sh b/Installomator.sh index a086498..c038901 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -839,6 +839,13 @@ keepassxc) downloadURL="$(downloadURLFromGit keepassxreboot keepassxc)" expectedTeamID="G2S7P7J672" ;; +alfred) + name="Alfred" + type="dmg" + downloadURL=$(curl -fs https://www.alfredapp.com | awk -F '"' "/dmg/ {print \$2}" | head -1) + appName="Alfred 4.app" + expectedTeamID="XZZXE9SED4" + ;; # MARK: add new labels above here diff --git a/Labels.txt b/Labels.txt index 78eb9f1..bfa238e 100644 --- a/Labels.txt +++ b/Labels.txt @@ -4,6 +4,7 @@ adobereaderdc adobereaderdc-install adobereaderdc-update airserver +alfred appcleaner aquaskk atom From 901f99459a374173fcf99602b6cd5336c6587a17 Mon Sep 17 00:00:00 2001 From: Armin Briegel <1933192+scriptingosx@users.noreply.github.com> Date: Wed, 26 Aug 2020 14:01:10 +0200 Subject: [PATCH 25/46] added credits --- Installomator.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Installomator.sh b/Installomator.sh index 420a2ea..1fbe6fa 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -9,7 +9,7 @@ # with additional ideas and contribution from Isaac Ordonez, Mann consulting VERSION='0.4' -VERSIONDATE='20200727' +VERSIONDATE='20200826' export PATH=/usr/bin:/bin:/usr/sbin:/sbin @@ -840,6 +840,7 @@ keepassxc) expectedTeamID="G2S7P7J672" ;; alfred) + # credit: AP Orlebeke (@apizz) name="Alfred" type="dmg" downloadURL=$(curl -fs https://www.alfredapp.com | awk -F '"' "/dmg/ {print \$2}" | head -1) @@ -847,6 +848,7 @@ alfred) expectedTeamID="XZZXE9SED4" ;; istatmenus) + # credit: AP Orlebeke (@apizz) name="iStat Menus" type="zip" downloadURL="https://download.bjango.com/istatmenus/" @@ -854,6 +856,7 @@ istatmenus) blockingProcesses=( "iStat Menus" "iStatMenusAgent" "iStat Menus Status" ) ;; sizeup) + # credit: AP Orlebeke (@apizz) name="SizeUp" type="zip" downloadURL="https://www.irradiatedsoftware.com/download/SizeUp.zip" From 138301f61e0f4c163b09de2ffdf185f8d5d31390 Mon Sep 17 00:00:00 2001 From: Armin Briegel <1933192+scriptingosx@users.noreply.github.com> Date: Wed, 26 Aug 2020 17:16:44 +0200 Subject: [PATCH 26/46] now uses arguments in the form VAR=value to set value --- Installomator.sh | 683 ++++++++++++++++++++++++----------------------- 1 file changed, 344 insertions(+), 339 deletions(-) diff --git a/Installomator.sh b/Installomator.sh index 1fbe6fa..6a7f957 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -113,9 +113,54 @@ BLOCKING_PROCESS_ACTION=prompt_user # -# MARK: functions to help with getting data +# MARK: Functions -# Logging +cleanupAndExit() { # $1 = exit code, $2 message + if [[ -n $2 && $1 -ne 0 ]]; then + printlog "ERROR: $2" + fi + if [ "$DEBUG" -eq 0 ]; then + # remove the temporary working directory when done + printlog "Deleting $tmpDir" + rm -Rf "$tmpDir" + fi + + if [ -n "$dmgmount" ]; then + # unmount disk image + printlog "Unmounting $dmgmount" + hdiutil detach "$dmgmount" + fi + printlog "################## End Installomator \n\n" + exit "$1" +} + +runAsUser() { + if [[ $currentUser != "loginwindow" ]]; then + uid=$(id -u "$currentUser") + launchctl asuser $uid sudo -u $currentUser "$@" + fi +} + +displaydialog() { # $1: message $2: title + message=${1:-"Message"} + title=${2:-"Installomator"} + runAsUser osascript -e "button returned of (display dialog \"$message\" with title \"$title\" buttons {\"Not Now\", \"Quit and Update\"} default button \"Quit and Update\")" +} + +displaynotification() { # $1: message $2: title + message=${1:-"Message"} + title=${2:-"Notification"} + manageaction="/Library/Application Support/JAMF/bin/Management Action.app/Contents/MacOS/Management Action" + + if [[ -x "$manageaction" ]]; then + "$manageaction" -message "$message" -title "$title" + else + runAsUser osascript -e "display notification \"$message\" with title \"$title\"" + fi +} + + +# MARK: Logging log_location="/private/var/log/Installomator.log" printlog(){ @@ -159,6 +204,291 @@ downloadURLFromGit() { # $1 git user name, $2 git repo name } +getAppVersion() { + # get all apps matching name + applist=$(mdfind "kind:application $appName" -0 ) + if [[ $applist = "" ]]; then + printlog "Spotlight not returning any app, trying manually in /Applications." + if [[ -d "/Applications/$appName" ]]; then + applist="/Applications/$appName" + fi + fi + + appPathArray=( ${(0)applist} ) + + if [[ ${#appPathArray} -gt 0 ]]; then + filteredAppPaths=( ${(M)appPathArray:#${targetDir}*} ) + if [[ ${#filteredAppPaths} -eq 1 ]]; then + installedAppPath=$filteredAppPaths[1] + appversion=$(mdls -name kMDItemVersion -raw $installedAppPath ) + printlog "found app at $installedAppPath, version $appversion" + else + printlog "could not determine location of $appName" + fi + else + printlog "could not find $appName" + fi +} + +checkRunningProcesses() { + # don't check in DEBUG mode + if [[ $DEBUG -ne 0 ]]; then + printlog "DEBUG mode, not checking for blocking processes" + return + fi + + # try at most 3 times + for i in {1..3}; do + countedProcesses=0 + for x in ${blockingProcesses}; do + if pgrep -xq "$x"; then + printlog "found blocking process $x" + + case $BLOCKING_PROCESS_ACTION in + kill) + printlog "killing process $x" + pkill $x + ;; + prompt_user) + 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" + fi + ;; + silent_fail) + cleanupAndExit 12 "blocking process '$x' found, aborting" + ;; + esac + + countedProcesses=$((countedProcesses + 1)) + fi + done + + if [[ $countedProcesses -eq 0 ]]; then + # no blocking processes, exit the loop early + break + else + # give the user a bit of time to quit apps + printlog "waiting 30 seconds for processes to quit" + sleep 30 + fi + done + + if [[ $countedProcesses -ne 0 ]]; then + cleanupAndExit 11 "could not quit all processes, aborting..." + fi + + printlog "no more blocking processes, continue with update" +} + +installAppWithPath() { # $1: path to app to install in $targetDir + appPath=${1?:"no path to app"} + + # check if app exists + if [ ! -e "$appPath" ]; then + cleanupAndExit 8 "could not find: $appPath" + fi + + # verify with spctl + printlog "Verifying: $appPath" + if ! teamID=$(spctl -a -vv "$appPath" 2>&1 | awk '/origin=/ {print $NF }' | tr -d '()' ); then + cleanupAndExit 4 "Error verifying $appPath" + fi + + printlog "Team ID: $teamID (expected: $expectedTeamID )" + + if [ "$expectedTeamID" != "$teamID" ]; then + cleanupAndExit 5 "Team IDs do not match" + fi + + # check for root + if [ "$(whoami)" != "root" ]; then + # not running as root + if [ "$DEBUG" -eq 0 ]; then + cleanupAndExit 6 "not running as root, exiting" + fi + + printlog "DEBUG enabled, skipping copy and chown steps" + return 0 + fi + + # remove existing application + if [ -e "$targetDir/$appName" ]; then + printlog "Removing existing $targetDir/$appName" + rm -Rf "$targetDir/$appName" + fi + + # copy app to /Applications + printlog "Copy $appPath to $targetDir" + if ! ditto "$appPath" "$targetDir/$appName"; then + cleanupAndExit 7 "Error while copying" + fi + + + # set ownership to current user + if [ "$currentUser" != "loginwindow" ]; then + printlog "Changing owner to $currentUser" + chown -R "$currentUser" "$targetDir/$appName" + else + printlog "No user logged in, not changing user" + fi + +} + +mountDMG() { + # mount the dmg + printlog "Mounting $tmpDir/$archiveName" + # always pipe 'Y\n' in case the dmg requires an agreement + if ! dmgmount=$(echo 'Y'$'\n' | hdiutil attach "$tmpDir/$archiveName" -nobrowse -readonly | tail -n 1 | cut -c 54- ); then + cleanupAndExit 3 "Error mounting $tmpDir/$archiveName" + fi + + if [[ ! -e $dmgmount ]]; then + printlog "Error mounting $tmpDir/$archiveName" + cleanupAndExit 3 + fi + + printlog "Mounted: $dmgmount" +} + +installFromDMG() { + mountDMG + + installAppWithPath "$dmgmount/$appName" +} + +installFromPKG() { + # verify with spctl + printlog "Verifying: $archiveName" + + if ! spctlout=$(spctl -a -vv -t install "$archiveName" 2>&1 ); then + printlog "Error verifying $archiveName" + cleanupAndExit 4 + fi + + teamID=$(echo $spctlout | awk -F '(' '/origin=/ {print $2 }' | tr -d '()' ) + + # Apple signed software has no teamID, grab entire origin instead + if [[ -z $teamID ]]; then + teamID=$(echo $spctlout | awk -F '=' '/origin=/ {print $NF }') + fi + + + printlog "Team ID: $teamID (expected: $expectedTeamID )" + + if [ "$expectedTeamID" != "$teamID" ]; then + printlog "Team IDs do not match!" + cleanupAndExit 5 + fi + + # skip install for DEBUG + if [ "$DEBUG" -ne 0 ]; then + printlog "DEBUG enabled, skipping installation" + return 0 + fi + + # check for root + if [ "$(whoami)" != "root" ]; then + # not running as root + printlog "not running as root, exiting" + cleanupAndExit 6 + fi + + # install pkg + printlog "Installing $archiveName to $targetDir" + if ! installer -pkg "$archiveName" -tgt "$targetDir" ; then + printlog "error installing $archiveName" + cleanupAndExit 9 + fi +} + +installFromZIP() { + # unzip the archive + printlog "Unzipping $archiveName" + + # tar -xf "$archiveName" + + # note: when you expand a zip using tar in Mojave the expanded + # app will never pass the spctl check + + unzip -o -qq "$archiveName" + installAppWithPath "$tmpDir/$appName" +} + +installFromTBZ() { + # unzip the archive + printlog "Unzipping $archiveName" + tar -xf "$archiveName" + installAppWithPath "$tmpDir/$appName" +} + +installPkgInDmg() { + mountDMG + # locate pkg in dmg + if [[ -z $pkgName ]]; then + # find first file ending with 'pkg' + findfiles=$(find "$dmgmount" -iname "*.pkg" -maxdepth 1 ) + filearray=( ${(f)findfiles} ) + if [[ ${#filearray} -eq 0 ]]; then + cleanupAndExit 20 "couldn't find pkg in dmg $archiveName" + fi + archiveName="${filearray[1]}" + printlog "found pkg: $archiveName" + else + # it is now safe to overwrite archiveName for installFromPKG + archiveName="$dmgmount/$pkgName" + fi + + # installFromPkgs + installFromPKG +} + +installPkgInZip() { + # unzip the archive + printlog "Unzipping $archiveName" + tar -xf "$archiveName" + + # locate pkg in zip + if [[ -z $pkgName ]]; then + # find first file starting with $name and ending with 'pkg' + findfiles=$(find "$tmpDir" -iname "*.pkg" -maxdepth 1 ) + filearray=( ${(f)findfiles} ) + if [[ ${#filearray} -eq 0 ]]; then + cleanupAndExit 20 "couldn't find pkg in zip $archiveName" + fi + archiveName="${filearray[1]}" + # it is now safe to overwrite archiveName for installFromPKG + printlog "found pkg: $archiveName" + else + # it is now safe to overwrite archiveName for installFromPKG + archiveName="$tmpDir/$pkgName" + fi + + # installFromPkgs + installFromPKG +} + +runUpdateTool() { + if [[ -x $updateTool ]]; then + printlog "running $updateTool $updateToolArguments" + if [[ -n $updateToolRunAsCurrentUser ]]; then + runAsUser $updateTool ${updateToolArguments} + else + $updateTool ${updateToolArguments} + fi + if [[ $? -ne 0 ]]; then + cleanupAndExit 15 "Error running $updateTool" + fi + else + printlog "couldn't find $updateTool, continuing normally" + return 1 + fi + return 0 +} + + # MARK: check minimal macOS requirement autoload is-at-least @@ -167,16 +497,24 @@ if ! is-at-least 10.14 $(sw_vers -productVersion); then exit 98 fi -# MARK: get the label +# MARK: argument parsing if [[ $# -eq 0 ]]; then grep -E '^[a-z0-9\-]*(\)|\|\\)$' "$0" | tr -d ')|\' | grep -v -E '^broken' | grep -v -E '^(longversion|version)$' | sort exit 0 -elif [[ $# -gt 3 ]]; then - # jamf uses $4 for the first custom parameter +elif [[ $1 == "/" ]]; then + # jamf uses sends '/' as the first argument printlog "shifting arguments for Jamf" shift 3 fi +# if an argument contains an = character, send it to eval +while [[ -n $1 && $1 =~ ".*\=.*" ]]; do + printlog "setting variable from argument $1" + eval $1 + # shift to next argument + shift 1 +done + label=${1:?"no label provided"} printlog "################## Start Installomator" @@ -1059,341 +1397,8 @@ brokenteamid) ;; esac -# MARK: Functions - -cleanupAndExit() { # $1 = exit code, $2 message - if [[ -n $2 && $1 -ne 0 ]]; then - printlog "ERROR: $2" - fi - if [ "$DEBUG" -eq 0 ]; then - # remove the temporary working directory when done - printlog "Deleting $tmpDir" - rm -Rf "$tmpDir" - fi - - if [ -n "$dmgmount" ]; then - # unmount disk image - printlog "Unmounting $dmgmount" - hdiutil detach "$dmgmount" - fi - printlog "################## End Installomator \n\n" - exit "$1" -} - -runAsUser() { - if [[ $currentUser != "loginwindow" ]]; then - uid=$(id -u "$currentUser") - launchctl asuser $uid sudo -u $currentUser "$@" - fi -} - -displaydialog() { # $1: message $2: title - message=${1:-"Message"} - title=${2:-"Installomator"} - runAsUser osascript -e "button returned of (display dialog \"$message\" with title \"$title\" buttons {\"Not Now\", \"Quit and Update\"} default button \"Quit and Update\")" -} - -displaynotification() { # $1: message $2: title - message=${1:-"Message"} - title=${2:-"Notification"} - manageaction="/Library/Application Support/JAMF/bin/Management Action.app/Contents/MacOS/Management Action" - - if [[ -x "$manageaction" ]]; then - "$manageaction" -message "$message" -title "$title" - else - runAsUser osascript -e "display notification \"$message\" with title \"$title\"" - fi -} - - -getAppVersion() { - # get all apps matching name - applist=$(mdfind "kind:application $appName" -0 ) - if [[ $applist = "" ]]; then - printlog "Spotlight not returning any app, trying manually in /Applications." - if [[ -d "/Applications/$appName" ]]; then - applist="/Applications/$appName" - fi - fi - - appPathArray=( ${(0)applist} ) - - if [[ ${#appPathArray} -gt 0 ]]; then - filteredAppPaths=( ${(M)appPathArray:#${targetDir}*} ) - if [[ ${#filteredAppPaths} -eq 1 ]]; then - installedAppPath=$filteredAppPaths[1] - appversion=$(mdls -name kMDItemVersion -raw $installedAppPath ) - printlog "found app at $installedAppPath, version $appversion" - else - printlog "could not determine location of $appName" - fi - else - printlog "could not find $appName" - fi -} - -checkRunningProcesses() { - # don't check in DEBUG mode - if [[ $DEBUG -ne 0 ]]; then - printlog "DEBUG mode, not checking for blocking processes" - return - fi - - # try at most 3 times - for i in {1..3}; do - countedProcesses=0 - for x in ${blockingProcesses}; do - if pgrep -xq "$x"; then - printlog "found blocking process $x" - - case $BLOCKING_PROCESS_ACTION in - kill) - printlog "killing process $x" - pkill $x - ;; - prompt_user) - 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" - fi - ;; - silent_fail) - cleanupAndExit 12 "blocking process '$x' found, aborting" - ;; - esac - - countedProcesses=$((countedProcesses + 1)) - fi - done - - if [[ $countedProcesses -eq 0 ]]; then - # no blocking processes, exit the loop early - break - else - # give the user a bit of time to quit apps - printlog "waiting 30 seconds for processes to quit" - sleep 30 - fi - done - - if [[ $countedProcesses -ne 0 ]]; then - cleanupAndExit 11 "could not quit all processes, aborting..." - fi - - printlog "no more blocking processes, continue with update" -} - -installAppWithPath() { # $1: path to app to install in $targetDir - appPath=${1?:"no path to app"} - - # check if app exists - if [ ! -e "$appPath" ]; then - cleanupAndExit 8 "could not find: $appPath" - fi - - # verify with spctl - printlog "Verifying: $appPath" - if ! teamID=$(spctl -a -vv "$appPath" 2>&1 | awk '/origin=/ {print $NF }' | tr -d '()' ); then - cleanupAndExit 4 "Error verifying $appPath" - fi - - printlog "Team ID: $teamID (expected: $expectedTeamID )" - - if [ "$expectedTeamID" != "$teamID" ]; then - cleanupAndExit 5 "Team IDs do not match" - fi - - # check for root - if [ "$(whoami)" != "root" ]; then - # not running as root - if [ "$DEBUG" -eq 0 ]; then - cleanupAndExit 6 "not running as root, exiting" - fi - - printlog "DEBUG enabled, skipping copy and chown steps" - return 0 - fi - - # remove existing application - if [ -e "$targetDir/$appName" ]; then - printlog "Removing existing $targetDir/$appName" - rm -Rf "$targetDir/$appName" - fi - - # copy app to /Applications - printlog "Copy $appPath to $targetDir" - if ! ditto "$appPath" "$targetDir/$appName"; then - cleanupAndExit 7 "Error while copying" - fi - - - # set ownership to current user - if [ "$currentUser" != "loginwindow" ]; then - printlog "Changing owner to $currentUser" - chown -R "$currentUser" "$targetDir/$appName" - else - printlog "No user logged in, not changing user" - fi - -} - -mountDMG() { - # mount the dmg - printlog "Mounting $tmpDir/$archiveName" - # always pipe 'Y\n' in case the dmg requires an agreement - if ! dmgmount=$(echo 'Y'$'\n' | hdiutil attach "$tmpDir/$archiveName" -nobrowse -readonly | tail -n 1 | cut -c 54- ); then - cleanupAndExit 3 "Error mounting $tmpDir/$archiveName" - fi - - if [[ ! -e $dmgmount ]]; then - printlog "Error mounting $tmpDir/$archiveName" - cleanupAndExit 3 - fi - - printlog "Mounted: $dmgmount" -} - -installFromDMG() { - mountDMG - - installAppWithPath "$dmgmount/$appName" -} - -installFromPKG() { - # verify with spctl - printlog "Verifying: $archiveName" - - if ! spctlout=$(spctl -a -vv -t install "$archiveName" 2>&1 ); then - printlog "Error verifying $archiveName" - cleanupAndExit 4 - fi - - teamID=$(echo $spctlout | awk -F '(' '/origin=/ {print $2 }' | tr -d '()' ) - - # Apple signed software has no teamID, grab entire origin instead - if [[ -z $teamID ]]; then - teamID=$(echo $spctlout | awk -F '=' '/origin=/ {print $NF }') - fi - - - printlog "Team ID: $teamID (expected: $expectedTeamID )" - - if [ "$expectedTeamID" != "$teamID" ]; then - printlog "Team IDs do not match!" - cleanupAndExit 5 - fi - - # skip install for DEBUG - if [ "$DEBUG" -ne 0 ]; then - printlog "DEBUG enabled, skipping installation" - return 0 - fi - - # check for root - if [ "$(whoami)" != "root" ]; then - # not running as root - printlog "not running as root, exiting" - cleanupAndExit 6 - fi - - # install pkg - printlog "Installing $archiveName to $targetDir" - if ! installer -pkg "$archiveName" -tgt "$targetDir" ; then - printlog "error installing $archiveName" - cleanupAndExit 9 - fi -} - -installFromZIP() { - # unzip the archive - printlog "Unzipping $archiveName" - - # tar -xf "$archiveName" - - # note: when you expand a zip using tar in Mojave the expanded - # app will never pass the spctl check - - unzip -o -qq "$archiveName" - installAppWithPath "$tmpDir/$appName" -} - -installFromTBZ() { - # unzip the archive - printlog "Unzipping $archiveName" - tar -xf "$archiveName" - installAppWithPath "$tmpDir/$appName" -} - -installPkgInDmg() { - mountDMG - # locate pkg in dmg - if [[ -z $pkgName ]]; then - # find first file ending with 'pkg' - findfiles=$(find "$dmgmount" -iname "*.pkg" -maxdepth 1 ) - filearray=( ${(f)findfiles} ) - if [[ ${#filearray} -eq 0 ]]; then - cleanupAndExit 20 "couldn't find pkg in dmg $archiveName" - fi - archiveName="${filearray[1]}" - printlog "found pkg: $archiveName" - else - # it is now safe to overwrite archiveName for installFromPKG - archiveName="$dmgmount/$pkgName" - fi - - # installFromPkgs - installFromPKG -} - -installPkgInZip() { - # unzip the archive - printlog "Unzipping $archiveName" - tar -xf "$archiveName" - - # locate pkg in zip - if [[ -z $pkgName ]]; then - # find first file starting with $name and ending with 'pkg' - findfiles=$(find "$tmpDir" -iname "*.pkg" -maxdepth 1 ) - filearray=( ${(f)findfiles} ) - if [[ ${#filearray} -eq 0 ]]; then - cleanupAndExit 20 "couldn't find pkg in zip $archiveName" - fi - archiveName="${filearray[1]}" - # it is now safe to overwrite archiveName for installFromPKG - printlog "found pkg: $archiveName" - else - # it is now safe to overwrite archiveName for installFromPKG - archiveName="$tmpDir/$pkgName" - fi - - # installFromPkgs - installFromPKG -} - -runUpdateTool() { - if [[ -x $updateTool ]]; then - printlog "running $updateTool $updateToolArguments" - if [[ -n $updateToolRunAsCurrentUser ]]; then - runAsUser $updateTool ${updateToolArguments} - else - $updateTool ${updateToolArguments} - fi - if [[ $? -ne 0 ]]; then - cleanupAndExit 15 "Error running $updateTool" - fi - else - printlog "couldn't find $updateTool, continuing normally" - return 1 - fi - return 0 -} - - - -# MARK: main code starts here +# MARK: application download and installation starts here # MARK: extract info from data From a0d93f179929c7a7fdf87b38d9c88d90c8ae80f8 Mon Sep 17 00:00:00 2001 From: Armin Briegel <1933192+scriptingosx@users.noreply.github.com> Date: Wed, 26 Aug 2020 20:05:39 +0200 Subject: [PATCH 27/46] added valuesfromarguments label so download info can be provided entirely from arguments --- Installomator.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Installomator.sh b/Installomator.sh index 6a7f957..9f6bdf4 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -1370,6 +1370,27 @@ microsoftdefenderatp) updateToolArguments=( --install --apps WDAV00 ) ;; +# this description is so you can provide all variables as arguments +# it will only check if the required variables are setting +valuesfromarguments) + if [[ -z $name ]]; then + printlog "need to provide 'name'" + exit 1 + fi + if [[ -z $type ]]; then + printlog "need to provide 'type'" + exit 1 + fi + if [[ -z $downloadURL ]]; then + printlog "need to provide 'downloadURL'" + exit 1 + fi + if [[ -z $expectedTeamID ]]; then + printlog "need to provide 'expectedTeamID'" + exit 1 + fi + ;; + # these descriptions exist for testing and are intentionally broken brokendownloadurl) From cd9247360adfc092a968733fa74aef57ae27d04d Mon Sep 17 00:00:00 2001 From: Armin Briegel <1933192+scriptingosx@users.noreply.github.com> Date: Thu, 17 Sep 2020 14:31:36 +0200 Subject: [PATCH 28/46] order of arguments now not relevant --- Installomator.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Installomator.sh b/Installomator.sh index 9f6bdf4..8536b31 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -507,16 +507,19 @@ elif [[ $1 == "/" ]]; then shift 3 fi -# if an argument contains an = character, send it to eval -while [[ -n $1 && $1 =~ ".*\=.*" ]]; do - printlog "setting variable from argument $1" - eval $1 +while [[ -n $1 ]]; do + if [[ $1 =~ ".*\=.*" ]]; then + # if an argument contains an = character, send it to eval + printlog "setting variable from argument $1" + eval $1 + else + # assume it's a label + label=$1 + fi # shift to next argument shift 1 done -label=${1:?"no label provided"} - printlog "################## Start Installomator" printlog "################## $label" From 933c51e00ffd26573416d88f2fad9538a436d3e6 Mon Sep 17 00:00:00 2001 From: Armin Briegel <1933192+scriptingosx@users.noreply.github.com> Date: Thu, 17 Sep 2020 14:41:18 +0200 Subject: [PATCH 29/46] added Tunnelblick --- Installomator.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Installomator.sh b/Installomator.sh index 1fbe6fa..1df486c 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -862,6 +862,13 @@ sizeup) downloadURL="https://www.irradiatedsoftware.com/download/SizeUp.zip" expectedTeamID="GVZ7RF955D" ;; +tunnelblick) + name="Tunnelblick" + type="dmg" + downloadURL=$(downloadURLFromGit TunnelBlick Tunnelblick ) + expectedTeamID="Z2SG5H3HC8" + ;; + # MARK: add new labels above here From 57da0331bf543a2980cc4da50ae5c4c8d575ff9f Mon Sep 17 00:00:00 2001 From: Armin Briegel <1933192+scriptingosx@users.noreply.github.com> Date: Mon, 21 Sep 2020 13:27:53 +0200 Subject: [PATCH 30/46] added yubikeymanagerqt, closes #75 --- Installomator.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Installomator.sh b/Installomator.sh index 7655e9c..3e71370 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -1209,6 +1209,13 @@ tunnelblick) downloadURL=$(downloadURLFromGit TunnelBlick Tunnelblick ) expectedTeamID="Z2SG5H3HC8" ;; +yubikeymanagerqt) + # credit: Tadayuki Onishi (@kenchan0130) + name="YubiKey Manager GUI" + type="pkg" + downloadURL="https://developers.yubico.com/yubikey-manager-qt/Releases/$(curl -sfL https://api.github.com/repos/Yubico/yubikey-manager-qt/releases/latest | awk -F '"' '/"tag_name"/ { print $4 }')-mac.pkg" + expectedTeamID="LQA3CS5MM7" + ;; # MARK: add new labels above here From dff5b8c61a46bb1893b03f3c94bf01a424f20ad6 Mon Sep 17 00:00:00 2001 From: Armin Briegel <1933192+scriptingosx@users.noreply.github.com> Date: Mon, 21 Sep 2020 14:00:34 +0200 Subject: [PATCH 31/46] changed brave team ID, closes #74 and #76 --- Installomator.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Installomator.sh b/Installomator.sh index 3e71370..de45388 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -982,7 +982,7 @@ brave) name="Brave Browser" type="dmg" downloadURL="https://laptop-updates.brave.com/latest/osx" - expectedTeamID="9BNSXJN65R" + expectedTeamID="KL8N8XSYF4" ;; umbrellaroamingclient) # credit: Tadayuki Onishi (@kenchan0130) From 0dd63eae75390cf9c1e11dc19e1c3c8bf35e27cc Mon Sep 17 00:00:00 2001 From: Armin Briegel <1933192+scriptingosx@users.noreply.github.com> Date: Mon, 21 Sep 2020 14:11:06 +0200 Subject: [PATCH 32/46] added skitch --- Installomator.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Installomator.sh b/Installomator.sh index de45388..7b653b7 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -1216,7 +1216,14 @@ yubikeymanagerqt) downloadURL="https://developers.yubico.com/yubikey-manager-qt/Releases/$(curl -sfL https://api.github.com/repos/Yubico/yubikey-manager-qt/releases/latest | awk -F '"' '/"tag_name"/ { print $4 }')-mac.pkg" expectedTeamID="LQA3CS5MM7" ;; - +skitch) + # credit: Isaac Ordonez, Mann consulting (@mannconsulting) + name="Skitch" + type="zip" + downloadURL=$(curl -fs -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Safari/605.1.15" https://evernote.com/products/skitch | grep -o "https://.*zip") + expectedTeamID="J8RPQ294UB" + Company="Evernote" + ;; # MARK: add new labels above here From 5bfeddbecf5a31bc9eceec8bcf87c4a396518bc0 Mon Sep 17 00:00:00 2001 From: Armin Briegel <1933192+scriptingosx@users.noreply.github.com> Date: Mon, 21 Sep 2020 14:13:30 +0200 Subject: [PATCH 33/46] updated Labels.txt --- Installomator.sh | 2 +- Labels.txt | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Installomator.sh b/Installomator.sh index 7b653b7..d07517e 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -499,7 +499,7 @@ fi # MARK: argument parsing if [[ $# -eq 0 ]]; then - grep -E '^[a-z0-9\-]*(\)|\|\\)$' "$0" | tr -d ')|\' | grep -v -E '^broken' | grep -v -E '^(longversion|version)$' | sort + grep -E '^[a-z0-9\-]*(\)|\|\\)$' "$0" | tr -d ')|\' | grep -v -E '^(broken.*|longversion|version|valuesfromarguments)$' | sort exit 0 elif [[ $1 == "/" ]]; then # jamf uses sends '/' as the first argument diff --git a/Labels.txt b/Labels.txt index 9807096..55e2607 100644 --- a/Labels.txt +++ b/Labels.txt @@ -83,6 +83,7 @@ santa sfsymbols signal sizeup +skitch slack snagit2020 sonos @@ -98,6 +99,7 @@ textmate things torbrowser tunnelbear +tunnelblick umbrellaroamingclient virtualbox visualstudiocode @@ -107,4 +109,5 @@ webexmeetings webexteams whatsapp wwdcformac +yubikeymanagerqt zoom From 977e46d33f12c1c7495203f8ce5a26fce1706512 Mon Sep 17 00:00:00 2001 From: Armin Briegel <1933192+scriptingosx@users.noreply.github.com> Date: Mon, 21 Sep 2020 15:02:45 +0200 Subject: [PATCH 34/46] changed zip de-compression from unzip to ditto --- Installomator.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Installomator.sh b/Installomator.sh index d07517e..255fa13 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -413,7 +413,12 @@ installFromZIP() { # note: when you expand a zip using tar in Mojave the expanded # app will never pass the spctl check - unzip -o -qq "$archiveName" + # unzip -o -qq "$archiveName" + + # note: githubdesktop fails spctl verification when expanded + # with unzip + + ditto -x -k "$archiveName" "$tmpDir" installAppWithPath "$tmpDir/$appName" } From 4a124f215194df6d63157cb97612840fcbf93a4f Mon Sep 17 00:00:00 2001 From: Armin Briegel <1933192+scriptingosx@users.noreply.github.com> Date: Tue, 22 Sep 2020 16:26:46 +0200 Subject: [PATCH 35/46] updated Brave downloadURL --- Installomator.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Installomator.sh b/Installomator.sh index 255fa13..6838e92 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -986,7 +986,7 @@ brave) # credit: @securitygeneration name="Brave Browser" type="dmg" - downloadURL="https://laptop-updates.brave.com/latest/osx" + downloadURL=$(curl --location --fail --silent "https://updates.bravesoftware.com/sparkle/Brave-Browser/stable/appcast.xml" | xpath '//rss/channel/item[1]/enclosure/@url' 2>/dev/null | cut -d '"' -f 2) expectedTeamID="KL8N8XSYF4" ;; umbrellaroamingclient) From edff222adc46946c6407aa7fe170624b4344dd12 Mon Sep 17 00:00:00 2001 From: Armin Briegel <1933192+scriptingosx@users.noreply.github.com> Date: Tue, 22 Sep 2020 16:26:59 +0200 Subject: [PATCH 36/46] updated README --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index 5cc5a36..8fa11a5 100644 --- a/README.md +++ b/README.md @@ -305,6 +305,27 @@ Depending on the application or pkg there are a few more variables you can or ne - `updateToolRunAsCurrentUser`: When this variable is set (any value), `$updateTool` will be run as the current user. Default is unset and +### Configuration from Arguments + +You can provide a configuration variable, such as `DEBUG` or `NOTIFY` as an argument in the form `VAR=value`. For example: + +``` +./Installomator.sh desktoppr DEBUG=0 NOTIFY=silent +``` + +Providing variables this way will override any variables set in the script. + +You can even provide _all_ the variables necessary for download and installation. Of course, without a label the argument parsing will fail, so I created a special label `valuesfromarguments` which only checks if the four required values are present: + +``` +./Installomator.sh name=desktoppr type=pkg downloadURL=https://github.com/scriptingosx/desktoppr/releases/download/v0.3/desktoppr-0.3.pkg expectedTeamID=JME5BW3F3R valuesfromarguments +``` + +The order of the variables and label is not relevant. But, when you provide more than one label, all but the _last_ label will be ignored. + +Providing all the variables this way might be useful for certain downloads that have a customized URL for each vendor/customer (like customized TeamView or Watchman Monitoring) or are local downloads. + + ## Frequently Asked Questions ### What if the latest version of the app is already installed? From 2c613803b55708dccea1d97f9198e62054ee6e53 Mon Sep 17 00:00:00 2001 From: Patrick Atoon Date: Sun, 11 Oct 2020 11:26:04 +0200 Subject: [PATCH 37/46] Add option to prompt user and finally kill The `prompt_user` option uses osascript to attempt to quit an app three times, which can sometimes fail. Added an option `prompt_user_then_kill` to attempt to quit twice, but kill the process if earlier quit attempts failed. --- Installomator.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Installomator.sh b/Installomator.sh index 6838e92..7dad481 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -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 @@ -249,12 +252,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) From 71fe13b311df1a9c93119b32dd6d8ca288ab0247 Mon Sep 17 00:00:00 2001 From: Eiichi Hosaka Date: Thu, 15 Oct 2020 09:30:29 +0900 Subject: [PATCH 38/46] added dialpad --- Installomator.sh | 6 ++++++ Labels.txt | 1 + 2 files changed, 7 insertions(+) diff --git a/Installomator.sh b/Installomator.sh index 6838e92..2ee25a6 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -1229,6 +1229,12 @@ skitch) expectedTeamID="J8RPQ294UB" Company="Evernote" ;; +dialpad) + name="Dialpad" + type="dmg" + downloadURL="https://storage.googleapis.com/dialpad_native/osx/Dialpad.dmg" + expectedTeamID="9V29MQSZ9M" + ;; # MARK: add new labels above here diff --git a/Labels.txt b/Labels.txt index 55e2607..614a383 100644 --- a/Labels.txt +++ b/Labels.txt @@ -23,6 +23,7 @@ cyberduck depnotify desktoppr detectxswift +dialpad discord docker dropbox From 3530130b487e04b980a4407c18538c78ac492207 Mon Sep 17 00:00:00 2001 From: Armin Briegel <1933192+scriptingosx@users.noreply.github.com> Date: Mon, 19 Oct 2020 09:00:08 +0200 Subject: [PATCH 39/46] added function to deal with new xpath tool in Big Sur --- Installomator.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Installomator.sh b/Installomator.sh index 6838e92..407f6d2 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -204,6 +204,16 @@ downloadURLFromGit() { # $1 git user name, $2 git repo name } +xpath() { + # the xpath tool changes in Big Sur and now requires the `-e` option + if [[ $(sw_vers -buildVersion) > "20A" ]]; then + /usr/bin/xpath -e $@ + else + /usr/bin/xpath $@ + fi +} + + getAppVersion() { # get all apps matching name applist=$(mdfind "kind:application $appName" -0 ) From 53f043ede512c0b2d4aaf5f764baaa90a879c854 Mon Sep 17 00:00:00 2001 From: Armin Briegel <1933192+scriptingosx@users.noreply.github.com> Date: Mon, 19 Oct 2020 09:12:17 +0200 Subject: [PATCH 40/46] updated CHANGELOG --- CHANGELOG.md | 2 ++ Installomator.sh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 28035fc..4f06aa3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ ## v0.4 - 2020- +- you can now set script variables as an argument in the form `VARIABLE=value`. More detail on this in the README file, 'Configuration from Arguments.' (#26, #50, #72, and #73) - change `downloadFromGit` to match file types better (#58) +- implemented a workaround for changed behavior of `xpath` in Big Sur (#80) ## v0.3 - 2020-07-23 diff --git a/Installomator.sh b/Installomator.sh index 407f6d2..10ef6f1 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -9,7 +9,7 @@ # with additional ideas and contribution from Isaac Ordonez, Mann consulting VERSION='0.4' -VERSIONDATE='20200826' +VERSIONDATE='20201019' export PATH=/usr/bin:/bin:/usr/sbin:/sbin From 125fadd4f468232d7646b396c5bffe2150c15e31 Mon Sep 17 00:00:00 2001 From: Armin Briegel <1933192+scriptingosx@users.noreply.github.com> Date: Mon, 19 Oct 2020 09:15:52 +0200 Subject: [PATCH 41/46] added credit --- Installomator.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/Installomator.sh b/Installomator.sh index 2ee25a6..a57f4c4 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -1230,6 +1230,7 @@ skitch) Company="Evernote" ;; dialpad) + # credit: @ehosaka name="Dialpad" type="dmg" downloadURL="https://storage.googleapis.com/dialpad_native/osx/Dialpad.dmg" From 76a38cdffc91574d78feefc50b18987bab9887bb Mon Sep 17 00:00:00 2001 From: Armin Briegel <1933192+scriptingosx@users.noreply.github.com> Date: Mon, 19 Oct 2020 09:36:48 +0200 Subject: [PATCH 42/46] fixed 8x8 download --- Installomator.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Installomator.sh b/Installomator.sh index 1a2d67f..d78b4c1 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -1121,9 +1121,9 @@ r) ;; 8x8) # credit: #D-A-James from MacAdmins Slack and Isaac Ordonez, Mann consulting (@mannconsulting) - name="8x8 - Virtual Office" + name="8x8 Work" type="dmg" - downloadURL=$(curl -fs https://support.8x8.com/cloud-phone-service/voice/virtual-office-desktop/download-virtual-office-desktop | grep -m 1 -o "http.*VOD.*.dmg") + downloadURL=$(curl -fs -L https://support.8x8.com/cloud-phone-service/voice/work-desktop/download-8x8-work-for-desktop | grep -m 1 -o "https.*dmg") expectedTeamID="FC967L3QRG" ;; egnyte) From c669250d8cc95ca3236e9e3c62abb86b3c1fe8c5 Mon Sep 17 00:00:00 2001 From: Armin Briegel <1933192+scriptingosx@users.noreply.github.com> Date: Mon, 19 Oct 2020 09:41:57 +0200 Subject: [PATCH 43/46] added amazonworkspaces --- Installomator.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Installomator.sh b/Installomator.sh index d78b4c1..b2fec38 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -1246,6 +1246,14 @@ dialpad) downloadURL="https://storage.googleapis.com/dialpad_native/osx/Dialpad.dmg" expectedTeamID="9V29MQSZ9M" ;; +amazonworkspaces) + # credit: Isaac Ordonez, Mann consulting (@mannconsulting) + name="Workspaces" + type="pkg" + downloadURL="https://d2td7dqidlhjx7.cloudfront.net/prod/global/osx/WorkSpaces.pkg" + expectedTeamID="94KV3E626L" + ;; + # MARK: add new labels above here From b99d3b50f431b33ba51a8ede071fcb698d5bab2b Mon Sep 17 00:00:00 2001 From: Armin Briegel <1933192+scriptingosx@users.noreply.github.com> Date: Mon, 19 Oct 2020 09:42:43 +0200 Subject: [PATCH 44/46] added apparency --- Installomator.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Installomator.sh b/Installomator.sh index b2fec38..aa5592a 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -1253,6 +1253,12 @@ amazonworkspaces) downloadURL="https://d2td7dqidlhjx7.cloudfront.net/prod/global/osx/WorkSpaces.pkg" expectedTeamID="94KV3E626L" ;; +apparency) + name="Apparency" + type="dmg" + downloadURL="https://www.mothersruin.com/software/downloads/Apparency.dmg" + expectedTeamID="936EB786NH" + ;; # MARK: add new labels above here From 2e207f6982f713f1ff6ea7917e2e1d0c74e21977 Mon Sep 17 00:00:00 2001 From: Armin Briegel <1933192+scriptingosx@users.noreply.github.com> Date: Mon, 19 Oct 2020 09:56:54 +0200 Subject: [PATCH 45/46] Update Labels.txt --- Labels.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Labels.txt b/Labels.txt index 614a383..b6433dc 100644 --- a/Labels.txt +++ b/Labels.txt @@ -5,6 +5,8 @@ adobereaderdc-install adobereaderdc-update airserver alfred +amazonworkspaces +apparency appcleaner aquaskk atom From 4d4e22379e622e6e1ec8a91f5003509cf8f474d2 Mon Sep 17 00:00:00 2001 From: Armin Briegel <1933192+scriptingosx@users.noreply.github.com> Date: Mon, 19 Oct 2020 10:21:45 +0200 Subject: [PATCH 46/46] Update CHANGELOG.md --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f06aa3..19fad69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,11 @@ -## v0.4 - 2020- +## v0.4 - 2020-10-19 - you can now set script variables as an argument in the form `VARIABLE=value`. More detail on this in the README file, 'Configuration from Arguments.' (#26, #50, #72, and #73) - change `downloadFromGit` to match file types better (#58) - implemented a workaround for changed behavior of `xpath` in Big Sur (#80) +- added an option `prompt_user_the_kill` to `BLOCKING_PROCESS_ACTION` which will kill the process after the third unsuccessful attempt to quit (#78, thanks Patrick Atoon @raptor399) +- added several new labels for total of 116 + ## v0.3 - 2020-07-23