Download msvc and install.
Download rustup-init.exe and install.
Use git-bash to run the following commands, download vcpkg
, install libvpx
, libyuv
, opus
.
git clone https://github.com/microsoft/vcpkg
cd vcpkg
git checkout 2021.12.01
cd ..
vcpkg/bootstrap-vcpkg.bat
export VCPKG_ROOT=$PWD/vcpkg
vcpkg/vcpkg install libvpx:x64-windows-static libyuv:x64-windows-static opus:x64-windows-static
Add environment variable VCPKG_ROOT
=<path>\vcpkg
.
Desktop versions use sciter for GUI, please download sciter.dll
rust-bindgen depends on clang, download llvm and install,add environment variable LIBCLANG_PATH
=<llvm_install_dir>/bin
.
git clone https://github.com/rustdesk/rustdesk
cd rustdesk
mkdir -p target/debug
mv sciter.dll target/debug
cargo run
Rustdesk can pack resource files in one exe file. Then extract files to the installation directory when being installed.
This design makes rustdesk run both simple mode(single exe file) and full mode(all files after been installed).
To pack resource files, follow the steps:
resources
directoryresources
Feature with_rc
is introduced to pack and extract resource files.
simple_rc
A lib named simple_rc
is used to pack and extract resource files.
The pack process workflow:
rc.rs
), and remember file names.simple_rc
accepts either a configuration file or a Config
structure.
fn generate(conf_file: &str) -> ResultType<()>
# 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.
# ${OutputPath} = ${InstallDir} + (${inc} - ${suppressed_front})
# The following config will make base output path to be "RustDeskTempTopMostWindow/x64/Release/xxx".
suppressed_front = "D:/projects/windows"
Config
structure:fn generate_with_conf<'a>(conf: &'a Config) -> ResultType<()>
...
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();
...
Extraction will keep the resource direcotry tree.
The extraction process workflow:
fn extract_resources(root_path: &str) -> ResultType<()>
File attributes like privileges, create time, owner, are not supported.