forked from Homebrew/homebrew-cask
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbattle-net.rb
42 lines (34 loc) · 1.46 KB
/
battle-net.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
cask 'battle-net' do
version :latest
sha256 :no_check
language 'en', default: true do
url 'https://www.battle.net/download/getInstallerForGame?os=mac&locale=enUS&version=LIVE&gameProgram=BATTLENET_APP'
end
language 'zh', 'CN' do
url 'https://www.battle.net/download/getInstallerForGame?os=mac&installer=Battle.net-Setup-zhCN.zip'
end
name 'Blizzard Battle.net'
homepage 'https://www.battle.net/'
installer manual: 'Battle.net-Setup.app'
preflight do
set_permissions "#{staged_path}/Battle.net-Setup.app", 'a+x'
end
uninstall delete: '/Applications/Battle.net.app'
zap trash: [
'~/Library/Application Support/Battle.net',
'~/Library/Caches/net.battle.bootstrapper',
'~/Library/Preferences/net.battle.net.app.plist',
'~/Library/Preferences/net.battle.app.helper.plist',
'~/Library/Preferences/net.battle.Authenticator.prefs',
'~/Library/Preferences/net.battle.Identity.prefs',
'~/Library/Preferences/net.battle.plist',
'~/Library/Preferences/net.battnet.battle.plist',
'~/Library/Saved Application State/net.battle.app.savedState',
'/Users/Shared/Battle.net',
'/Users/Shared/Blizzard',
],
rmdir: '~/Blizzard'
caveats <<~EOS
If you pick an installation directory other than /Applications when installing this cask, you will need to uninstall it manually
EOS
end