cask 'virtualbox-beta' do version '5.2.0_BETA1,117406' sha256 'a9585dcae981c542e5f26525a464d2987cf26ecacbd212e598d51ca231513f9f' url "http://download.virtualbox.org/virtualbox/#{version.before_comma}/VirtualBox-#{version.before_comma}-#{version.after_comma}-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