Skip to content

Instantly share code, notes, and snippets.

@ehemmete
ehemmete / postinstall.sh
Last active March 17, 2020 19:36
Choices.xml postinstall.sh
#!/bin/sh
resourceLocation=$(/usr/bin/dirname "$0")
/usr/sbin/installer -applyChoiceChangesXML "${resourceLocation}/choicesForAnyConnectVPN.xml" -pkg "${resourceLocation}/AnyConnect.pkg" -target "$3"
/usr/bin/security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain "${resourceLocation}/SSL.crt"
<?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>
**************************
Running GenerateProductConfig
A higher version of the agent than 5.0.4.283 is already installed. Agent installation will be skipped
OS Name is MacOSX
OS Minor Version is 12
OS Minor Ver is >= 8
FMPInstall check - retval is 0
Checking if we have FMP already installed
FMP higher build number already installed on this machine. So, installer will skip FMP package installation.
UIInstall Check - retval is 0
<dict>
<key>attributeSetting</key>
<true/>
<key>choiceAttribute</key>
<string>visible</string>
<key>choiceIdentifier</key>
<string>choice_umbrella</string>
</dict>
<dict>
<key>attributeSetting</key>
<?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>1</integer>
<key>choiceAttribute</key>
<string>selected</string>
<key>choiceIdentifier</key>
<dict>
<key>attributeSetting</key>
<integer>0</integer>
<key>choiceAttribute</key>
<string>selected</string>
<key>choiceIdentifier</key>
<string>choice_umbrella</string>
</dict>
<?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>
</array>
</plist>
<dict>
<key>childItems</key>
<array/>
<key>choiceDescription</key>
<string>Installs the module that enables Umbrella Roaming Security.</string>
<key>choiceIdentifier</key>
<string>choice_umbrella</string>
<key>choiceIsEnabled</key>
<true/>
<key>choiceIsSelected</key>
@ehemmete
ehemmete / anyconnect_choices.xml
Created July 26, 2017 17:43
installer -showChoicesXML -pkg /path/to/AnyConnect4.3.pkg -target /
<?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>childItems</key>
<array>
<dict>
<key>childItems</key>
<array/>
#!/usr/bin/python
#serial_number=2016082201
#serial above is yyyymmdd## for when the script is updated
import subprocess
import sys
from SystemConfiguration import SCDynamicStoreCopyConsoleUser
### From https://gist.github.com/pudquick/1362a8908be01e23041d
import objc, CoreFoundation, Foundation