mirror of
https://github.com/MLBZ521/MacAdmin.git
synced 2026-09-16 13:40:38 +01:00
v1.2 = Changed cp to mv
+ Changed `cp` to `mv` + Improved `sed` line to insert the $majorVersion into the installer.properties file + Added `sed` line to insert the version into the install script + Improved `sed` line to insert the version into the update script
This commit is contained in:
@@ -3,9 +3,9 @@
|
||||
###################################################################################################
|
||||
# Script Name: build_SPSS.sh
|
||||
# By: Zack Thompson / Created: 1/5/2018
|
||||
# Version: 1.1 / Updated: 1/8/2018 / By: ZT
|
||||
# Version: 1.2 / Updated: 1/26/2018 / By: ZT
|
||||
#
|
||||
# Description: This script uses munkpkg to build an SPSS package.
|
||||
# Description: This script uses munkipkg to build an SPSS package.
|
||||
#
|
||||
###################################################################################################
|
||||
|
||||
@@ -49,7 +49,7 @@ Actions:
|
||||
}
|
||||
|
||||
function munkiBuild {
|
||||
/usr/libexec/PlistBuddy -c "set identifier com.github.mlbz521.pkg.${softwareTitle}" "${scriptDirectory}"/build-info.plist
|
||||
/usr/libexec/PlistBuddy -c "set identifier edu.asu.pkg.${softwareTitle}" "${scriptDirectory}"/build-info.plist
|
||||
/usr/libexec/PlistBuddy -c "set name ${softwareTitle} Unlicensed-\${version}.pkg" "${scriptDirectory}"/build-info.plist
|
||||
/usr/libexec/PlistBuddy -c "set version $switch3" "${scriptDirectory}"/build-info.plist
|
||||
|
||||
@@ -60,7 +60,9 @@ function munkiBuild {
|
||||
}
|
||||
|
||||
function cleanUp {
|
||||
/bin/rm -Rf "${scriptDirectory}"/scripts/*
|
||||
/bin/rm -Rf "${scriptDirectory}"/scripts/postinstall
|
||||
/bin/rm -Rf "${scriptDirectory}"/scripts/preinstall
|
||||
/bin/mv "${scriptDirectory}"/scripts/* "${scriptDirectory}"/build/$switch3/
|
||||
}
|
||||
|
||||
##################################################
|
||||
@@ -73,20 +75,23 @@ case $switch1 in
|
||||
-install )
|
||||
/bin/cp "${scriptDirectory}"/uninstall_SPSS.sh "${scriptDirectory}"/scripts/preinstall
|
||||
/bin/cp "${scriptDirectory}"/install_SPSS.sh "${scriptDirectory}"/scripts/postinstall
|
||||
/bin/cp "${scriptDirectory}"/build/$switch3/* "${scriptDirectory}"/scripts/
|
||||
/bin/mv "${scriptDirectory}"/build/$switch3/* "${scriptDirectory}"/scripts/
|
||||
|
||||
# Set the desired install directory
|
||||
/usr/bin/sed -i '' 's,USER_INSTALL_DIR=,'"USER_INSTALL_DIR=/Applications/SPSS Statistics ${majorVersion}/"',' "${scriptDirectory}"/scripts/installer.properties
|
||||
LANG=C /usr/bin/sed -Ei '' 's,(#)?USER_INSTALL_DIR=.*,'"USER_INSTALL_DIR=/Applications/SPSS Statistics ${majorVersion}/"',' "${scriptDirectory}"/scripts/installer.properties
|
||||
|
||||
# Set the version in the install_SPSS.sh script
|
||||
LANG=C /usr/bin/sed -i '' 's/version=.*/'"version=${switch3}"'/' "${scriptDirectory}"/scripts/postinstall
|
||||
|
||||
# Function munkiBuild
|
||||
munkiBuild
|
||||
;;
|
||||
-update )
|
||||
/bin/cp "${scriptDirectory}"/update_SPSS.sh "${scriptDirectory}"/scripts/postinstall
|
||||
/bin/cp "${scriptDirectory}"/build/$switch3/* "${scriptDirectory}"/scripts/
|
||||
/bin/mv "${scriptDirectory}"/build/$switch3/* "${scriptDirectory}"/scripts/
|
||||
|
||||
# Set the version in the update_SPSS.sh script
|
||||
/usr/bin/sed -i '' 's/version=/'"version=${majorVersion}"'/' "${scriptDirectory}"/scripts/postinstall
|
||||
LANG=C /usr/bin/sed -i '' 's/version=.*/'"version=${switch3}"'/' "${scriptDirectory}"/scripts/postinstall
|
||||
|
||||
# Function munkiBuild
|
||||
munkiBuild
|
||||
|
||||
Reference in New Issue
Block a user