Merge pull request #2427 from Kingtous/master

opt: add os.system wrapper & fix tray manager
This commit is contained in:
RustDesk 2022-12-02 17:33:58 +08:00 committed by GitHub
commit 12bdd57a45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 4 deletions

View File

@ -8,6 +8,7 @@ import urllib.request
import shutil
import hashlib
import argparse
import sys
windows = platform.platform().startswith('Windows')
osx = platform.platform().startswith(
@ -17,6 +18,14 @@ exe_path = 'target/release/' + hbb_name
flutter_win_target_dir = 'flutter/build/windows/runner/Release/'
skip_cargo = False
def custom_os_system(cmd):
err = os._system(cmd)
if err != 0:
print(f"Error occured when executing: {cmd}. Exiting.")
sys.exit(-1)
# replace prebuilt os.system
os._system = os.system
os.system = custom_os_system
def get_version():
with open("Cargo.toml", encoding="utf-8") as fh:
@ -243,7 +252,7 @@ def build_flutter_deb(version, features):
os.system('mkdir -p tmpdeb/usr/share/rustdesk/files/systemd/')
os.system('mkdir -p tmpdeb/usr/share/applications/')
os.system('mkdir -p tmpdeb/usr/share/polkit-1/actions')
os.system('rm tmpdeb/usr/bin/rustdesk')
os.system('rm tmpdeb/usr/bin/rustdesk || true')
os.system(
'cp -r build/linux/x64/release/bundle/* tmpdeb/usr/lib/rustdesk/')
os.system(

View File

@ -10,7 +10,7 @@ import package_info_plus_macos
import path_provider_macos
import screen_retriever
import sqflite
import tray_manager
// import tray_manager
import uni_links_desktop
import url_launcher_macos
import wakelock_macos
@ -39,7 +39,7 @@ class MainFlutterWindow: NSWindow {
FLTPackageInfoPlusPlugin.register(with: controller.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: controller.registrar(forPlugin: "PathProviderPlugin"))
SqflitePlugin.register(with: controller.registrar(forPlugin: "SqflitePlugin"))
TrayManagerPlugin.register(with: controller.registrar(forPlugin: "TrayManagerPlugin"))
// TrayManagerPlugin.register(with: controller.registrar(forPlugin: "TrayManagerPlugin"))
UniLinksDesktopPlugin.register(with: controller.registrar(forPlugin: "UniLinksDesktopPlugin"))
UrlLauncherPlugin.register(with: controller.registrar(forPlugin: "UrlLauncherPlugin"))
WakelockMacosPlugin.register(with: controller.registrar(forPlugin: "WakelockMacosPlugin"))

View File

@ -63,7 +63,7 @@ dependencies:
desktop_multi_window:
git:
url: https://github.com/Kingtous/rustdesk_desktop_multi_window
ref: 65a6acfdee49d6fc56c4c89ebb214d308543eb2b
ref: 82f9eab81cb2c7bfb938def7a1b399a6279bbc75
freezed_annotation: ^2.0.3
flutter_custom_cursor:
git: