mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
Changed the installer format for ExpressVPN from pkg to zip and added a custom install script to handle extraction and installation. Updated the version, installer URL, script reference, and SHA256 in the output manifest to reflect the new release (12.1.0.12128).
21 lines
6.6 KiB
JSON
21 lines
6.6 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"version": "12.1.0.12128",
|
|
"queries": {
|
|
"exists": "SELECT 1 FROM apps WHERE bundle_identifier = 'com.expressvpn.ExpressVPN';"
|
|
},
|
|
"installer_url": "https://www.expressvpn.works/clients/mac/expressvpn-macos-universal-12.1.0.12128_release.zip",
|
|
"install_script_ref": "0772a67e",
|
|
"uninstall_script_ref": "01200536",
|
|
"sha256": "7605841cd443f55f8ba3938c273f93c6e47f74aa768a23757d01085de5ed8887",
|
|
"default_categories": [
|
|
"Productivity"
|
|
]
|
|
}
|
|
],
|
|
"refs": {
|
|
"01200536": "#!/bin/sh\n\n# variables\nLOGGED_IN_USER=$(scutil <<< \"show State:/Users/ConsoleUser\" | awk '/Name :/ { print $3 }')\n# functions\n\nquit_application() {\n local bundle_id=\"$1\"\n local timeout_duration=10\n\n # check if the application is running\n if ! osascript -e \"application id \\\"$bundle_id\\\" is running\" 2>/dev/null; then\n return\n fi\n\n local console_user\n console_user=$(stat -f \"%Su\" /dev/console)\n if [[ $EUID -eq 0 && \"$console_user\" == \"root\" ]]; then\n echo \"Not logged into a non-root GUI; skipping quitting application ID '$bundle_id'.\"\n return\n fi\n\n echo \"Quitting application '$bundle_id'...\"\n\n # try to quit the application within the timeout period\n local quit_success=false\n SECONDS=0\n while (( SECONDS < timeout_duration )); do\n if osascript -e \"tell application id \\\"$bundle_id\\\" to quit\" >/dev/null 2>&1; then\n if ! pgrep -f \"$bundle_id\" >/dev/null 2>&1; then\n echo \"Application '$bundle_id' quit successfully.\"\n quit_success=true\n break\n fi\n fi\n sleep 1\n done\n\n if [[ \"$quit_success\" = false ]]; then\n echo \"Application '$bundle_id' did not quit.\"\n fi\n}\n\n\nremove_launchctl_service() {\n local service=\"$1\"\n local booleans=(\"true\" \"false\")\n local plist_status\n local paths\n local should_sudo\n\n echo \"Removing launchctl service ${service}\"\n\n for should_sudo in \"${booleans[@]}\"; do\n plist_status=$(launchctl list \"${service}\" 2>/dev/null)\n\n if [[ $plist_status == \\{* ]]; then\n if [[ $should_sudo == \"true\" ]]; then\n sudo launchctl remove \"${service}\"\n else\n launchctl remove \"${service}\"\n fi\n sleep 1\n fi\n\n paths=(\n \"/Library/LaunchAgents/${service}.plist\"\n \"/Library/LaunchDaemons/${service}.plist\"\n )\n\n # if not using sudo, prepend the home directory to the paths\n if [[ $should_sudo == \"false\" ]]; then\n for i in \"${!paths[@]}\"; do\n paths[i]=\"${HOME}${paths[i]}\"\n done\n fi\n\n for path in \"${paths[@]}\"; do\n if [[ -e \"$path\" ]]; then\n if [[ $should_sudo == \"true\" ]]; then\n sudo rm -f -- \"$path\"\n else\n rm -f -- \"$path\"\n fi\n fi\n done\n done\n}\n\ntrash() {\n local logged_in_user=\"$1\"\n local target_file=\"$2\"\n local timestamp=\"$(date +%Y-%m-%d-%s)\"\n local rand=\"$(jot -r 1 0 99999)\"\n\n # replace ~ with /Users/$logged_in_user\n if [[ \"$target_file\" == ~* ]]; then\n target_file=\"/Users/$logged_in_user${target_file:1}\"\n fi\n\n local trash=\"/Users/$logged_in_user/.Trash\"\n local file_name=\"$(basename \"${target_file}\")\"\n\n if [[ -e \"$target_file\" ]]; then\n echo \"removing $target_file.\"\n mv -f \"$target_file\" \"$trash/${file_name}_${timestamp}_${rand}\"\n else\n echo \"$target_file doesn't exist.\"\n fi\n}\n\nremove_launchctl_service 'com.express.vpn.daemon'\nremove_launchctl_service 'com.express.vpn.installhelper'\nquit_application 'com.express.vpn'\nsudo rm -rf '/Applications/ExpressVPN.app'\ntrash $LOGGED_IN_USER '/Library/Application Support/com.express.vpn'\ntrash $LOGGED_IN_USER '/Library/Preferences/com.express.vpn'\ntrash $LOGGED_IN_USER '~/Library/Application Support/com.express.vpn'\ntrash $LOGGED_IN_USER '~/Library/Caches/com.express.vpn'\ntrash $LOGGED_IN_USER '~/Library/Preferences/com.express.vpn'\n",
|
|
"0772a67e": "#!/bin/sh\n\n# variables\nAPPDIR=\"/Applications/\"\nTMPDIR=$(dirname \"$(realpath $INSTALLER_PATH)\")\n\n# functions\n\nquit_application() {\n local bundle_id=\"$1\"\n local timeout_duration=10\n\n # check if the application is running\n if ! osascript -e \"application id \\\"$bundle_id\\\" is running\" 2>/dev/null; then\n return\n fi\n\n local console_user\n console_user=$(stat -f \"%Su\" /dev/console)\n if [[ $EUID -eq 0 && \"$console_user\" == \"root\" ]]; then\n echo \"Not logged into a non-root GUI; skipping quitting application ID '$bundle_id'.\"\n return\n fi\n\n echo \"Quitting application '$bundle_id'...\"\n\n # try to quit the application within the timeout period\n local quit_success=false\n SECONDS=0\n while (( SECONDS < timeout_duration )); do\n if osascript -e \"tell application id \\\"$bundle_id\\\" to quit\" >/dev/null 2>&1; then\n if ! pgrep -f \"$bundle_id\" >/dev/null 2>&1; then\n echo \"Application '$bundle_id' quit successfully.\"\n quit_success=true\n break\n fi\n fi\n sleep 1\n done\n\n if [[ \"$quit_success\" = false ]]; then\n echo \"Application '$bundle_id' did not quit.\"\n fi\n}\n\n# extract contents\nunzip \"$INSTALLER_PATH\" -d \"$TMPDIR\"\n\n# discover the installer app by finding any .app that contains an installer executable\nINSTALLER_APP=\"\"\nfor app in \"$TMPDIR\"/*.app; do\n if [ -d \"$app\" ] && [ -d \"$app/Contents/MacOS\" ]; then\n INSTALLER_APP=\"$app\"\n break\n fi\ndone\n\nif [ -z \"$INSTALLER_APP\" ] || [ ! -d \"$INSTALLER_APP\" ]; then\n echo \"Error: Installer app not found in $TMPDIR\"\n exit 1\nfi\n\n# Find the executable in Contents/MacOS/ - prefer ExpressVPN, fall back to any executable\nINSTALLER_EXECUTABLE=\"\"\nif [ -d \"$INSTALLER_APP/Contents/MacOS\" ]; then\n # Prefer the main ExpressVPN executable if it exists\n if [ -x \"$INSTALLER_APP/Contents/MacOS/ExpressVPN\" ]; then\n INSTALLER_EXECUTABLE=\"$INSTALLER_APP/Contents/MacOS/ExpressVPN\"\n else\n # Fall back to finding any executable with executable permissions\n INSTALLER_EXECUTABLE=$(/usr/bin/find \"$INSTALLER_APP/Contents/MacOS\" -type f -perm +111 -print -quit 2>/dev/null)\n fi\nfi\n\nif [ -z \"$INSTALLER_EXECUTABLE\" ] || [ ! -x \"$INSTALLER_EXECUTABLE\" ]; then\n echo \"Error: Installer executable not found in $INSTALLER_APP/Contents/MacOS\"\n exit 1\nfi\n\n# run the installer\nquit_application 'com.expressvpn.ExpressVPN'\n\"$INSTALLER_EXECUTABLE\"\nEXIT_CODE=$?\nif [ $EXIT_CODE -ne 0 ]; then\n echo \"Error: Installer exited with code $EXIT_CODE\"\n exit $EXIT_CODE\nfi\n\n# cleanup: remove the installer app after successful installation\nrm -rf \"$INSTALLER_APP\"\n\n"
|
|
}
|
|
}
|