cask 'virtualbox-beta' do version '5.1.23-116469' sha256 'a6bbfcbef90391499a36a81f4b6b23888e4ed08a72f734e9354ec76dbebbbcaf' url "https://www.virtualbox.org/download/testcase/VirtualBox-#{version}-OSX.dmg" name 'Oracle VirtualBox' homepage 'https://www.virtualbox.org/wiki/Testbuilds' auto_updates true pkg 'VirtualBox.pkg' uninstall_preflight do if File.exist?("#{HOMEBREW_PREFIX}/Caskroom/virtualbox-extension-pack-beta") system_command 'brew', args: ['cask', 'uninstall', 'virtualbox-extension-pack-beta'] end end uninstall script: { executable: 'VirtualBox_Uninstall.tool', args: %w[--unattended], }, pkgutil: 'org.virtualbox.pkg.*' zap delete: [ '/Library/Application Support/VirtualBox', '~/Library/VirtualBox', ], rmdir: '~/VirtualBox VMs' end