mirror of
https://github.com/mtan93/Installomator.git
synced 2026-03-08 05:31:53 +00:00
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:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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"
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user