pkgName can be searched for.

In `logitechoptions` we do not know what the app-name is that contains the pkg in the bundle-package, so now we only give the name of the pkg, and then Installomator will find it.
This commit is contained in:
Søren Theilgaard
2022-01-09 10:42:45 +01:00
parent 130764696d
commit 9b47ed2e3f
4 changed files with 31 additions and 7 deletions

View File

@@ -1,6 +1,7 @@
## v9?
- We have moved the root check to the beginning of the script, and improved DEBUG handling with two different modes. `DEBUG=0` is still for production, and `1` is still for the DEBUG we previously knew downloading to the directory it is running from, but `2` will download to temporary folder, will detect updates, but will not install anything, but it will notify the user (almost as running the script without root before).
- `pkgName` can now be searched for. An example is logitechoptions.
## v8.0

View File

@@ -543,8 +543,19 @@ installPkgInDmg() {
archiveName="${filearray[1]}"
printlog "found pkg: $archiveName"
else
if ls "$tmpDir/$pkgName" ; then
archiveName="$tmpDir/$pkgName"
else
# try searching for pkg
findfiles=$(find "$tmpDir" -iname "$pkgName")
filearray=( ${(f)findfiles} )
if [[ ${#filearray} -eq 0 ]]; then
cleanupAndExit 20 "couldn't find pkg “$pkgName” in zip $archiveName"
fi
# it is now safe to overwrite archiveName for installFromPKG
archiveName="$dmgmount/$pkgName"
archiveName="${filearray[1]}"
printlog "found pkg: $archiveName"
fi
fi
# installFromPkgs
@@ -564,12 +575,23 @@ installPkgInZip() {
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
archiveName="${filearray[1]}"
printlog "found pkg: $archiveName"
else
# it is now safe to overwrite archiveName for installFromPKG
if ls "$tmpDir/$pkgName" ; then
archiveName="$tmpDir/$pkgName"
else
# try searching for pkg
findfiles=$(find "$tmpDir" -iname "$pkgName")
filearray=( ${(f)findfiles} )
if [[ ${#filearray} -eq 0 ]]; then
cleanupAndExit 20 "couldn't find pkg “$pkgName” in zip $archiveName"
fi
# it is now safe to overwrite archiveName for installFromPKG
archiveName="${filearray[1]}"
printlog "found pkg: $archiveName"
fi
fi
# installFromPkgs

View File

@@ -190,7 +190,7 @@ REOPEN="yes"
# blockingProcesses=( NONE )
#
# - pkgName: (optional, only used for pkgInDmg, dmgInZip, and appInDmgInZip)
# File name of the pkg/dmg file _inside_ the dmg or zip
# File name or path to the pkg/dmg file _inside_ the dmg or zip.
# When not given the pkgName is derived from the $name
#
# - updateTool:

View File

@@ -3,6 +3,7 @@ logitechoptions)
type="pkgInZip"
downloadURL=$(curl -fs https://support.logi.com/api/v2/help_center/en-us/articles.json | tr "," "\n" | grep -A 10 "macOS" | grep -oie "https.*/.*/options.*\.zip")
appNewVersion=$(curl -fs https://support.logi.com/api/v2/help_center/en-us/articles.json | tr "," "\n" | grep -A 10 "macOS" | grep -B 5 -ie "https.*/.*/options.*\.zip" | grep "Software Version" | sed 's/\\u[0-9a-z][0-9a-z][0-9a-z][0-9a-z]//g' | grep -ioe "Software Version.*[0-9.]*" | tr "/" "\n" | grep -oe "[0-9.]*" | head -1)
pkgName="LogiMgr Installer [0-9.]*.app/Contents/Resources/LogiMgr.pkg"
#pkgName="LogiMgr Installer "*".app/Contents/Resources/LogiMgr.pkg"
pkgName=LogiMgr.pkg
expectedTeamID="QED4VVPZWA"
;;