From 02a98bb63fb64f9bd685553f6bb8558ecd55ad45 Mon Sep 17 00:00:00 2001 From: czoido Date: Tue, 29 Oct 2024 16:40:12 +0100 Subject: [PATCH] fix pyinstaller --- pyinstaller.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pyinstaller.py b/pyinstaller.py index 4a0f2ccf8c2..a4d6f22cbca 100644 --- a/pyinstaller.py +++ b/pyinstaller.py @@ -114,18 +114,20 @@ def pyinstall(source_folder, onefile=False): "--hidden-import=conan.tools.layout --hidden-import=conan.tools.premake " "--hidden-import=conan.tools.qbs --hidden-import=conan.tools.scm " "--hidden-import=conan.tools.system --hidden-import=conan.tools.system.package_manager") + + if not os.path.exists(pyinstaller_path): + os.mkdir(pyinstaller_path) + if platform.system() != "Windows": hidden += " --hidden-import=setuptools.msvc" win_ver = "" else: win_ver_file = os.path.join(pyinstaller_path, 'windows-version-file') content = _windows_version_file(__version__) - from conans.util.files import save - save(win_ver_file, content) + with open(win_ver_file, 'w') as file: + file.write(content) win_ver = ["--version-file", win_ver_file] - if not os.path.exists(pyinstaller_path): - os.mkdir(pyinstaller_path) if onefile: distpath = os.path.join(pyinstaller_path, "dist", "conan")