Skip to content

Add EXE build support and frozen-runtime path handling#60

Open
ryo08271154 wants to merge 1 commit intomainfrom
codex/exe
Open

Add EXE build support and frozen-runtime path handling#60
ryo08271154 wants to merge 1 commit intomainfrom
codex/exe

Conversation

@ryo08271154
Copy link
Copy Markdown
Owner

Motivation

  • Make it possible to build and distribute Windows executables and ensure config/plugins/cookie files are resolved correctly when the application runs as a frozen .exe.
  • Avoid plugin discovery and file-path issues that commonly occur after packaging with PyInstaller by centralizing runtime path resolution.

Description

  • Added app_paths.py which provides get_app_dir(), get_resource_dir() and ensure_config_dir() to resolve write/read paths consistently for normal and frozen execution.
  • Added build_exe.py to build GUI (control.py) and CUI (voice_control.py) distributions using PyInstaller and to collect plugin modules as hidden imports via pkgutil.
  • Updated core modules to use get_app_dir()/ensure_config_dir() so voice_control.py, control.py and edit_config.py load and write config/ next to the executable at runtime.
  • Switched plugin discovery/loading to pkgutil.iter_modules() in plugin.py and adjusted plugins (plugins/switchbot.py, plugins/watchlist.py) to use app_paths for config/cookie file paths.
  • Documented the EXE build/run steps in README.md and added pyinstaller to requirements.txt.

Testing

  • Compiled key files with python -m py_compile app_paths.py build_exe.py voice_control.py control.py plugin.py edit_config.py plugins/watchlist.py plugins/switchbot.py, which completed successfully.

Codex Task

@ryo08271154 ryo08271154 marked this pull request as ready for review February 28, 2026 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant