excalidrawz 1.2.5
[Homebrew/homebrew-cask.git] / Casks / l / logitech-options.rb
blob0388f8a4932fb40fe1c491a893fe3819fed3a56d
1 cask "logitech-options" do
2   on_sierra :or_older do
3     version "7.14.77"
4     sha256 "e4df55642e04139fc93d955e949bf736196a404ed067d87f8de7eb9ac9117ece"
6     url "https://web.archive.org/web/20220113114711/https://download01.logi.com/web/ftp/pub/techsupport/options/Options_#{version}.zip",
7         verified: "web.archive.org/web/20220113114711/https://download01.logi.com/web/ftp/pub/techsupport/options/"
9     livecheck do
10       url "https://support.logi.com/api/v2/help_center/en-us/articles.json?label_names=webcontent=productdownload,webos=mac-macos-x-10.12"
11       regex(%r{/Options[._-]?v?(\d+(?:\.\d+)+)\.zip}i)
12     end
14     pkg "LogiMgr Installer #{version}.app/Contents/Resources/LogiMgr.mpkg"
15   end
16   on_high_sierra do
17     version "8.30.293"
18     sha256 "db5f2cd94960223bdf74f0db6fc009f82f80928fe2ce849202754bbdb720eb87"
20     url "https://web.archive.org/web/20210208002741/https://download01.logi.com/web/ftp/pub/techsupport/options/Options_#{version}.zip",
21         verified: "web.archive.org/web/20210208002741/https://download01.logi.com/web/ftp/pub/techsupport/options/"
23     livecheck do
24       url "https://support.logi.com/api/v2/help_center/en-us/articles.json?label_names=webcontent=productdownload,webos=mac-macos-x-10.13"
25       regex(%r{/Options[._-]?v?(\d+(?:\.\d+)+)\.zip}i)
26     end
28     pkg "LogiMgr Installer #{version}.app/Contents/Resources/LogiMgr.mpkg"
29   end
30   on_mojave do
31     version "8.54.147"
32     sha256 "7b7a8d7a498d868c90b4ffe7dfc50a7a39c25e1f61350702e87d4c771b3d6459"
34     url "https://web.archive.org/web/20210811105616/https://download01.logi.com/web/ftp/pub/techsupport/options/Options_#{version}.zip",
35         verified: "web.archive.org/web/20210811105616/https://download01.logi.com/web/ftp/pub/techsupport/options/"
37     livecheck do
38       url "https://support.logi.com/api/v2/help_center/en-us/articles.json?label_names=webcontent=productdownload,webos=mac-macos-x-10.14"
39       regex(%r{/Options[._-]?v?(\d+(?:\.\d+)+)\.zip}i)
40     end
42     pkg "LogiMgr Installer #{version}.app/Contents/Resources/LogiMgr.pkg"
43   end
44   on_catalina do
45     version "8.54.147"
46     sha256 "7b7a8d7a498d868c90b4ffe7dfc50a7a39c25e1f61350702e87d4c771b3d6459"
48     url "https://web.archive.org/web/20210811105616/https://download01.logi.com/web/ftp/pub/techsupport/options/Options_#{version}.zip",
49         verified: "web.archive.org/web/20210811105616/https://download01.logi.com/web/ftp/pub/techsupport/options/"
51     livecheck do
52       url "https://support.logi.com/api/v2/help_center/en-us/articles.json?label_names=webcontent=productdownload,webos=mac-macos-x-10.14"
53       regex(%r{/Options[._-]?v?(\d+(?:\.\d+)+)\.zip}i)
54     end
56     pkg "LogiMgr Installer #{version}.app/Contents/Resources/LogiMgr.pkg"
57   end
58   on_big_sur :or_newer do
59     version "10.22.52"
60     sha256 :no_check
62     url "https://download01.logi.com/web/ftp/pub/techsupport/options/options_installer.zip",
63         verified: "download01.logi.com/web/ftp/pub/techsupport/options/"
65     livecheck do
66       url "https://support.logi.com/api/v2/help_center/en-us/articles.json?label_names=webcontent=productdownload,webos=mac-macos-x-11.0"
67       regex(/Software Version: .*?v?(\d+(?:\.\d+)+)/i)
68       strategy :json do |json, regex|
69         json["articles"]&.select { |item| item["name"] == "Logitech Options" }
70                         &.map { |item| item["body"]&.[](regex, 1) }
71       end
72     end
74     pkg "LogiMgr Installer #{version}.app/Contents/Resources/LogiMgr.pkg"
75   end
77   name "Logitech Options"
78   desc "Software for Logitech devices"
79   homepage "https://support.logitech.com/software/options"
81   auto_updates true
82   depends_on macos: ">= :sierra"
84   uninstall launchctl: [
85               "com.logi.bolt.app",
86               "com.logitech.manager.daemon",
87             ],
88             quit:      [
89               "com.logitech.Logi-Options",
90               "com.logitech.manager.daemon",
91               "com.logitech.manager.uninstaller",
92             ],
93             script:    {
94               executable: "/Applications/Utilities/LogiMgr Uninstaller.app/Contents/Resources/Uninstaller",
95             },
96             pkgutil:   [
97               "com.logi.bolt.pkg",
98               "com.logitech.manager.pkg",
99               "com.Logitech.signedKext.pkg",
100             ],
101             delete:    "/Library/Application Support/Logitech.localized"
103   zap trash: [
104         "~/Library/Application Support/Logitech/Logitech Options",
105         "~/Library/Application Support/Logitech/Options",
106         "~/Library/Caches/com.logitech.Logi-Options",
107         "~/Library/Preferences/com.logitech.Logi-Options.plist",
108         "~/Library/Preferences/com.logitech.manager.daemon.plist",
109         "~/Library/Preferences/com.logitech.manager.setting.ffff.plist",
110         "~/Library/Saved Application State/com.logitech.manager.uninstaller.savedState",
111       ],
112       rmdir: "~/Library/Application Support/Logitech"
114   caveats do
115     reboot
116   end