added pkgInZip functionality

This commit is contained in:
Armin Briegel
2020-04-30 12:32:52 +02:00
parent c0d133b2a8
commit ca30f3cdbe

View File

@@ -43,7 +43,7 @@ BLOCKING_PROCESS_ACTION=prompt_user
# - pkg # - pkg
# - zip # - zip
# - pkgInDmg # - pkgInDmg
# - pkgInZip (not yet implemented) # - pkgInZip (not yet tested)
# #
# - downloadURL: (required) # - downloadURL: (required)
# URL to download the dmg. # URL to download the dmg.
@@ -760,6 +760,23 @@ installPkgInDmg() {
installFromPKG installFromPKG
} }
installPkgInZip() {
# unzip the archive
echo "Unzipping $archiveName"
tar -xf "$archiveName"
# locate pkg in zip
if [[ -z $pkgName ]]; then
pkgName="$name.pkg"
fi
# it is now safe to overwrite archiveName for installFromPKG
archiveName="$tmpDir/$pkgName"
# installFromPkgs
installFromPKG
}
runUpdateTool() { runUpdateTool() {
if [[ -x $updateTool ]]; then if [[ -x $updateTool ]]; then
echo "running $updateTool $updateToolArguments" echo "running $updateTool $updateToolArguments"
@@ -897,6 +914,9 @@ case $type in
pkgInDmg) pkgInDmg)
installPkgInDmg installPkgInDmg
;; ;;
pkgInZip)
installPkgInZip
;;
*) *)
echo "Cannot handle type $type" echo "Cannot handle type $type"
cleanupAndExit 99 cleanupAndExit 99