mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-06 13:41:29 +03:00
feat, update, win, macos (#11618)
Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
18
src/platform/privileges_scripts/update.scpt
Normal file
18
src/platform/privileges_scripts/update.scpt
Normal file
@@ -0,0 +1,18 @@
|
||||
on run {daemon_file, agent_file, user, cur_pid, source_dir}
|
||||
|
||||
set unload_service to "launchctl unload -w /Library/LaunchDaemons/com.carriez.RustDesk_service.plist || true;"
|
||||
|
||||
set kill_others to "pgrep -x 'RustDesk' | grep -v " & cur_pid & " | xargs kill -9;"
|
||||
|
||||
set copy_files to "rm -rf /Applications/RustDesk.app && cp -r " & source_dir & " /Applications && chown -R " & quoted form of user & ":staff /Applications/RustDesk.app;"
|
||||
|
||||
set sh1 to "echo " & quoted form of daemon_file & " > /Library/LaunchDaemons/com.carriez.RustDesk_service.plist && chown root:wheel /Library/LaunchDaemons/com.carriez.RustDesk_service.plist;"
|
||||
|
||||
set sh2 to "echo " & quoted form of agent_file & " > /Library/LaunchAgents/com.carriez.RustDesk_server.plist && chown root:wheel /Library/LaunchAgents/com.carriez.RustDesk_server.plist;"
|
||||
|
||||
set sh3 to "launchctl load -w /Library/LaunchDaemons/com.carriez.RustDesk_service.plist;"
|
||||
|
||||
set sh to unload_service & kill_others & copy_files & sh1 & sh2 & sh3
|
||||
|
||||
do shell script sh with prompt "RustDesk wants to update itself" with administrator privileges
|
||||
end run
|
||||
Reference in New Issue
Block a user