excalidrawz 1.2.5
[Homebrew/homebrew-cask.git] / Casks / a / apple-hewlett-packard-printer-drivers.rb
blob865016263f93cd946bb8f470438c3f2700469ff8
1 cask "apple-hewlett-packard-printer-drivers" do
2   version "5.1.1,2021,071-46903-20211101-0BD2764A-901C-41BA-9573-C17B8FDC4D90"
3   sha256 "523836b630431bc39b0170a17099099d6f821ef62ff29e6ec64ebb69b9954133"
5   url "https://updates.cdn-apple.com/#{version.csv.second}/macos/#{version.csv.third}/HewlettPackardPrinterDrivers.dmg",
6       verified: "updates.cdn-apple.com/"
7   name "HP Printer Drivers"
8   desc "HP printing and scanning software"
9   homepage "https://support.apple.com/kb/DL1888"
11   livecheck do
12     url :homepage
13     strategy :page_match do |page|
14       version = page.match(/title:.*?v?(\d+(?:\.\d+)+)\s*Printer\s*Software\s*Update/i)
15       metaurl = page.match(%r{href=.*/(\d+)/macos/([\dA-F]+(?:-[\dA-F]+)*)/HewlettPackardPrinterDrivers\.dmg}i)
16       next if version.blank? || metaurl.blank?
18       "#{version[1]},#{metaurl[1]},#{metaurl[2]}"
19     end
20   end
22   pkg "HewlettPackardPrinterDrivers.pkg"
24   uninstall quit:    [
25               "com.hp.aio.faxarchive",
26               "com.hp.customer.uploader",
27               "com.hp.devicemodel.hpdot4d",
28               "com.hp.devicemonitor.*",
29               "com.hp.dm.hpdot4d",
30               "com.hp.event.status.handler.generic",
31               "com.hp.events.*",
32               "com.hp.HP-Scanner",
33               "com.hp.HP_LaserJet_Professional_Utility",
34               "com.hp.HPAiOScan",
35               "com.hp.HPAiOTulip",
36               "com.hp.hpalerts.plugin.*",
37               "com.hp.HPDOT4Scan",
38               "com.hp.HPM1210_1130.HP_LaserJet_Professional_Utility",
39               "com.hp.HPSOAPScan",
40               "com.hp.LEDMScan",
41               "com.hp.printerutility.*",
42               "com.hp.productresearch.*",
43               "com.hp.scan.*",
44               "com.hp.scanModule.*",
45               "com.hp.ScanService",
46             ],
47             signal:  ["TERM", "com.hp.printerutility"],
48             kext:    "com.hp.kext.io.enabler.compound",
49             pkgutil: [
50               "com.apple.pkg.HewlettPackardPrinterDrivers",
51               "com.apple.pkg.HewlettPackardPrinterDriversPreInstall",
52             ],
53             delete:  [
54               "/Library/Extensions/hp_io_enabler_compound.kext",
55               "/Library/Printers/hp/hpio",
56             ],
57             rmdir:   "/Library/Printers/hp"
59   zap trash: [
60         "~/Library/Application Support/HP/Product Improvement Study",
61         "~/Library/Logs/hp/HP Product Research.log",
62         "~/Library/Preferences/com.hp.HP-Scanner.plist",
63         "~/Library/Preferences/com.hp.printerutility.plist",
64         "~/Library/Preferences/com.hp.scanModule.plist",
65         "~/Library/Preferences/com.hp.scanModule3.plist",
66         "~/Library/Saved Application State/com.hp.printerutility.savedState",
67       ],
68       rmdir: [
69         "~/Library/Application Support/HP",
70         "~/Library/Logs/hp",
71       ]
73   caveats do
74     reboot
75   end
76 end