Merge pull request #198952 from Homebrew/bump-vienna-assistant-1.2.483
[Homebrew/homebrew-cask.git] / Casks / m / microsoft-teams.rb
blob797a18a9ed4d3283ec2a70d7e2ad393001068158
1 cask "microsoft-teams" do
2   version "24335.207.3345.5574"
3   sha256 "34c50d6b556c1b6f612d7d9477d0d84fdb07f6d0ee0ed6a555098a14a2af8596"
5   url "https://statics.teams.cdn.office.net/production-osx/#{version}/MicrosoftTeams.pkg",
6       verified: "statics.teams.cdn.office.net/production-osx/"
7   name "Microsoft Teams"
8   desc "Meet, chat, call, and collaborate in just one place"
9   homepage "https://www.microsoft.com/en/microsoft-teams/group-chat-software/"
11   # Microsoft releases multiple versions and builds of Teams, as listed here:
12   #   https://raw.githubusercontent.com/ItzLevvie/MicrosoftTeams-msinternal/master/defconfig
13   # and here:
14   #   https://raw.githubusercontent.com/ItzLevvie/MicrosoftTeams-msinternal/master/defconfig2
15   #
16   # We only track the "production build"/"Public (R4) build" version,
17   # which agrees with the version reported by `livecheck`.
18   #
19   # Any pull request that updates this Cask to a version that
20   # differs from the `livecheck` version will be closed.
21   livecheck do
22     url "https://config.teams.microsoft.com/config/v1/MicrosoftTeams/#{version}?environment=prod&audienceGroup=general&teamsRing=general&agent=TeamsBuilds"
23     strategy :json do |json|
24       json.dig("BuildSettings", "WebView2", "macOS", "latestVersion")
25     end
26   end
28   auto_updates true
29   conflicts_with cask: "microsoft-office-businesspro"
30   depends_on cask: "microsoft-auto-update"
31   depends_on macos: ">= :big_sur"
33   pkg "MicrosoftTeams.pkg",
34       choices: [
35         {
36           "choiceIdentifier" => "com.microsoft.autoupdate",
37           "choiceAttribute"  => "selected",
38           "attributeSetting" => 0,
39         },
40       ]
42   uninstall launchctl: "com.microsoft.teams.TeamsUpdaterDaemon",
43             quit:      "com.microsoft.autoupdate2",
44             pkgutil:   [
45               "com.microsoft.MSTeamsAudioDevice",
46               "com.microsoft.package.Microsoft_AutoUpdate.app",
47               "com.microsoft.teams2",
48             ],
49             delete:    [
50               "/Applications/Microsoft Teams.app",
51               "/Library/Application Support/Microsoft/TeamsUpdaterDaemon",
52               "/Library/Logs/Microsoft/MSTeams",
53               "/Library/Logs/Microsoft/Teams",
54               "/Library/Preferences/com.microsoft.teams.plist",
55             ]
57   zap trash: [
58         "~/Library/Application Scripts/*.com.microsoft.teams",
59         "~/Library/Application Scripts/com.microsoft.teams*",
60         "~/Library/Application Support/com.microsoft.teams",
61         "~/Library/Application Support/Microsoft/Teams",
62         "~/Library/Application Support/Teams",
63         "~/Library/Caches/com.microsoft.teams",
64         "~/Library/Containers/com.microsoft.teams*",
65         "~/Library/Cookies/com.microsoft.teams.binarycookies",
66         "~/Library/Group Containers/*.com.microsoft.teams",
67         "~/Library/HTTPStorages/com.microsoft.teams",
68         "~/Library/HTTPStorages/com.microsoft.teams.binarycookies",
69         "~/Library/Logs/Microsoft Teams Helper (Renderer)",
70         "~/Library/Logs/Microsoft Teams",
71         "~/Library/Preferences/com.microsoft.teams*.plist",
72         "~/Library/Saved Application State/com.microsoft.teams*.savedState",
73         "~/Library/WebKit/com.microsoft.teams",
74       ],
75       rmdir: "~/Library/Application Support/Microsoft"
76 end