Skip to content

Instantly share code, notes, and snippets.

@yig
Last active September 11, 2023 11:54
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • 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"'
@jrobinson-spk
Copy link

Looks like the Payload in recent versions is now encoded as pbzx. If you replace line 13 with:

pkgutil --expand-full Zoom.pkg Zoom_defanged

and remove line 15.

Now the zoom.us.app application package will be at Zoom_defanged/zoomus_pkg/Payload/zoom.us.app

@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