cask 'virtualbox-beta' do version '5.1.23-116111' sha256 'e464415813fa471afb3c73a6e9d5227886371df026a597bd8b42ab4e526b93a1' 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