From 8e1e9a33b7f5a8714a87ceb0b615063d4fccf1c5 Mon Sep 17 00:00:00 2001 From: fufesou Date: Tue, 18 Aug 2026 14:47:15 +0800 Subject: [PATCH] fix: simple path fix in generate.py Signed-off-by: fufesou --- libs/portable/generate.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/portable/generate.py b/libs/portable/generate.py index a93de7536..6f2471bd9 100755 --- a/libs/portable/generate.py +++ b/libs/portable/generate.py @@ -127,6 +127,12 @@ if __name__ == '__main__': options.executable = 'rustdesk.exe' if not options.executable.startswith(folder): options.executable = folder + '/' + options.executable + # Note: the simple check `options.executable.startswith(folder)` is incorrect. + # `python generate.py -f rustdesk -e rustdesk.exe` or `python generate.py -f rustdesk` + # will result the print "Executable path: ..exe". + # So we need to check if the executable is in the folder, and if so, concat again. + if os.path.exists(os.path.join(folder, options.executable)): + options.executable = os.path.join(folder, options.executable) exe: str = os.path.abspath(options.executable) if not exe.startswith(os.path.abspath(folder)): print("The executable must locate in source folder")