Created
December 9, 2022 23:44
-
-
Save rtrouton/1eb5bed2fb68bdc69ccbd9f71d337b56 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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"> | |
<dict> | |
<key>Description</key> | |
<string>Downloads the current release version of the Global Protect VPN client and builds an installer package which uninstalls Global Protect.</string> | |
<key>Identifier</key> | |
<string>com.company.pkg.GlobalProtect.uninstall</string> | |
<key>Input</key> | |
<dict> | |
<key>NAME</key> | |
<string>GlobalProtect</string> | |
<key>VENDOR</key> | |
<string>PaloAlto</string> | |
<key>SOFTWARETITLE1</key> | |
<string>GlobalProtect</string> | |
<key>SOFTWARETITLE2</key> | |
<string>Uninstaller</string> | |
</dict> | |
<key>MinimumVersion</key> | |
<string>1.0.0</string> | |
<key>ParentRecipe</key> | |
<string>com.company.download.GlobalProtect</string> | |
<key>Process</key> | |
<array> | |
<dict> | |
<key>Arguments</key> | |
<dict> | |
<key>destination_path</key> | |
<string>%RECIPE_CACHE_DIR%/unpack</string> | |
<key>flat_pkg_path</key> | |
<string>%pathname%</string> | |
</dict> | |
<key>Processor</key> | |
<string>FlatPkgUnpacker</string> | |
</dict> | |
<dict> | |
<key>Arguments</key> | |
<dict> | |
<key>pattern</key> | |
<string>%RECIPE_CACHE_DIR%/unpack/*gp.pkg</string> | |
</dict> | |
<key>Processor</key> | |
<string>FileFinder</string> | |
</dict> | |
<dict> | |
<key>Arguments</key> | |
<dict> | |
<key>destination_path</key> | |
<string>%RECIPE_CACHE_DIR%/payload/GlobalProtect.app</string> | |
<key>pkg_payload_path</key> | |
<string>%found_filename%/Payload</string> | |
</dict> | |
<key>Processor</key> | |
<string>PkgPayloadUnpacker</string> | |
</dict> | |
<dict> | |
<key>Arguments</key> | |
<dict> | |
<key>input_plist_path</key> | |
<string>%RECIPE_CACHE_DIR%/payload/GlobalProtect.app/Contents/Info.plist</string> | |
<key>plist_version_key</key> | |
<string>CFBundleShortVersionString</string> | |
</dict> | |
<key>Processor</key> | |
<string>Versioner</string> | |
</dict> | |
<dict> | |
<key>Processor</key> | |
<string>PkgRootCreator</string> | |
<key>Arguments</key> | |
<dict> | |
<key>pkgroot</key> | |
<string>%RECIPE_CACHE_DIR%/pkgroot</string> | |
<key>pkgdirs</key> | |
<dict> | |
<key>Scripts</key> | |
<string>0755</string> | |
</dict> | |
</dict> | |
</dict> | |
<dict> | |
<key>Processor</key> | |
<string>FileMover</string> | |
<key>Arguments</key> | |
<dict> | |
<key>source</key> | |
<string>%RECIPE_CACHE_DIR%/pkgroot/Scripts</string> | |
<key>target</key> | |
<string>%RECIPE_CACHE_DIR%/Scripts</string> | |
</dict> | |
</dict> | |
<dict> | |
<key>Processor</key> | |
<string>PkgCopier</string> | |
<key>Arguments</key> | |
<dict> | |
<key>source_pkg</key> | |
<string>%pathname%</string> | |
<key>pkg_path</key> | |
<string>%RECIPE_CACHE_DIR%/Scripts/GlobalProtect.pkg</string> | |
</dict> | |
</dict> | |
<dict> | |
<key>Processor</key> | |
<string>FileCreator</string> | |
<key>Arguments</key> | |
<dict> | |
<key>file_path</key> | |
<string>%RECIPE_CACHE_DIR%/Scripts/uninstall_global_protect.xml</string> | |
<key>file_mode</key> | |
<string>0755</string> | |
<key>file_content</key> | |
<string><?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> | |
<string>second</string> | |
</dict> | |
<dict> | |
<key>attributeSetting</key> | |
<integer>1</integer> | |
<key>choiceAttribute</key> | |
<string>selected</string> | |
<key>choiceIdentifier</key> | |
<string>com.paloaltonetworks.globalprotect.uninstall.pkg</string> | |
</dict> | |
</array> | |
</plist></string> | |
</dict> | |
</dict> | |
<dict> | |
<key>Processor</key> | |
<string>FileCreator</string> | |
<key>Arguments</key> | |
<dict> | |
<key>file_path</key> | |
<string>%RECIPE_CACHE_DIR%/Scripts/postinstall</string> | |
<key>file_mode</key> | |
<string>0755</string> | |
<key>file_content</key> | |
<string>#!/bin/bash | |
PKG="${0%/*}/GlobalProtect.pkg" | |
ChoiceChangesXMLFile="${0%/*}/uninstall_global_protect.xml" | |
ERROR=0 | |
if [[ -f "$PKG" ]]; then | |
/usr/sbin/installer -pkg "$PKG" -applyChoiceChangesXML "$ChoiceChangesXMLFile" -target "$3" | |
if [[ $? -ne 0 ]]; then | |
/usr/bin/logger -t "${0##*/}" "ERROR! Installation of package $PKG failed" | |
ERROR=1 | |
fi | |
else | |
/usr/bin/logger -t "${0##*/}" "ERROR! Package $PKG not found" | |
ERROR=1 | |
fi | |
exit $ERROR</string> | |
</dict> | |
</dict> | |
<dict> | |
<key>Processor</key> | |
<string>PkgCreator</string> | |
<key>Arguments</key> | |
<dict> | |
<key>pkg_request</key> | |
<dict> | |
<key>pkgroot</key> | |
<string>%RECIPE_CACHE_DIR%/pkgroot</string> | |
<key>pkgname</key> | |
<string>%VENDOR%_%SOFTWARETITLE1%_%SOFTWARETITLE2%_%version%</string> | |
<key>pkgtype</key> | |
<string>flat</string> | |
<key>id</key> | |
<string>com.company.GlobalProtectUninstall.pkg</string> | |
<key>options</key> | |
<string>purge_ds_store</string> | |
<key>scripts</key> | |
<string>Scripts</string> | |
<key>version</key> | |
<string>%version%</string> | |
</dict> | |
</dict> | |
</dict> | |
<dict> | |
<key>Arguments</key> | |
<dict> | |
<key>path_list</key> | |
<array> | |
<string>%RECIPE_CACHE_DIR%/pkgroot</string> | |
<string>%RECIPE_CACHE_DIR%/payload</string> | |
<string>%RECIPE_CACHE_DIR%/Scripts</string> | |
<string>%RECIPE_CACHE_DIR%/unpack</string> | |
</array> | |
</dict> | |
<key>Processor</key> | |
<string>PathDeleter</string> | |
</dict> | |
</array> | |
</dict> | |
</plist> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment