excalidrawz 1.2.5
[Homebrew/homebrew-cask.git] / Casks / v / vmware-horizon-client.rb
bloba78b330a6428519a06062aad795406c4c717f391
1 cask "vmware-horizon-client" do
2   version "2406.1-8.13.1-11490701655,CART25FQ2_MAC_2406.1"
3   sha256 "604108cd3cef06cb41db2583e47aa6b9a6448480788aa7de50b4cc9e9d2f3ee0"
5   url "https://download3.omnissa.com/software/#{version.csv.second}/VMware-Horizon-Client-#{version.csv.first}.dmg",
6       verified: "download3.omnissa.com/software/"
7   name "VMware Horizon Client"
8   desc "Virtual machine client"
9   homepage "https://www.vmware.com/"
11   livecheck do
12     url "https://customerconnect.omnissa.com/channel/public/api/v1.0/products/getRelatedDLGList?locale=en_US&category=desktop_end_user_computing&product=vmware_horizon_clients&version=horizon_8&dlgType=PRODUCT_BINARY"
13     regex(%r{/([^/]+)/VMware[._-]Horizon[._-]Client[._-]v?(\d+(?:[.-]\d+)+)\.dmg}i)
14     strategy :json do |json, regex|
15       mac_json_info = json["dlgEditionsLists"]&.select { |item| item["name"]&.match(/mac/i) }&.first
16       api_item = mac_json_info["dlgList"]&.first
17       next if api_item.blank?
19       download_group = api_item["code"]
20       product_id = api_item["productId"]
21       pid = api_item["releasePackageId"]
22       next if download_group.blank? || product_id.blank? || pid.blank?
24       url = "https://customerconnect.omnissa.com/channel/public/api/v1.0/dlg/details?locale=en_US&downloadGroup=#{download_group}&productId=#{product_id}&rPId=#{pid}"
25       download_item = Homebrew::Livecheck::Strategy.page_content(url)
26       next if download_item[:content].blank?
28       match = download_item[:content].match(regex)
29       next if match.blank?
31       "#{match[2]},#{match[1]}"
32     end
33   end
35   auto_updates true
36   depends_on macos: ">= :big_sur"
38   pkg "VMware Horizon Client.pkg"
40   uninstall launchctl: [
41               "com.vmware.deem.MacUIEvents",
42               "com.vmware.deemd",
43               "com.vmware.horizon.CDSHelper",
44               "com.vmware.vmwetlm",
45               "com.vmware.vmwetlmu",
46             ],
47             quit:      "com.vmware.horizon",
48             pkgutil:   [
49               "com.vmware.horizon",
50               "com.vmware.VMware.Deem",
51               "com.vmware.VMware.Deem.InstallerHelper",
52               "com.vmware.VMware.EndpointTelemetryService",
53             ],
54             delete:    [
55               "/Applications/VMware Horizon Client.app",
56               "/Library/Application Support/VMware",
57               "/Library/LaunchAgents/com.vmware.deem.MacUIEvents.plist",
58               "/Library/LaunchDaemons/com.vmware.deemd.plist",
59               "/Library/LaunchDaemons/com.vmware.horizon.CDSHelper.plist",
60               "/Library/LaunchDaemons/com.vmware.vmwetlm.plist",
61               "/Library/Logs/VMware View Client Services.log",
62               "/Library/Logs/VMware",
63               "/Library/Preferences/com.vmware.horizon.plist",
64               "/Library/PrivilegedHelperTools/com.vmware.horizon.CDSHelper",
65             ]
67   zap trash: [
68     "~/.vmware",
69     "~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.vmware.horizon.sfl*",
70     "~/Library/Application Support/VMware Horizon View Client",
71     "~/Library/Caches/com.vmware.horizon",
72     "~/Library/Logs/VMware Horizon Client",
73     "~/Library/Logs/VMware",
74     "~/Library/Preferences/com.vmware.horizon.keyboard.plist",
75     "~/Library/Preferences/com.vmware.horizon.plist",
76     "~/Library/Saved Application State/com.vmware.horizon.savedState",
77     "~/Library/WebKit/com.vmware.horizon",
78   ]
79 end