Skip to content

Commit

Permalink
Move bins to simplify pyinstaller paths
Browse files Browse the repository at this point in the history
  • Loading branch information
doegox committed Oct 23, 2023
1 parent bb47bd5 commit 55cd19f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion software/pyinstaller.spec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ a = Analysis(
['script/chameleon_cli_main.py'],
pathex=[],
binaries=[
("bin/*", "bin/"),
("script/bin/*", "bin/"),
],
datas=[],
hiddenimports=[],
Expand Down
7 changes: 1 addition & 6 deletions software/script/chameleon_cli_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
2 changes: 1 addition & 1 deletion software/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 55cd19f

Please sign in to comment.