Merge pull request #200213 from Homebrew/bump-tidelift-1.14.0
[Homebrew/homebrew-cask.git] / Casks / w / winzip.rb
bloba718ad0239fc763f015c5ba89a5bd266ddeedde7
1 cask "winzip" do
2   version "12.0.7282"
3   sha256 "ac69719cdadcefcb75729831983d884f44e9e57e5cc608672b3d4a1c87963c0e"
5   url "https://download.winzip.com/winzipmacedition#{version.major}.dmg"
6   name "WinZip"
7   desc "File archiving tool"
8   homepage "https://www.winzip.com/mac/en/winzip.html"
10   livecheck do
11     url "https://www.winzip.com/en/download/"
12     regex(/href=.*?winzipmacedition[._-]?v?(\d+)\.dmg/i)
13     strategy :page_match do |page, regex|
14       major_version = page[regex, 1]
15       next if major_version.blank?
17       cask = CaskLoader.load(__FILE__)
18       download_url = "https://download.winzip.com/winzipmacedition#{major_version}.dmg"
19       Homebrew::Livecheck::Strategy::ExtractPlist.find_versions(cask:, url: download_url)[:matches].values
20     end
21   end
23   depends_on macos: ">= :sierra"
25   app "WinZip.app"
27   zap trash: [
28     "~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.winzip.winzip-mac.sfl*",
29     "~/Library/Caches/com.apple.helpd/Generated/WinZip Help*",
30     "~/Library/Caches/com.winzip.WinZip-Mac",
31     "~/Library/Logs/WinZip-Mac.log",
32     "~/Library/Preferences/com.winzip.WinZip-Mac.plist",
33     "~/Library/Saved Application State/com.winzip.WinZip-Mac.savedState",
34     "~/Library/Services/Winzip*.workflow",
35     "~/Library/WebKit/com.winzip.WinZip-Mac",
36   ]
37 end