cask "microsoft-edge" do linkid = on_arch_conditional arm: "2093504", intel: "2069148" on_arm do version "119.0.2151.97,fec5727f-a1e0-458c-a53d-cc69caef1230" sha256 "786f8c5d3c53e54ddcf14d780164f1bc7f21483a5e01988a1b930b2aa790e7b0" end on_intel do version "119.0.2151.97,4af2b19e-1b25-440f-8169-dc48ad8eed2d" sha256 "cce313ebfa09b435732b11368a97e3e216e6e14cec4d6e744bd42b4c7bcc873e" end url "https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/#{version.csv.second}/MicrosoftEdge-#{version.csv.first}.pkg" name "Microsoft Edge" desc "Web browser" homepage "https://www.microsoft.com/en-us/edge?form=" livecheck do url "https://go.microsoft.com/fwlink/?linkid=#{linkid}" regex(%r{/([^/]+)/MicrosoftEdge[._-]v?(\d+(?:\.\d+)+)\.pkg}i) strategy :header_match do |headers, regex| headers["location"].scan(regex).map { |match| "#{match[1]},#{match[0]}" } end end auto_updates true pkg "MicrosoftEdge-#{version.csv.first}.pkg", choices: [ { "choiceIdentifier" => "com.microsoft.package.Microsoft_AutoUpdate.app", # Office16_all_autoupdate.pkg "choiceAttribute" => "selected", "attributeSetting" => 0, }, ] uninstall pkgutil: "com.microsoft.edgemac", launchctl: [ "com.microsoft.EdgeUpdater.update-internal.109.0.1518.89.system", "com.microsoft.EdgeUpdater.update.system", "com.microsoft.EdgeUpdater.wake.109.0.1518.89.system", ] zap delete: "/Library/Application Support/Microsoft/EdgeUpdater", rmdir: "/Library/Application Support/Microsoft", trash: [ "~/Library/Application Scripts/com.microsoft.edgemac.wdgExtension", "~/Library/Application Support/Microsoft Edge", "~/Library/Application Support/Microsoft/EdgeUpdater", "~/Library/Caches/com.microsoft.edgemac", "~/Library/Caches/com.microsoft.EdgeUpdater", "~/Library/Caches/Microsoft Edge", "~/Library/Containers/com.microsoft.edgemac.wdgExtension", "~/Library/HTTPStorages/com.microsoft.edge*", "~/Library/LaunchAgents/com.microsoft.EdgeUpdater.*.plist", "~/Library/Microsoft/EdgeUpdater", "~/Library/Preferences/com.microsoft.edgemac.plist", "~/Library/Saved Application State/com.microsoft.edgemac.*", "~/Library/WebKit/com.microsoft.edgemac", ] end