Refactoring of build.py and bugfixes to improve the support of Windows #8074
+26
−10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've made some changes to build.py:
except FileExistsError
if the./rustdesk-{version}-install.exe
still existed after the previous build. This also improves ACLs handling;python3
on Windows to usepython
instead, as it's the default python3 binary, and the python2 is deprecated. This should allow to build on the new systems without symlinking python3 to python;It might be better to use some kind of logic (like getting and parsing the output of
python -V
andpython3 -V
respectively) to determine which binary to use, and then calling the binary directly, but I find it unnecessary complicated as Python 2 is deprecated anyway.I've tested it with nightly workflow, as well as with
python ./build.py --hwcodec --flutter
and.\build.py --portable --hwcodec --flutter --vram --skip-portable-pack
with both CMD ans PS shells, and it compiles and works.However, the deprecated non-flutter build doesn't compile (it doesn't compile on the master branch either:
NotADirectoryError: [WinError 267] The directory name is invalid: '../../resources'
) due to a problem with passingres_dir
to the./generate.py
.I'm planning to make a CI (or at least scripts) for building the Windows version natively on Windows or Windows containers, if this pull request gets merged. The reason is that, when you only need a Windows binary (e.g. developing on Win), it would be faster to compile only Windows-version.