cask 'virtualbox-beta' do version '5.1.25-117130' sha256 'e1e840206d2d7b2734452af75641cc7a2ed50a4ace59e4105927f5e7f8a86625' 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: ['--unattended'], sudo: true, }, pkgutil: 'org.virtualbox.pkg.*' zap delete: [ '/Library/Application Support/VirtualBox', '~/Library/VirtualBox', ], rmdir: '~/VirtualBox VMs' end