fleet/server/mdm/maintainedapps/testdata/scripts/microsoft-excel_install.golden.sh
Roberto Dip c02af491c2
fix typos and ensure installers with choices work (#22800)
for #22774

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

<!-- Note that API documentation changes are now addressed by the
product design team. -->

- [x] Added/updated tests
- [x] Manual QA for all new/changed functionality
2024-10-09 18:24:25 -03:00

30 lines
740 B
Bash

#!/bin/sh
# variables
APPDIR="/Applications/"
TMPDIR=$(dirname "$(realpath $INSTALLER_PATH)")
# install pkg files
CHOICE_XML=$(mktemp /tmp/choice_xml_XXX)
cat << EOF > "$CHOICE_XML"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>attributeSetting</key>
<integer>0</integer>
<key>choiceAttribute</key>
<string>selected</string>
<key>choiceIdentifier</key>
<string>com.microsoft.autoupdate</string>
</dict>
</array>
</plist>
EOF
sudo installer -pkg "$TMPDIR"/Microsoft_Excel_16.88.24081116_Installer.pkg -target / -applyChoiceChangesXML "$CHOICE_XML"