cask "vnc-server" do version "7.13.1" sha256 "c521436373e5dcc45a874c80e0eb72d45a9740f5d5f49552a53c1fd8474d4ef3" url "https://downloads.realvnc.com/download/file/vnc.files/VNC-Server-#{version}-MacOSX-universal.pkg" name "Real VNC Server" desc "Remote desktop server application" homepage "https://www.realvnc.com/" livecheck do url "https://www.realvnc.com/en/connect/download/vnc/macos/" regex(%r{href=.*?/VNC[._-]Server[._-]v?(\d+(?:\.\d+)*)[._-]MacOSX[._-]universal\.pkg}i) end no_autobump! because: :requires_manual_review pkg "VNC-Server-#{version}-MacOSX-universal.pkg" uninstall_preflight do file = "/Applications/RealVNC/Uninstall VNC Server.app/Contents/Resources/uninstaller.sh" system_command file, print_stderr: false, sudo: true if File.exist?(file) end uninstall launchctl: [ "com.realvnc.vncserver", "com.realvnc.vncserver.peruser", ], pkgutil: "com.realvnc.vncserver.pkg" zap trash: [ "/Library/Logs/vncserver.log.bak", "~/Library/Saved Application State/com.realvnc.vnclicensewiz.savedState", "~/Library/Saved Application State/com.realvnc.vncserver.savedState", ] end