/
sunloginclient.rb
51 lines (44 loc) 路 1.97 KB
/
sunloginclient.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
43
44
45
46
47
48
49
50
51
cask "sunloginclient" do
arch arm: "arm64", intel: "x86_64"
livecheck_id = on_arch_conditional arm: "187", intel: "89"
version "15.2.0.62925"
sha256 arm: "379b14b1d2c6dda4013d3c201114968994176eb6ae6ca14d193eeba40d52942c",
intel: "91e7093806119e440f7047e6f6d1e8f012e4fce0887c860d4c4821ece89e08da"
url "https://down.oray.com/sunlogin/mac/SunloginClient_#{version}_#{arch}.dmg"
name "Sunlogin Client"
name "鍚戞棩钁典釜浜虹増"
desc "Remote desktop control and monitoring tool"
homepage "https://sunlogin.oray.com/"
livecheck do
url "https://sunlogin.oray.com/zh_CN/download/download?id=#{livecheck_id}"
regex(/SunloginClient[._-]?(\d+(?:\.\d+)+)[._-]#{arch}\.dmg/i)
strategy :header_match
end
pkg "SunloginClient.pkg"
postflight do
# The postinstall script automatically opens the app. Therefore, we must
# suppress this behavior to make the cask installation non-interactive.
retries ||= 3
ohai "The SunloginClient package postinstall script launches the app" if retries >= 3
ohai "Attempting to close SunloginClient to avoid unwanted user intervention" if retries >= 3
return unless system_command "/usr/bin/pkill", args: ["-f", "/Applications/SunloginClient.app"]
end
uninstall launchctl: [
"com.oray.sunlogin ()",
"com.oray.sunlogin.agent",
"com.oray.sunlogin.desktopagent",
"com.oray.sunlogin.helper",
"com.oray.sunlogin.service",
"com.oray.sunlogin.startup",
],
quit: "com.oray.sunlogin.macclient",
pkgutil: "com.oray.sunlogin.macclient"
zap delete: "/private/var/log/sunlogin/",
trash: [
"~/Library/Caches/com.oray.sunlogin.macclient",
"~/Library/Preferences/com.oray.sunlogin.macclient.plist",
"~/Library/Saved Application State/com.oray.sunlogin.macclient.savedState",
"~/Library/WebKit/com.oray.sunlogin.macclient",
"~/Sunlogin Files",
]
end