#!/bin/sh # variables APPDIR="/Applications/" TMPDIR=$(dirname "$(realpath $INSTALLER_PATH)") # install pkg files CHOICE_XML=$(mktemp /tmp/choice_xml_XXX) cat << EOF > "$CHOICE_XML" attributeSetting 0 choiceAttribute selected choiceIdentifier com.microsoft.autoupdate EOF sudo installer -pkg "$TMPDIR"/Microsoft_Excel_16.88.24081116_Installer.pkg -target / -applyChoiceChangesXML "$CHOICE_XML"