From 55cd19f0db17f6caeffe252b1329621f04db4459 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Mon, 23 Oct 2023 22:54:37 +0200 Subject: [PATCH] Move bins to simplify pyinstaller paths --- software/pyinstaller.spec | 2 +- software/script/chameleon_cli_unit.py | 7 +------ software/src/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/software/pyinstaller.spec b/software/pyinstaller.spec index 865aaad9..9aa9027d 100644 --- a/software/pyinstaller.spec +++ b/software/pyinstaller.spec @@ -8,7 +8,7 @@ a = Analysis( ['script/chameleon_cli_main.py'], pathex=[], binaries=[ - ("bin/*", "bin/"), + ("script/bin/*", "bin/"), ], datas=[], hiddenimports=[], diff --git a/software/script/chameleon_cli_unit.py b/software/script/chameleon_cli_unit.py index 0fd5d0e5..ed3b7342 100644 --- a/software/script/chameleon_cli_unit.py +++ b/software/script/chameleon_cli_unit.py @@ -36,12 +36,7 @@ 0x38: "SmartMX with MIFARE Classic 4K", } -if getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS'): - # in pyinstaller - default_cwd = Path.cwd() / Path(sys._MEIPASS) / "bin" -else: - # from source - default_cwd = Path.cwd() / Path(__file__).parent.parent / "bin" +default_cwd = Path.cwd() / Path(__file__).with_name("bin") def check_tools(): diff --git a/software/src/CMakeLists.txt b/software/src/CMakeLists.txt index 9b7ac84d..bb8d2eb1 100644 --- a/software/src/CMakeLists.txt +++ b/software/src/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.1) project (mifare C) -set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../bin) +set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../script/bin) set(SRC_DIR ./) set(COMMON_FILES