cask 'vnc-server' do version '6.3.1' sha256 '7fa075d50cf9d88a8c0cfd5a121c48b689a567e6a65d5f8b2601ae1718c0640a' url "https://www.realvnc.com/download/file/vnc.files/VNC-Server-#{version}-MacOSX-x86_64.pkg" name 'Real VNC Server' homepage 'https://www.realvnc.com/' pkg "VNC-Server-#{version}-MacOSX-x86_64.pkg" uninstall_preflight do system_command '/Applications/RealVNC/Uninstall VNC Server.app/Contents/Resources/uninstaller.sh', print_stderr: false, sudo: true 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