mirror of
https://github.com/mtan93/Installomator.git
synced 2026-04-05 06:13:15 +01:00
v0.5.0
This commit is contained in:
3297
Installomator.sh
3297
Installomator.sh
File diff suppressed because it is too large
Load Diff
@@ -20,11 +20,15 @@ fi
|
|||||||
|
|
||||||
# download the URL
|
# download the URL
|
||||||
echo "Downloading $downloadURL"
|
echo "Downloading $downloadURL"
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< Updated upstream
|
<<<<<<< Updated upstream
|
||||||
if ! archivePath=$(curl -fsL "$downloadURL" --remote-header-name --remote-name -w "%{filename_effective}"); then
|
if ! archivePath=$(curl -fsL "$downloadURL" --remote-header-name --remote-name -w "%{filename_effective}"); then
|
||||||
=======
|
=======
|
||||||
if ! downloadOut="$(curl -fsL "$downloadURL" --remote-header-name --remote-name -w "%{filename_effective}\n%{url_effective}\n")"; then
|
if ! downloadOut="$(curl -fsL "$downloadURL" --remote-header-name --remote-name -w "%{filename_effective}\n%{url_effective}\n")"; then
|
||||||
>>>>>>> Stashed changes
|
>>>>>>> Stashed changes
|
||||||
|
=======
|
||||||
|
if ! downloadOut="$(curl -fsL "$downloadURL" --remote-header-name --remote-name -w "%{filename_effective}\n%{url_effective}\n")"; then
|
||||||
|
>>>>>>> 4932ea6a3186d902d88c9bb5a3774c6ff81b1608
|
||||||
echo "error downloading $downloadURL"
|
echo "error downloading $downloadURL"
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
@@ -40,6 +44,7 @@ xpath() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< Updated upstream
|
<<<<<<< Updated upstream
|
||||||
#archivePath=$(find $tmpDir -print )
|
#archivePath=$(find $tmpDir -print )
|
||||||
echo "archivePath: $archivePath"
|
echo "archivePath: $archivePath"
|
||||||
@@ -77,6 +82,38 @@ archiveName=${archivePath##*/}
|
|||||||
echo "archiveName: $archiveName"
|
echo "archiveName: $archiveName"
|
||||||
mv $archiveTempName $archiveName
|
mv $archiveTempName $archiveName
|
||||||
>>>>>>> Stashed changes
|
>>>>>>> Stashed changes
|
||||||
|
=======
|
||||||
|
pkgInvestigation() {
|
||||||
|
echo "Package found"
|
||||||
|
teamID=$(spctl -a -vv -t install "$archiveName" 2>&1 | awk '/origin=/ {print $NF }' | tr -d '()' )
|
||||||
|
echo "For PKGs it's advised to find packageID for version checking"
|
||||||
|
|
||||||
|
pkgutil --expand "$pkgPath" "$archiveName"_pkg
|
||||||
|
cat "$archiveName"_pkg/Distribution | xpath '//installer-gui-script/pkg-ref[@id][@version]' 2>/dev/null
|
||||||
|
packageID="$(cat "$archiveName"_pkg/Distribution | xpath '//installer-gui-script/pkg-ref[@id][@version]' 2>/dev/null | tr ' ' '\n' | grep -i "id" | cut -d \" -f 2)"
|
||||||
|
rm -r "$archiveName"_pkg
|
||||||
|
echo "$packageID"
|
||||||
|
echo "Above is the possible packageIDs that can be used, and the correct one is probably one of those with a version number. More investigation might be needed to figure out correct packageID if several are displayed."
|
||||||
|
}
|
||||||
|
appInvestigation() {
|
||||||
|
appName=${appPath##*/}
|
||||||
|
|
||||||
|
# verify with spctl
|
||||||
|
echo "Verifying: $appPath"
|
||||||
|
if ! teamID=$(spctl -a -vv "$appPath" 2>&1 | awk '/origin=/ {print $NF }' | tr -d '()' ); then
|
||||||
|
echo "Error verifying $appPath"
|
||||||
|
exit 4
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
echo "downloadOut: ${downloadOut}"
|
||||||
|
archiveTempName=$( echo "${downloadOut}" | head -1 )
|
||||||
|
echo "archiveTempName: $archiveTempName"
|
||||||
|
archivePath=$( echo "${downloadOut}" | tail -1 )
|
||||||
|
echo "archivePath: $archivePath"
|
||||||
|
archiveName=${archivePath##*/}
|
||||||
|
echo "archiveName: $archiveName"
|
||||||
|
mv $archiveTempName $archiveName
|
||||||
|
>>>>>>> 4932ea6a3186d902d88c9bb5a3774c6ff81b1608
|
||||||
name=${archiveName%.*}
|
name=${archiveName%.*}
|
||||||
echo "name: $name"
|
echo "name: $name"
|
||||||
archiveExt=${archiveName##*.}
|
archiveExt=${archiveName##*.}
|
||||||
@@ -85,6 +122,7 @@ identifier=$(echo $name | tr '[:upper:]' '[:lower:]')
|
|||||||
echo "identifier: $identifier"
|
echo "identifier: $identifier"
|
||||||
|
|
||||||
if [ "$archiveExt" = "pkg" ]; then
|
if [ "$archiveExt" = "pkg" ]; then
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< Updated upstream
|
<<<<<<< Updated upstream
|
||||||
echo "Package found"
|
echo "Package found"
|
||||||
teamID=$(spctl -a -vv -t install "$archiveName" 2>&1 | awk '/origin=/ {print $NF }' | tr -d '()' )
|
teamID=$(spctl -a -vv -t install "$archiveName" 2>&1 | awk '/origin=/ {print $NF }' | tr -d '()' )
|
||||||
@@ -99,6 +137,10 @@ if [ "$archiveExt" = "pkg" ]; then
|
|||||||
pkgPath="$archiveName"
|
pkgPath="$archiveName"
|
||||||
pkgInvestigation
|
pkgInvestigation
|
||||||
>>>>>>> Stashed changes
|
>>>>>>> Stashed changes
|
||||||
|
=======
|
||||||
|
pkgPath="$archiveName"
|
||||||
|
pkgInvestigation
|
||||||
|
>>>>>>> 4932ea6a3186d902d88c9bb5a3774c6ff81b1608
|
||||||
elif [ "$archiveExt" = "dmg" ]; then
|
elif [ "$archiveExt" = "dmg" ]; then
|
||||||
echo "Diskimage found"
|
echo "Diskimage found"
|
||||||
# mount the dmg
|
# mount the dmg
|
||||||
@@ -140,11 +182,15 @@ elif [ "$archiveExt" = "zip" ] || [ "$archiveExt" = "tbz" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< Updated upstream
|
<<<<<<< Updated upstream
|
||||||
echo "appNewVersion is often difficult to find. Can sometimes be found in the filename, but also on a web page."
|
echo "appNewVersion is often difficult to find. Can sometimes be found in the filename, but also on a web page."
|
||||||
=======
|
=======
|
||||||
echo "appNewVersion is often difficult to find. Can sometimes be found in the filename, but also on a web page. See archivePath above if link contains information about this."
|
echo "appNewVersion is often difficult to find. Can sometimes be found in the filename, but also on a web page. See archivePath above if link contains information about this."
|
||||||
>>>>>>> Stashed changes
|
>>>>>>> Stashed changes
|
||||||
|
=======
|
||||||
|
echo "appNewVersion is often difficult to find. Can sometimes be found in the filename, but also on a web page. See archivePath above if link contains information about this."
|
||||||
|
>>>>>>> 4932ea6a3186d902d88c9bb5a3774c6ff81b1608
|
||||||
echo
|
echo
|
||||||
echo "$identifier)"
|
echo "$identifier)"
|
||||||
echo " name=\"$name\""
|
echo " name=\"$name\""
|
||||||
|
|||||||
Reference in New Issue
Block a user