cask "microsoft-edge" do linkid = on_arch_conditional arm: "2093504", intel: "2069148" on_arm do version "131.0.2903.51,08b226c9-fbe8-43c0-94fe-ed9c3eeb8f59" sha256 "5bc1eab86bb315aa9f2cd2b7d9afe072df35280f6e6d1a9ca9c108d95bda8acd" end on_intel do version "131.0.2903.51,fe65fba8-6cee-486d-93c9-b27d00007be6" sha256 "edd9df9b52dd0f7bdcd5d0c4a9d9da5df7b11d3c060166306db5bf3bea43c044" end url "https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/#{version.csv.second}/MicrosoftEdge-#{version.csv.first}.pkg" name "Microsoft Edge" desc "Multi-platform 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| match = headers["location"]&.match(regex) next if match.blank? "#{match[2]},#{match[1]}" end end auto_updates true depends_on macos: ">= :big_sur" pkg "MicrosoftEdge-#{version.csv.first}.pkg", choices: [ { "choiceIdentifier" => "com.microsoft.package.Microsoft_AutoUpdate.app", # Office16_all_autoupdate.pkg "choiceAttribute" => "selected", "attributeSetting" => 0, }, ] uninstall launchctl: [ "com.microsoft.EdgeUpdater.update-internal.109.0.1518.89.system", "com.microsoft.EdgeUpdater.update.system", "com.microsoft.EdgeUpdater.wake.system", ], pkgutil: "com.microsoft.edgemac" zap delete: "/Library/Application Support/Microsoft/EdgeUpdater", trash: [ "~/Library/Application Scripts/com.microsoft.edgemac.wdgExtension", "~/Library/Application Support/Microsoft Edge", "~/Library/Caches/com.microsoft.edgemac", "~/Library/Caches/Microsoft Edge", "~/Library/Containers/com.microsoft.edgemac.wdgExtension", "~/Library/HTTPStorages/com.microsoft.edgemac", "~/Library/LaunchAgents/com.microsoft.EdgeUpdater.*.plist", "~/Library/Microsoft/MicrosoftSoftwareUpdate/Actives/com.microsoft.edgemac", "~/Library/Preferences/com.microsoft.edgemac.plist", "~/Library/Saved Application State/com.microsoft.edgemac.savedState", "~/Library/WebKit/com.microsoft.edgemac", ], rmdir: [ "/Library/Application Support/Microsoft", "~/Library/Microsoft", ] end