Skip to content

Instantly share code, notes, and snippets.

@yig
Last active September 11, 2023 11:54
Show Gist options
  • Save yig/af5bbb054bb9c4de39abc9156e6863e1 to your computer and use it in GitHub Desktop.
Save yig/af5bbb054bb9c4de39abc9156e6863e1 to your computer and use it in GitHub Desktop.
Defang the macOS Zoom Installer. Extracts a .app that can be dragged to /Applications.
#!/bin/sh
## Author: Yotam Gingold
## License: CC0 (public domain) https://creativecommons.org/share-your-work/public-domain/cc0/
## URL: https://gist.github.com/yig/af5bbb054bb9c4de39abc9156e6863e1/
## Download the latest Zoom installer.
echo "==> Downloading the latest Zoom installer."
cd ~/Downloads
## Intel:
# curl -LO 'https://zoom.us/client/latest/Zoom.pkg'
## Apple Silicon:
curl -L 'https://zoom.us/client/latest/zoomusInstallerFull.pkg?archType=arm64' -o 'Zoom.pkg'
## Expand the package. This is the mysterious part. The rest is moving files out of the unpacked directories.
echo "==> Expanding the package."
pkgutil --expand-full Zoom.pkg Zoom_defanged
(cd Zoom_defanged && mv zoomus.pkg zoomus_pkg)
echo '==> Congratulations! Open "Zoom_defanged/zoomus_pkg" and drag "zoom.us.app" to your "/Applications" folder.'
echo "As far as I can tell, you don't need the 'ZoomUsPlugIn.plugin' in the 'Scripts' folder."
echo 'It seems to automatically click the "Open with Zoom" link when you open a zoom meeting link in Safari.'
echo "I don't think Chrome uses it at all."
open "Zoom_defanged/zoomus_pkg/Payload"
echo "You can delete 'Zoom.pkg' and 'Zoom_defanged' from your Downloads folder."
## Some stuff the postinstall script does you may want to also do, to cleanup files
## installed from old versions of zoom:
echo "==> Optionally run these lines to delete things old versions of things zoom installed."
echo '\\rm -rfv "~/Library/Application Support/zoom.us/Plugins/"'
echo '\\rm -rfv "/Library/Internet Plug-Ins/ZoomUsPlugIn.plugin"'
echo '\\rm -rfv "~/Library/Internet Plug-Ins/ZoomUsPlugIn.plugin"'
echo '\\rm -rfv "/Library/Extensions/ZoomAudioDevice.kext"'
echo '\\rm -rfv "/Library/PrivilegedHelperTools/us.zoom.ZoomDaemon"'
@yig
Copy link
Author

yig commented Jan 11, 2023

Thanks! I implemented your suggested changes. I've been using the script successfully without that, including today, but I like them. The curl URL for Apple Silicon is different. That change is reflected in this updated script (with a comment if you want the x86 version).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment