cask "playonmac" do
  version "4.4.4"
  sha256 "7be6bee16d8df3e0caa5df6f647ac437a5c4d77ed7fa1b11a1db02edf9c66522"

  url "https://repository.playonmac.com/PlayOnMac/PlayOnMac_#{version}.dmg"
  name "PlayOnMac"
  desc "Allows installation and use of software designed for Windows"
  homepage "https://www.playonmac.com/"

  livecheck do
    url "https://www.playonmac.com/en/download.html"
    regex(%r{href=.*?/PlayOnMac_(\d+(?:\.\d+)*)\.dmg}i)
  end

  depends_on :macos

  app "PlayOnMac.app"

  zap trash: [
    "~/Library/PlayOnMac",
    "~/Library/Preferences/org.playonmac.playonmac.plist",
    "~/Library/Saved Application State/org.playonmac.playonmac.savedState",
    "~/PlayOnMac's virtual drives",
  ]
end
