cask "foxit-pdf-editor" do version "13.1.4" sha256 "8e8224eb384776f8032925de4bfec8094d80cbceddde3e24042e3d4c07862cf1" url "https://cdn01.foxitsoftware.com/pub/foxit/phantomPDF/desktop/mac/#{version.major}.x/#{version}/FoxitPDFEditor#{version.no_dots}.L10N.Setup.pkg", verified: "cdn01.foxitsoftware.com/pub/foxit/phantomPDF/desktop/mac/" name "Foxit PDF Editor" desc "PDF Editor" homepage "https://www.foxit.com/pdf-editor/" livecheck do url "https://www.foxit.com/downloads/latest.html?product=Foxit-PDF-Editor-Mac&platform=Mac-OS-X&language=English" regex(/FoxitPDFEditor(\d{2})(\d)(\d)\.L10N\.Setup\.pkg/i) strategy :header_match do |headers, regex| match = headers["location"]&.match(regex) next if match.blank? "#{match[1]}.#{match[2]}.#{match[3]}" end end depends_on macos: ">= :sierra" pkg "FoxitPDFEditor#{version.no_dots}.L10N.Setup.pkg" uninstall launchctl: "com.foxit.PDFEditorUpdateService", pkgutil: "com.foxit.pkg.pdfeditor", delete: [ "/Applications/Foxit PDF Editor.app", "/Library/Application Support/Foxit Software/FoxitService/FoxitPDFEditorUpdateService.app", "/Library/LaunchDaemons/com.foxit.PDFEditorUpdateService.plist", ] zap trash: [ "~/Library/Application Support/Foxit Software/Foxit PDF Editor", "~/Library/Caches/com.foxit-software.Foxit PDF Editor", "~/Library/Preferences/com.foxit-software.Foxit PDF Editor.plist", ] end