installerTool implemented

This commit is contained in:
Søren Theilgaard
2021-11-15 14:25:57 +01:00
parent 4aa7cd7793
commit 891dab08d4
7 changed files with 41 additions and 17 deletions

View File

@@ -1,6 +1,6 @@
## v0.8 ## v0.8
- New variables for labels that should be installaed using CLI: `CLIInstaller` and `CLIArguments`. See the label __adobecreativeclouddesktop__ to see it's use. - New variables for labels that should be installaed using CLI: `CLIInstaller` and `CLIArguments`. If the installer app is named differently thatn the installed app, then the variable `installerTool` can be use to name the app that should be located in the DMG or zip. See the label __adobecreativeclouddesktop__ to see its use.
## v0.7 ## v0.7

View File

@@ -379,13 +379,17 @@ Depending on the application or pkg there are a few more variables you can or ne
- `CLIInstaller`: - `CLIInstaller`:
- `CLIArguments`: - `CLIArguments`:
If the downloaded dmg is actually an installer that we can call using CLI, we can use these two variables for what to call. If the downloaded dmg is actually an installer that we can call using CLI, we can use these two variables for what to call.
We need to define `name` for the installed app (to be version checked), as well as `appName` for the installer binary. So Installomator will add the path to the folder of this binary, and it will be called like this: We need to define `name` for the installed app (to be version checked), as well as `installerTool` for the installer app (if named differently that `name`. Installomator will add the path to the folder/disk image with the binary, and it will be called like this:
`$CLIInstaller $CLIArguments` `$CLIInstaller $CLIArguments`
So for most installations `CLIInstaller` should contain the `appName` for the CLI call (if its the same). For most installations `CLIInstaller` should contain the `installerTool` for the CLI call (if its the same).
We can support a whole range of other software titles by implementing this. We can support a whole range of other software titles by implementing this.
See label adobecreativeclouddesktop. See label adobecreativeclouddesktop.
- `installerTool`:
Introduced as part of `CLIInstaller`. If the installer in the DMG or ZIP is named differently than the installed app, then this variable can be used to name the installer that should be located after mounting/expanding the downloaded archive.
See label adobecreativeclouddesktop
### Configuration from Arguments ### Configuration from Arguments
You can provide a configuration variable, such as `DEBUG` or `NOTIFY` as an argument in the form `VAR=value`. For example: You can provide a configuration variable, such as `DEBUG` or `NOTIFY` as an argument in the form `VAR=value`. For example:

View File

@@ -342,7 +342,7 @@ installAppWithPath() { # $1: path to app to install in $targetDir
# versioncheck # versioncheck
# credit: Søren Theilgaard (@theilgaard) # credit: Søren Theilgaard (@theilgaard)
appNewVersion=$(defaults read $appPath/Contents/Info.plist $versionKey) appNewVersion=$(defaults read $appPath/Contents/Info.plist $versionKey)
if [[ $appversion == $appNewVersion ]]; then if [[ -n $appNewVersion && $appversion == $appNewVersion ]]; then
printlog "Downloaded version of $name is $appNewVersion, same as installed." printlog "Downloaded version of $name is $appNewVersion, same as installed."
if [[ $INSTALL != "force" ]]; then if [[ $INSTALL != "force" ]]; then
message="$name, version $appNewVersion, is the latest version." message="$name, version $appNewVersion, is the latest version."
@@ -428,11 +428,7 @@ mountDMG() {
installFromDMG() { installFromDMG() {
mountDMG mountDMG
if [[ -z $CLIInstaller ]]; then
installAppWithPath "$dmgmount/$appName" installAppWithPath "$dmgmount/$appName"
else
installAppWithPath "$dmgmount/$CLIInstaller"
fi
} }
installFromPKG() { installFromPKG() {

View File

@@ -205,14 +205,20 @@ REOPEN="yes"
# #
# - CLIInstaller: # - CLIInstaller:
# - CLIArguments: # - CLIArguments:
# If the downloaded dmg is actually an installer that we can call using CLI, # If the downloaded dmg is actually an installer that we can call using CLI, we can
# we can use these two variables for what to call. # use these two variables for what to call.
# We need to define `name` for the installed app (to be version checked), as well # We need to define `name` for the installed app (to be version checked), as well as
# as `appName` for the installer binary. So Installomator will add the path to the # `installerTool` for the installer app (if named differently that `name`. Installomator
# folder of this binary, and it will be called like this: # will add the path to the folder/disk image with the binary, and it will be called like this:
# $CLIInstaller $CLIArguments `$CLIInstaller $CLIArguments`
# So for most installations `CLIInstaller` should contain the `appName` for the CLI # For most installations `CLIInstaller` should contain the `installerTool` for the CLI call
# call (if its the same). # (if its the same).
# We can support a whole range of other software titles by implementing this. # We can support a whole range of other software titles by implementing this.
# See label adobecreativeclouddesktop # See label adobecreativeclouddesktop
# #
# - installerTool:
# Introduced as part of `CLIInstaller`. If the installer in the DMG or ZIP is named
# differently than the installed app, then this variable can be used to name the
# installer that should be located after mounting/expanding the downloaded archive.
# See label adobecreativeclouddesktop
#

View File

@@ -9,6 +9,7 @@ adobecreativeclouddesktop)
fi fi
#downloadURL=$(curl -fs "https://helpx.adobe.com/download-install/kb/creative-cloud-desktop-app-download.html" | grep -o "https*.*dmg" | head -1) #downloadURL=$(curl -fs "https://helpx.adobe.com/download-install/kb/creative-cloud-desktop-app-download.html" | grep -o "https*.*dmg" | head -1)
appNewVersion=$(curl -fs "https://helpx.adobe.com/creative-cloud/release-note/cc-release-notes.html" | grep "mandatory" | head -1 | grep -o "Version *.* released" | cut -d " " -f2) appNewVersion=$(curl -fs "https://helpx.adobe.com/creative-cloud/release-note/cc-release-notes.html" | grep "mandatory" | head -1 | grep -o "Version *.* released" | cut -d " " -f2)
installerTool="Install.app"
CLIInstaller="Install.app/Contents/MacOS/Install" CLIInstaller="Install.app/Contents/MacOS/Install"
CLIArguments=(--mode=silent) CLIArguments=(--mode=silent)
expectedTeamID="JQ525L2MZD" expectedTeamID="JQ525L2MZD"

View File

@@ -0,0 +1,11 @@
forticlientvpn)
name="FortiClientUpdate"
type="dmg"
# This version of the installer only downloads another installer
downloadURL="https://links.fortinet.com/forticlient/mac/vpnagent"
appNewVersion=""
installerTool="FortiClientUpdate.app"
CLIInstaller="FortiClientUpdate.app/Contents/MacOS/FortiClientUpdate"
CLIArguments=( )
expectedTeamID="AH4XFXJ7DK"
;;

View File

@@ -202,6 +202,12 @@ if [[ $currentUser != "loginwindow" && $NOTIFY == "all" ]]; then
displaynotification "Installing $name" "Installation in progress …" 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 case $type in
dmg) dmg)
installFromDMG installFromDMG