From 8f51e021c811c06675b19427ddcd1ae7f0e11abe Mon Sep 17 00:00:00 2001 From: fufesou Date: Mon, 17 Apr 2023 14:18:00 +0800 Subject: [PATCH 1/7] remove simple_rc Signed-off-by: fufesou --- Cargo.toml | 3 +- build.py | 26 ++-- build.rs | 16 --- libs/simple_rc/Cargo.toml | 13 -- libs/simple_rc/examples/generate.rs | 23 --- libs/simple_rc/simple_rc.toml | 12 -- libs/simple_rc/src/lib.rs | 208 ---------------------------- src/core_main.rs | 4 - src/lib.rs | 3 - src/rc.rs | 38 ----- 10 files changed, 12 insertions(+), 334 deletions(-) delete mode 100644 libs/simple_rc/Cargo.toml delete mode 100644 libs/simple_rc/examples/generate.rs delete mode 100644 libs/simple_rc/simple_rc.toml delete mode 100644 libs/simple_rc/src/lib.rs delete mode 100644 src/rc.rs diff --git a/Cargo.toml b/Cargo.toml index 94ef44e0f..abf578f72 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,6 @@ path = "src/naming.rs" inline = [] hbbs = [] cli = [] -with_rc = ["simple_rc"] flutter_texture_render = [] appimage = [] flatpak = [] @@ -135,7 +134,7 @@ jni = "0.19" flutter_rust_bridge = "1.61.1" [workspace] -members = ["libs/scrap", "libs/hbb_common", "libs/enigo", "libs/clipboard", "libs/virtual_display", "libs/virtual_display/dylib", "libs/simple_rc", "libs/portable"] +members = ["libs/scrap", "libs/hbb_common", "libs/enigo", "libs/clipboard", "libs/virtual_display", "libs/virtual_display/dylib", "libs/portable"] exclude = ["vdi/host", "examples/custom_plugin"] [package.metadata.winres] diff --git a/build.py b/build.py index 053d59c47..af2c0b3fd 100755 --- a/build.py +++ b/build.py @@ -211,11 +211,10 @@ def download_extract_features(features, res_dir): print(f'{feat} extract end') -def get_rc_features(args): - flutter = args.flutter +def pre_resources(args): features = parse_rc_features(args.feature) if not features: - return [] + return print(f'Build with features {list(features.keys())}') res_dir = 'resources' @@ -225,23 +224,18 @@ def get_rc_features(args): raise Exception(f'Find file {res_dir}, not a directory') os.makedirs(res_dir, exist_ok=True) download_extract_features(features, res_dir) - if flutter: - os.makedirs(flutter_win_target_dir, exist_ok=True) - for f in pathlib.Path(res_dir).iterdir(): - print(f'{f}') - if f.is_file(): - shutil.copy2(f, flutter_win_target_dir) - else: - shutil.copytree(f, f'{flutter_win_target_dir}{f.stem}') - return [] - else: - return ['with_rc'] + os.makedirs(flutter_win_target_dir, exist_ok=True) + for f in pathlib.Path(res_dir).iterdir(): + print(f'{f}') + if f.is_file(): + shutil.copy2(f, flutter_win_target_dir) + else: + shutil.copytree(f, f'{flutter_win_target_dir}{f.stem}') def get_features(args): features = ['inline'] if not args.flutter else [] if windows: - features.extend(get_rc_features(args)) features.append('virtual_display_driver') if args.hwcodec: features.append('hwcodec') @@ -438,6 +432,8 @@ def main(): build_deb_from_folder(version, package) return if windows: + pre_resources(args) + # build virtual display dynamic library os.chdir('libs/virtual_display/dylib') system2('cargo build --release') diff --git a/build.rs b/build.rs index bf141e539..85f21e7d0 100644 --- a/build.rs +++ b/build.rs @@ -41,20 +41,6 @@ fn build_manifest() { } } -#[cfg(all(windows, feature = "with_rc"))] -fn build_rc_source() { - use simple_rc::{generate_with_conf, Config, ConfigItem}; - generate_with_conf(&Config { - outfile: "src/rc.rs".to_owned(), - confs: vec![ConfigItem { - inc: "resources".to_owned(), - exc: vec![], - suppressed_front: "resources".to_owned(), - }], - }) - .unwrap(); -} - fn install_oboe() { let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap(); if target_os != "android" { @@ -133,8 +119,6 @@ fn main() { gen_flutter_rust_bridge(); // return; // } - #[cfg(all(windows, feature = "with_rc"))] - build_rc_source(); #[cfg(all(windows, feature = "inline"))] build_manifest(); #[cfg(windows)] diff --git a/libs/simple_rc/Cargo.toml b/libs/simple_rc/Cargo.toml deleted file mode 100644 index 89304524d..000000000 --- a/libs/simple_rc/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "simple_rc" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -serde_derive = "1.0" -serde = "1.0" -walkdir = "2" -confy = { git = "https://github.com/open-trade/confy" } -hbb_common = { path = "../hbb_common" } diff --git a/libs/simple_rc/examples/generate.rs b/libs/simple_rc/examples/generate.rs deleted file mode 100644 index 2de39961a..000000000 --- a/libs/simple_rc/examples/generate.rs +++ /dev/null @@ -1,23 +0,0 @@ -extern crate simple_rc; - -use simple_rc::*; - -fn main() { - { - const CONF_FILE: &str = "simple_rc.toml"; - generate(CONF_FILE).unwrap(); - } - - { - generate_with_conf(&Config { - outfile: "src/rc.rs".to_owned(), - confs: vec![ConfigItem { - inc: "D:/projects/windows/RustDeskTempTopMostWindow/x64/Release/xxx".to_owned(), - // exc: vec!["*.dll".to_owned(), "*.exe".to_owned()], - exc: vec![], - suppressed_front: "D:/projects/windows".to_owned(), - }], - }) - .unwrap(); - } -} diff --git a/libs/simple_rc/simple_rc.toml b/libs/simple_rc/simple_rc.toml deleted file mode 100644 index bef976967..000000000 --- a/libs/simple_rc/simple_rc.toml +++ /dev/null @@ -1,12 +0,0 @@ -# The output source file -outfile = "src/rc.rs" - -# The resource config list. -[[confs]] -# The file or director to integrate. -inc = "D:/projects/windows/RustDeskTempTopMostWindow/x64/Release/xxx" -# The exclusions. -exc = ["*.dll", "*.exe"] -# The front path that will ignore for extracting. -# The following config will make base output path to be "RustDeskTempTopMostWindow/x64/Release/xxx". -suppressed_front = "D:/projects/windows" diff --git a/libs/simple_rc/src/lib.rs b/libs/simple_rc/src/lib.rs deleted file mode 100644 index e59e0493f..000000000 --- a/libs/simple_rc/src/lib.rs +++ /dev/null @@ -1,208 +0,0 @@ -use hbb_common::{bail, ResultType}; -use serde_derive::{Deserialize, Serialize}; -use std::{collections::HashMap, fs::File, io::prelude::*, path::Path}; -use walkdir::WalkDir; - -//mod rc; - -#[derive(Debug, Default, PartialEq, Serialize, Deserialize, Clone)] -pub struct ConfigItem { - // include directory or file - pub inc: String, - // exclude files - pub exc: Vec, - // out_path = origin_path - suppressed_front - pub suppressed_front: String, -} - -#[derive(Debug, Default, PartialEq, Serialize, Deserialize, Clone)] -pub struct Config { - // output source file - pub outfile: String, - // config items - pub confs: Vec, -} - -pub fn get_outin_files<'a>(item: &'a ConfigItem) -> ResultType> { - let mut outin_filemap = HashMap::new(); - - for entry in WalkDir::new(&item.inc).follow_links(true) { - let path = entry?.into_path(); - if path.is_file() { - let mut exclude = false; - for excfile in item.exc.iter() { - if excfile.starts_with("*.") { - if let Some(ext) = path.extension().and_then(|x| x.to_str()) { - if excfile.ends_with(&format!(".{}", ext)) { - exclude = true; - break; - } - } - } else { - if path.ends_with(Path::new(excfile)) { - exclude = true; - break; - } - } - } - if exclude { - continue; - } - - let mut suppressed_front = item.suppressed_front.clone(); - if !suppressed_front.is_empty() && suppressed_front.ends_with('/') { - suppressed_front.push('/'); - } - let outpath = path.strip_prefix(Path::new(&suppressed_front))?; - let outfile = if outpath.is_absolute() { - match outpath - .file_name() - .and_then(|f| f.to_str()) - .map(|f| f.to_string()) - { - None => { - bail!("Failed to get filename of {}", outpath.display()); - } - Some(s) => s, - } - } else { - match outpath.to_str() { - None => { - bail!("Failed to convert {} to string", outpath.display()); - } - // Simple replace \ to / here. - // A better way is to use lib [path-slash](https://github.com/rhysd/path-slash) - Some(s) => s.to_string().replace("\\", "/"), - } - }; - let infile = match path.canonicalize()?.to_str() { - None => { - bail!("Failed to get file path of {}", path.display()); - } - Some(s) => s.to_string(), - }; - if let Some(_) = outin_filemap.insert(outfile.clone(), infile) { - bail!("outfile {} is set before", outfile); - } - } - } - - Ok(outin_filemap) -} - -pub fn generate(conf_file: &str) -> ResultType<()> { - let conf = confy::load_path(conf_file)?; - generate_with_conf(&conf)?; - Ok(()) -} - -pub fn generate_with_conf<'a>(conf: &'a Config) -> ResultType<()> { - let mut outfile = File::create(&conf.outfile)?; - - outfile.write( - br##"use hbb_common::{bail, ResultType}; -use std::{ - fs::{self, File}, - io::prelude::*, - path::Path, -}; - -"##, - )?; - - outfile.write(b"#[allow(dead_code)]\n")?; - outfile.write(b"pub fn extract_resources(root_path: &str) -> ResultType<()> {\n")?; - outfile.write(b" let mut resources: Vec<(&str, &[u8])> = Vec::new();\n")?; - - let mut outin_files = HashMap::new(); - for item in conf.confs.iter() { - for (o, i) in get_outin_files(item)?.into_iter() { - if let Some(_) = outin_files.insert(o.clone(), i) { - bail!("outfile {} is set before", o); - } - } - } - - let mut count = 1; - for (o, i) in outin_files.iter() { - let mut infile = File::open(&i)?; - let mut buffer = Vec::::new(); - infile.read_to_end(&mut buffer)?; - - let var_outfile = format!("outfile_{}", count); - let var_outdata = format!("outdata_{}", count); - - write!(outfile, " let {} = \"{}\";\n", var_outfile, o)?; - write!(outfile, " let {}: &[u8] = &[\n ", var_outdata)?; - - let mut line_num = 20; - for v in buffer { - if line_num == 0 { - write!(outfile, "\n ")?; - line_num = 20; - } - write!(outfile, "{:#04x}, ", v)?; - line_num -= 1; - } - write!(outfile, "\n ];\n")?; - - write!( - outfile, - " resources.push(({}, &{}));\n", - var_outfile, var_outdata - )?; - - count += 1; - } - - outfile.write(b" do_extract(root_path, resources)?;\n")?; - outfile.write(b" Ok(())\n")?; - outfile.write(b"}\n")?; - - outfile.write( - br##" -#[allow(dead_code)] -fn do_extract(root_path: &str, resources: Vec<(&str, &[u8])>) -> ResultType<()> { - let mut root_path = root_path.replace("\\", "/"); - if !root_path.ends_with('/') { - root_path.push('/'); - } - let root_path = Path::new(&root_path); - for (outfile, data) in resources { - let outfile_path = root_path.join(outfile); - match outfile_path.parent().and_then(|p| p.to_str()) { - None => { - bail!("Failed to get parent of {}", outfile_path.display()); - } - Some(p) => { - fs::create_dir_all(p)?; - let mut of = File::create(outfile_path)?; - of.write_all(data)?; - of.flush()?; - } - } - } - Ok(()) -} -"##, - )?; - - outfile.flush()?; - - Ok(()) -} - -#[cfg(test)] -mod tests { - #[test] - fn it_works() { - let result = 2 + 2; - assert_eq!(result, 4); - } - - // #[test] - // fn test_extract() { - // use super::*; - // rc::extract_resources("D:").unwrap(); - // } -} diff --git a/src/core_main.rs b/src/core_main.rs index d6c3bbc59..c5193b566 100644 --- a/src/core_main.rs +++ b/src/core_main.rs @@ -145,10 +145,6 @@ pub fn core_main() -> Option> { args.len() > 1, )); return None; - } else if args[0] == "--extract" { - #[cfg(feature = "with_rc")] - hbb_common::allow_err!(crate::rc::extract_resources(&args[1])); - return None; } else if args[0] == "--install-cert" { #[cfg(windows)] hbb_common::allow_err!(crate::platform::windows::install_cert(&args[1])); diff --git a/src/lib.rs b/src/lib.rs index d5f791eeb..a6b5c4a46 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -64,9 +64,6 @@ mod hbbs_http; #[cfg(windows)] pub mod clipboard_file; -#[cfg(all(windows, feature = "with_rc"))] -pub mod rc; - #[cfg(windows)] pub mod privacy_win_mag; diff --git a/src/rc.rs b/src/rc.rs deleted file mode 100644 index ef86caaa3..000000000 --- a/src/rc.rs +++ /dev/null @@ -1,38 +0,0 @@ -use hbb_common::{bail, ResultType}; -use std::{ - fs::{self, File}, - io::prelude::*, - path::Path, -}; - -#[allow(dead_code)] -pub fn extract_resources(root_path: &str) -> ResultType<()> { - let mut resources: Vec<(&str, &[u8])> = Vec::new(); - resources.push((outfile_4, &outdata_4)); - do_extract(root_path, resources)?; - Ok(()) -} - -#[allow(dead_code)] -fn do_extract(root_path: &str, resources: Vec<(&str, &[u8])>) -> ResultType<()> { - let mut root_path = root_path.replace("\\", "/"); - if !root_path.ends_with('/') { - root_path.push('/'); - } - let root_path = Path::new(&root_path); - for (outfile, data) in resources { - let outfile_path = root_path.join(outfile); - match outfile_path.parent().and_then(|p| p.to_str()) { - None => { - bail!("Failed to get parent of {}", outfile_path.display()); - } - Some(p) => { - fs::create_dir_all(p)?; - let mut of = File::create(outfile_path)?; - of.write_all(data)?; - of.flush()?; - } - } - } - Ok(()) -} From 321ada7b915628a891508188c9714fe5567b4a64 Mon Sep 17 00:00:00 2001 From: fufesou Date: Mon, 17 Apr 2023 14:30:30 +0800 Subject: [PATCH 2/7] remove simple_rc Signed-off-by: fufesou --- Cargo.lock | 12 ------------ Cargo.toml | 1 - 2 files changed, 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 098189693..299d99c14 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5163,7 +5163,6 @@ dependencies = [ "sha2", "shared_memory", "shutdown_hooks", - "simple_rc", "sys-locale", "system_shutdown", "tao", @@ -5571,17 +5570,6 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "238abfbb77c1915110ad968465608b68e869e0772622c9656714e73e5a1a522f" -[[package]] -name = "simple_rc" -version = "0.1.0" -dependencies = [ - "confy", - "hbb_common", - "serde 1.0.159", - "serde_derive", - "walkdir", -] - [[package]] name = "siphasher" version = "0.2.3" diff --git a/Cargo.toml b/Cargo.toml index abf578f72..cd76b7d01 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -149,7 +149,6 @@ winapi = { version = "0.3", features = [ "winnt" ] } [build-dependencies] cc = "1.0" hbb_common = { path = "libs/hbb_common" } -simple_rc = { path = "libs/simple_rc", optional = true } flutter_rust_bridge_codegen = "1.61.1" os-version = "0.2" From ec51047c23703c16d8b4fa431d3aac75bc66056a Mon Sep 17 00:00:00 2001 From: fufesou Date: Mon, 17 Apr 2023 14:33:46 +0800 Subject: [PATCH 3/7] remove --extract Signed-off-by: fufesou --- src/platform/windows.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/platform/windows.rs b/src/platform/windows.rs index b0b0d18e6..8fe900d11 100644 --- a/src/platform/windows.rs +++ b/src/platform/windows.rs @@ -928,7 +928,6 @@ pub fn copy_exe_cmd(src_exe: &str, exe: &str, path: &str) -> String { " {main_exe} copy /Y \"{ORIGIN_PROCESS_EXE}\" \"{path}\\{broker_exe}\" - \"{src_exe}\" --extract \"{path}\" ", main_exe = main_exe, path = path, From 9f12f96ab942a30df7e6117de2251925e273390f Mon Sep 17 00:00:00 2001 From: fufesou Date: Mon, 17 Apr 2023 14:49:58 +0800 Subject: [PATCH 4/7] ignore external resources for sciter version (Win7) Signed-off-by: fufesou --- build.py | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/build.py b/build.py index af2c0b3fd..3ff4f1684 100755 --- a/build.py +++ b/build.py @@ -41,11 +41,13 @@ def get_version(): def parse_rc_features(feature): available_features = { 'IddDriver': { + 'platform': ['windows'], 'zip_url': 'https://github.com/fufesou/RustDeskIddDriver/releases/download/v0.3/RustDeskIddDriver_x64.zip', 'checksum_url': 'https://github.com/fufesou/RustDeskIddDriver/releases/download/v0.3/checksum_md5', 'exclude': ['README.md', 'certmgr.exe', 'install_cert_runas_admin.bat'], }, 'PrivacyMode': { + 'platform': ['windows'], 'zip_url': 'https://github.com/fufesou/RustDeskTempTopMostWindow/releases/download/v0.1' '/TempTopMostWindow_x64_pic_en.zip', 'checksum_url': 'https://github.com/fufesou/RustDeskTempTopMostWindow/releases/download/v0.1/checksum_md5', @@ -55,16 +57,30 @@ def parse_rc_features(feature): apply_features = {} if not feature: feature = [] + + def platform_check(platforms): + if windows: + return 'windows' in platforms + elif osx: + return 'osx' in platforms + else: + return 'linux' in platforms + if isinstance(feature, str) and feature.upper() == 'ALL': - return available_features + for (feat, feat_info) in available_features.items(): + if platform_check(feat_info['platform']): + apply_features[feat] = available_features[feat] + return apply_features elif isinstance(feature, list): - # force add PrivacyMode - feature.append('PrivacyMode') + if windows: + # force add PrivacyMode + feature.append('PrivacyMode') for feat in feature: if isinstance(feat, str) and feat.upper() == 'ALL': return available_features if feat in available_features: - apply_features[feat] = available_features[feat] + if platform_check(available_features[feat]['platform']): + apply_features[feat] = available_features[feat] else: print(f'Unrecognized feature {feat}') return apply_features @@ -211,7 +227,7 @@ def download_extract_features(features, res_dir): print(f'{feat} extract end') -def pre_resources(args): +def external_resources(args): features = parse_rc_features(args.feature) if not features: return @@ -432,14 +448,13 @@ def main(): build_deb_from_folder(version, package) return if windows: - pre_resources(args) - # build virtual display dynamic library os.chdir('libs/virtual_display/dylib') system2('cargo build --release') os.chdir('../../..') if flutter: + external_resources(args) build_flutter_windows(version, features) return system2('cargo build --release --features ' + features) From a4caffe032f643c35bb8b036054aa8aa59b18283 Mon Sep 17 00:00:00 2001 From: fufesou Date: Mon, 17 Apr 2023 15:16:55 +0800 Subject: [PATCH 5/7] update build.py Signed-off-by: fufesou --- build.py | 43 +++++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/build.py b/build.py index 3ff4f1684..521630dbb 100755 --- a/build.py +++ b/build.py @@ -15,7 +15,13 @@ osx = platform.platform().startswith( 'Darwin') or platform.platform().startswith("macOS") hbb_name = 'rustdesk' + ('.exe' if windows else '') exe_path = 'target/release/' + hbb_name -flutter_win_target_dir = 'flutter/build/windows/runner/Release/' +if windows: + flutter_build_dir = 'build/windows/runner/Release/' +elif osx: + flutter_build_dir = 'build/macos/Build/Products/Release/' +else: + flutter_build_dir = 'build/linux/x64/release/bundle/' +flutter_build_dir_2 = f'flutter/{flutter_build_dir}' skip_cargo = False def get_arch() -> str: @@ -227,26 +233,26 @@ def download_extract_features(features, res_dir): print(f'{feat} extract end') -def external_resources(args): +def external_resources(flutter, args, res_dir): features = parse_rc_features(args.feature) if not features: return print(f'Build with features {list(features.keys())}') - res_dir = 'resources' if os.path.isdir(res_dir) and not os.path.islink(res_dir): shutil.rmtree(res_dir) elif os.path.exists(res_dir): raise Exception(f'Find file {res_dir}, not a directory') os.makedirs(res_dir, exist_ok=True) download_extract_features(features, res_dir) - os.makedirs(flutter_win_target_dir, exist_ok=True) - for f in pathlib.Path(res_dir).iterdir(): - print(f'{f}') - if f.is_file(): - shutil.copy2(f, flutter_win_target_dir) - else: - shutil.copytree(f, f'{flutter_win_target_dir}{f.stem}') + if flutter: + os.makedirs(flutter_build_dir_2, exist_ok=True) + for f in pathlib.Path(res_dir).iterdir(): + print(f'{f}') + if f.is_file(): + shutil.copy2(f, flutter_build_dir_2) + else: + shutil.copytree(f, f'{flutter_build_dir_2}{f.stem}') def get_features(args): @@ -305,7 +311,7 @@ def build_flutter_deb(version, features): system2('mkdir -p tmpdeb/usr/share/polkit-1/actions') system2('rm tmpdeb/usr/bin/rustdesk || true') system2( - 'cp -r build/linux/x64/release/bundle/* tmpdeb/usr/lib/rustdesk/') + f'cp -r {flutter_build_dir}/* tmpdeb/usr/lib/rustdesk/') system2( 'cp ../res/rustdesk.service tmpdeb/usr/share/rustdesk/files/systemd/') system2( @@ -391,7 +397,7 @@ def build_flutter_arch_manjaro(version, features): ffi_bindgen_function_refactor() os.chdir('flutter') system2('flutter build linux --release') - system2('strip build/linux/x64/release/bundle/lib/librustdesk.so') + system2(f'strip {flutter_build_dir}/lib/librustdesk.so') os.chdir('../res') system2('HBB=`pwd`/.. FLUTTER=1 makepkg -f') @@ -406,11 +412,11 @@ def build_flutter_windows(version, features): system2('flutter build windows --release') os.chdir('..') shutil.copy2('target/release/deps/dylib_virtual_display.dll', - flutter_win_target_dir) + flutter_build_dir_2) os.chdir('libs/portable') system2('pip3 install -r requirements.txt') system2( - f'python3 ./generate.py -f ../../{flutter_win_target_dir} -o . -e ../../{flutter_win_target_dir}/rustdesk.exe') + f'python3 ./generate.py -f ../../{flutter_build_dir_2} -o . -e ../../{flutter_build_dir_2}/rustdesk.exe') os.chdir('../..') if os.path.exists('./rustdesk_portable.exe'): os.replace('./target/release/rustdesk-portable-packer.exe', @@ -447,6 +453,8 @@ def main(): if package: build_deb_from_folder(version, package) return + res_dir = 'resources' + external_resources(flutter, args, res_dir) if windows: # build virtual display dynamic library os.chdir('libs/virtual_display/dylib') @@ -454,7 +462,6 @@ def main(): os.chdir('../../..') if flutter: - external_resources(args) build_flutter_windows(version, features) return system2('cargo build --release --features ' + features) @@ -468,7 +475,11 @@ def main(): else: print('Not signed') system2( - f'cp -rf target/release/RustDesk.exe rustdesk-{version}-win7-install.exe') + f'cp -rf target/release/RustDesk.exe {res_dir}') + os.chdir('libs/portable') + system2('pip3 install -r requirements.txt') + system2( + f'python3 ./generate.py -f ../../{res_dir} -o . -e ../../rustdesk-{version}-win7-install.exe') elif os.path.isfile('/usr/bin/pacman'): # pacman -S -needed base-devel system2("sed -i 's/pkgver=.*/pkgver=%s/g' res/PKGBUILD" % version) From b53c74d9b52ce636aa9456ccf1a5f245d50e2821 Mon Sep 17 00:00:00 2001 From: fufesou Date: Mon, 17 Apr 2023 15:26:50 +0800 Subject: [PATCH 6/7] update build.py Signed-off-by: fufesou --- build.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.py b/build.py index 521630dbb..7a672dde5 100755 --- a/build.py +++ b/build.py @@ -479,7 +479,8 @@ def main(): os.chdir('libs/portable') system2('pip3 install -r requirements.txt') system2( - f'python3 ./generate.py -f ../../{res_dir} -o . -e ../../rustdesk-{version}-win7-install.exe') + f'python3 ./generate.py -f ../../{res_dir} -o . -e ../../{res_dir}/rustdesk-{version}-win7-install.exe') + system2('mv ../../{res_dir}/rustdesk-{version}-win7-install.exe ../..') elif os.path.isfile('/usr/bin/pacman'): # pacman -S -needed base-devel system2("sed -i 's/pkgver=.*/pkgver=%s/g' res/PKGBUILD" % version) From 904b53d598d851e2eb1124239a7e1a27631a7d10 Mon Sep 17 00:00:00 2001 From: fufesou Date: Mon, 17 Apr 2023 19:01:12 +0800 Subject: [PATCH 7/7] update build.py Signed-off-by: fufesou --- build.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/build.py b/build.py index 7a672dde5..6cb8c0e80 100755 --- a/build.py +++ b/build.py @@ -71,19 +71,23 @@ def parse_rc_features(feature): return 'osx' in platforms else: return 'linux' in platforms - - if isinstance(feature, str) and feature.upper() == 'ALL': + + def get_all_features(): + features = [] for (feat, feat_info) in available_features.items(): if platform_check(feat_info['platform']): - apply_features[feat] = available_features[feat] - return apply_features + features.append(feat) + return features + + if isinstance(feature, str) and feature.upper() == 'ALL': + return get_all_features() elif isinstance(feature, list): if windows: # force add PrivacyMode feature.append('PrivacyMode') for feat in feature: if isinstance(feat, str) and feat.upper() == 'ALL': - return available_features + return get_all_features() if feat in available_features: if platform_check(available_features[feat]['platform']): apply_features[feat] = available_features[feat]