mirror of
https://github.com/rustdesk/doc.rustdesk.com.git
synced 2025-06-26 04:31:26 +02:00
remove package
This commit is contained in:
parent
2db601b3fe
commit
ee3831d581
@ -51,83 +51,3 @@ mkdir -p target/debug
|
|||||||
mv sciter.dll target/debug
|
mv sciter.dll target/debug
|
||||||
cargo run
|
cargo run
|
||||||
```
|
```
|
||||||
|
|
||||||
### Pack resource files
|
|
||||||
|
|
||||||
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:
|
|
||||||
1. cd rustdesk
|
|
||||||
2. mkdir `resources` directory
|
|
||||||
3. put files to `resources`
|
|
||||||
4. cargo build --features with_rc,<other features>
|
|
||||||
|
|
||||||
Feature `with_rc` is introduced to pack and extract resource files.
|
|
||||||
|
|
||||||
#### Lib `simple_rc`
|
|
||||||
|
|
||||||
A lib named `simple_rc` is used to pack and extract resource files.
|
|
||||||
|
|
||||||
##### Generate resource packed file
|
|
||||||
The pack process workflow:
|
|
||||||
1. Parse the specified directory tree.
|
|
||||||
2. Exclude specified files.
|
|
||||||
3. Read all file contents, save as byte arrays in source file(`rc.rs`), and remember file names.
|
|
||||||
|
|
||||||
`simple_rc` accepts either a configuration file or a `Config` structure.
|
|
||||||
|
|
||||||
1. Generate resource packed with configuration file.
|
|
||||||
```
|
|
||||||
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"
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Generate resource packed file with a `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();
|
|
||||||
...
|
|
||||||
```
|
|
||||||
|
|
||||||
##### Extract files
|
|
||||||
|
|
||||||
Extraction will keep the resource direcotry tree.
|
|
||||||
|
|
||||||
The extraction process workflow:
|
|
||||||
1. Create directory if needed, to restore the directory tree.
|
|
||||||
2. Write contents to the associated file names.
|
|
||||||
|
|
||||||
```
|
|
||||||
fn extract_resources(root_path: &str) -> ResultType<()>
|
|
||||||
```
|
|
||||||
|
|
||||||
##### Note
|
|
||||||
|
|
||||||
File attributes like privileges, create time, owner, are not supported.
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user