Rustdesk compilation (especially for windows) is a complex process and requires a lot of dependencies and configurations.
In this repository I tried to simplify the process as much as possible so that it is possible to make changes in the code or in the configurations and compile without messing with all the dependencies and things around.
The only tool that needs to be installed is Docker.
Currently, it only compiles for Windows-x64, which is the most useful.
The process is divided into two stages:
First, a Windows docker image is built with all the configuration dependencies needed for compilation, this is a one-time process, unless the source code dependencies change.
In the second step, we run the docker image with Rustdesk compilation instructions.
Unfortunately, the compilation cannot be done when the source code is connected to the container by Bind mounts, cargo
encounters many errors in this situation, therefore the source code is copied every time into the container and there the compilation takes place.
Note: Please use Powershell, Otherwise, the commands will not execute properly.
-
Start docker and switch to Windows containers.
-
Go to the folder you want to clone Rustdesk and use Powershell to run the following commands:
git clone https://github.com/danielmayost/rustdesk-simple-build.git
cd rustdesk-simple-build
git clone https://github.com/rustdesk/rustdesk.git
cd Windows-x64
./build
- Then make changes to the code and run the following command:
./compile
- The output will be in the
output
folder.
If you want to define your ID_Server as default or your Public_Key, you can set the Environment variable within the container, for do that, insert this lines in the compile.bat
file before the -v
flags:
-e RENDEZVOUS_SERVER=YOUR_SERVER ^
-e RS_PUB_KEY=control-YOUR_PUB_KEY ^
If you are Netfree user (some Internet censorship in our county) please run this build command:
./build -netfree
If you run the ./build
command before without -netfree
flag, you need to run this command:
./build -netfree -no-cache
If you encounter errors during the image build or compilation, verify the following:
- Make sure docker is configured on Windows container.
- The script tries to trace the flutter-build.yml file in the rustdesk project, make sure that the versions of the dependencies in the file match the dependencies in the Dockerfile, if not, change them.
- If you did a git pull to the source code, the dependencies may have changed, just change the RUSTDESK_COMMIT in
Dockerfile
and rebuild the image by./build
.