From d01eb70b48df0f786889b9510fcda507228dbe72 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Sat, 14 May 2022 11:46:20 +0800 Subject: [PATCH] more build --- .cargo/config.toml | 6 +++++- .gitignore | 10 ++++++++++ Cargo.lock | 1 - Cargo.toml | 4 ---- DEBIAN/postinst | 6 +++++- lang.py | 46 ++++++++++++++++++++++++++++++++++++++++++++++ manifest.xml | 36 ++++++++++++++++++++++++++++++++++++ 7 files changed, 102 insertions(+), 7 deletions(-) create mode 100644 lang.py create mode 100644 manifest.xml diff --git a/.cargo/config.toml b/.cargo/config.toml index f19d0f027..0e9fd44a9 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,4 +1,8 @@ +[target.x86_64-pc-windows-msvc] +rustflags = ["-Ctarget-feature=+crt-static"] +[target.i686-pc-windows-msvc] +rustflags = ["-Ctarget-feature=+crt-static"] [target.'cfg(target_os="macos")'] rustflags = [ "-C", "link-args=-sectcreate __CGPreLoginApp __cgpreloginapp /dev/null", -] \ No newline at end of file +] diff --git a/.gitignore b/.gitignore index 56f4c29c6..02fbca870 100644 --- a/.gitignore +++ b/.gitignore @@ -7,5 +7,15 @@ extractor __pycache__ src/version.rs *dmg +*exe +*tgz +*lib +cert.pfx +flutter_hbb +*.bak +*png +*svg +*jpg +web_hbb sciter.dll **pdb diff --git a/Cargo.lock b/Cargo.lock index fd2c981b3..cae72342a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4007,7 +4007,6 @@ dependencies = [ "tray-item", "trayicon", "uuid", - "virtual_display", "whoami", "winapi 0.3.9", "windows-service", diff --git a/Cargo.toml b/Cargo.toml index 39d890201..c2c7186bf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,10 +30,6 @@ default = ["use_dasp"] whoami = "1.2" scrap = { path = "libs/scrap" } hbb_common = { path = "libs/hbb_common" } -enigo = { path = "libs/enigo" } -clipboard = { path = "libs/clipboard" } -virtual_display = { path = "libs/virtual_display" } -sys-locale = "0.2" serde_derive = "1.0" serde = "1.0" serde_json = "1.0" diff --git a/DEBIAN/postinst b/DEBIAN/postinst index f9f5e9d9a..5899bd4df 100644 --- a/DEBIAN/postinst +++ b/DEBIAN/postinst @@ -10,7 +10,11 @@ if [ "$1" = configure ]; then if [ -e /etc/systemd/system/rustdesk.service ]; then rm /etc/systemd/system/rustdesk.service fi - sudo -H pip3 install pynput + version=$(python3 -V 2>&1 | grep -Po '(?<=Python )(.+)') + parsedVersion=$(echo "${version//./}") + if [[ "$parsedVersion" -gt "360" ]]; then + sudo -H pip3 install pynput + fi cp /usr/share/rustdesk/files/systemd/rustdesk.service /etc/systemd/system/rustdesk.service systemctl daemon-reload systemctl enable rustdesk diff --git a/lang.py b/lang.py new file mode 100644 index 000000000..aff87d411 --- /dev/null +++ b/lang.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python3 + +# Based on 'cn.rs', generate entries that are not completed in other languages + +import os +import glob + +def get_lang(lang): + out = {} + for ln in open('./src/lang/%s.rs'%lang): + ln = ln.strip() + if ln.startswith('("'): + k,v = line_split(ln) + out[k] = v + return out + +def line_split(line): + toks = line.split('", "') + assert(len(toks) == 2) + k = toks[0][2:] + v = toks[1][:-3] + return k,v + + +def main(): + for fn in glob.glob('./src/lang/*'): + lang = os.path.basename(fn)[:-3] + if lang in ['en','cn']: continue + fw = open("%s.rs.gen"%lang, "wb+") + dict = get_lang(lang) + for line in open('./src/lang/cn.rs'): + line_strip = line.strip() + if line_strip.startswith('("'): + k,v = line_split(line_strip) + if k in dict: + line = line.replace(v, dict[k]) + else: + line = line.replace(v, "") + fw.write(line.encode()) + else: + fw.write(line.encode()) + fw.close() + os.remove("./src/lang/%s.rs"%lang) + os.rename(fw.name, "./src/lang/%s.rs"%lang) + +main() \ No newline at end of file diff --git a/manifest.xml b/manifest.xml new file mode 100644 index 000000000..1f2cf1951 --- /dev/null +++ b/manifest.xml @@ -0,0 +1,36 @@ + + + + + true/PM + PerMonitorV2, PerMonitor + + + + + + + + + + + + + + + + + + + + + +