diff --git a/AGENTS.md b/AGENTS.md index 834b3b7..63d75d5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -48,13 +48,17 @@ The project follows a modular file-per-feature architecture: - `toolbox_base.py` — shared infrastructure (Logger, CommandResult, Color, cprint, Spinner, run/command/prompt helpers) - `features/` — one file per feature, each importing only from `toolbox_base` - `scripts/check.ps1` — unified ruff lint + format check runner -- `LDLWinToolBox.spec` — PyInstaller spec for EXE packaging +- `LDLWinToolBox.spec` — PyInstaller spec for EXE packaging; version via `str(vers)` not `repr(vers)` (see below) - `.github/workflows/ci.yml` — CI (ruff on push/PR) - `.github/workflows/release.yml` — Release (PyInstaller build on tag) - `README.md` — project documentation written using the `BLANK_README.md` (Best-README-Template) format, covering all 23 menu features, architecture, and production build info - Zero external dependencies; all imports from Python stdlib; ANSI colors for UX - `TOOLBOX_VERSION` read dynamically from `pyproject.toml` via `tomllib` +### PyInstaller Spec: Version File Serialization + +In `LDLWinToolBox.spec`, the version info `VSVersionInfo` object is serialized to `build/version_info.txt` using `str(vers)`, then loaded by `EXE(version=str(vers_file))`. **Must use `str()` not `repr()`** — `repr(vers)` produces qualified names (`versioninfo.VSVersionInfo(...)`) that cannot be `eval()`'d inside PyInstaller's `versioninfo.py` module scope, while `str(vers)` produces unqualified names (`VSVersionInfo(...)`) that match the `pyi-grab_version` format and deserialize correctly. + ## Current Implemented Features ### System Cleanup (1-3) diff --git a/MEMORY.md b/MEMORY.md index 6be6dea..568a65d 100644 --- a/MEMORY.md +++ b/MEMORY.md @@ -17,7 +17,7 @@ Last updated: 2026-07-05 - Repository path: `D:\Projects\WinProjects\LDLWinToolBox` - Git remote: `https://github.com/LoveDoLove/LDLWinToolBox.git` - Current branch at scan time: `lovedolove` -- Latest scanned commit: `fbb2701 Refactor into modular architecture + add Low Latency Mode + reorganize menu` +- Latest scanned commit: `d0b50e5 Fix VSVersionInfo deserialization: use str() not repr() for eval-safe format` - Latest repository scan: `2026-07-05`. - License: Apache License 2.0 - Primary executable: `LDLWinToolBox.bat` thin launcher for `ldlwintoolbox.py` via `uv run -- python` @@ -82,7 +82,7 @@ Implemented menu behavior (each feature in its own `features/*.py` file), groupe **Tools (20-22):** 20. View Log History: lists the newest toolbox logs in `logs\`, lets the user choose one of the latest 9 entries, and opens it with paged console viewing. -21. Check for Updates: queries GitHub releases API, compares with local version (1.0.3), opens browser for download if newer. +21. Check for Updates: queries GitHub releases API, compares with local version (1.0.7), opens browser for download if newer. 22. Cleanup Exclusion List: manage JSON-based exclusion list in `config/exclusions.json`; paths matching exclusions are skipped during cleanup. 23. Exit: asks Y/N confirmation, then closes the tool. @@ -111,6 +111,12 @@ The user-listed feature targets below were implemented: Treat the remote `iwr | iex` command as high risk. Do not execute it during analysis. The menu feature requires a clear warning, `KILL` confirmation, and logging. +### 2026-07-05 — PyInstaller Version Fix (v1.0.7) + +- **Bug:** `repr(vers)` writes `versioninfo.VSVersionInfo(...)` (qualified names), but `load_version_info_from_text_file` calls `eval(text)` in `versioninfo.py` module scope where only unqualified names (`VSVersionInfo`, `FixedFileInfo`, etc.) exist — `versioninfo` is not importable from within the module. +- **Fix:** Changed `repr(vers)` → `str(vers)` in `LDLWinToolBox.spec:57`. `str()` produces unqualified names matching the `pyi-grab_version` serialization format that `load_version_info_from_text_file` is designed to parse. +- Bumped version to `1.0.7`, created PR #8 (release-1.0.7 → main), merged. + ### 2026-07-05 (Python) - Modular refactor: split monolithic `ldlwintoolbox.py` into `toolbox_base.py` + `features/` (one file per feature). @@ -177,7 +183,7 @@ Treat the remote `iwr | iex` command as high risk. Do not execute it during anal - `scripts/check.ps1` — unified ruff lint + format + import check runner - `.github/workflows/ci.yml` — CI workflow (Windows + ruff-action) - `.github/workflows/release.yml` — Release workflow (PyInstaller build + GitHub Release) -- `LDLWinToolBox.spec` — PyInstaller spec for EXE packaging +- `LDLWinToolBox.spec` — PyInstaller spec for EXE packaging; critical `str(vers)` vs `repr(vers)` fix applied after v1.0.6 release build failure - `README.md` — rewritten using `BLANK_README.md` (Best-README-Template) format, covering all 23 menu features, architecture, and production build info - `memory/2026-07-05.md` — updated with Production Version work log @@ -212,3 +218,4 @@ Four-phase plan to move from feature-complete to production-ready. All phases co - C1: PyInstaller `.spec` at project root - C2: `.github/workflows/release.yml` — auto-build + release on version tag - C3: Version sourced from `pyproject.toml` via `tomllib` at runtime (`TOOLBOX_VERSION`) +- C4 (fix): Version text serialization must use `str(vers)` not `repr(vers)` — see AGENTS.md for root cause. Release v1.0.5 and v1.0.6 builds failed without this fix. Fixed in v1.0.7. diff --git a/README.md b/README.md index 7f10653..1ea0122 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,7 @@
  • Usage
  • +
  • Roadmap
  • Contributing
  • License
  • Contact
  • @@ -79,20 +80,20 @@ The LDL Windows ToolBox is a Python-first Windows utility that combines administrative privilege elevation, system cleanup, repair flows, network reset, BitLocker management, browser AI cleanup, SSD TRIM, low-latency configuration, recovery tools, diagnostics, and reporting into a single cohesive menu-driven interface. -The project follows a modular file-per-feature architecture: +The project follows a modular file-per-feature architecture running with zero external dependencies (Python standard library + built-in Windows commands + ANSI escape codes): - `LDLWinToolBox.bat` — thin Batch launcher invoking `uv run -- python ldlwintoolbox.py` -- `ldlwintoolbox.py` — entry point with admin detection, read-only mode, and colored main menu dispatch -- `toolbox_base.py` — shared infrastructure (Logger, CommandResult, ANSI Color, Spinner, run/command/prompt helpers) -- `features/` — one file per feature, each importing only from `toolbox_base` -- `config/exclusions.json` — user-managed exclusion list for cleanup operations -- `logs/` — structured timestamped session logs -- `scripts/check.ps1` — ruff lint + format check runner +- `ldlwintoolbox.py` — entry point with admin detection, UAC relaunch, and colored main menu dispatch +- `toolbox_base.py` — shared infrastructure (Logger, Color, cprint, Spinner, CommandResult, run/command/prompt helpers) +- `features/` — one file per feature (23 menu items), each importing only from `toolbox_base` +- `config/exclusions.json` — runtime-managed exclusion list for cleanup operations (created on first use) +- `logs/` — timestamped structured session logs with session header, section markers, command exit codes +- `scripts/check.ps1` — unified ruff lint + format check runner - `LDLWinToolBox.spec` — PyInstaller spec for EXE packaging - `.github/workflows/ci.yml` — CI workflow (ruff on push/PR) - `.github/workflows/release.yml` — Release workflow (PyInstaller build on version tag) -The tool runs with zero external dependencies (Python standard library + built-in Windows commands + ANSI escape codes). When launched without administrator privileges, it automatically enters **read-only mode**, hiding destructive features and allowing safe inspection of system information, diagnostics, and logs. +When launched without administrator privileges, the tool automatically enters **read-only mode**, hiding destructive features (1–11) and providing a "[R] Restart as Administrator" shortcut while allowing safe inspection of system information, diagnostics, and logs. When launched as admin, all 23 menu items are available and long-running or destructive operations display warnings, require explicit (Y/N) confirmation, and offer optional system restore points.

    (back to top)

    @@ -115,6 +116,7 @@ To get a local copy up and running follow these simple steps. - Windows 10 or Windows 11 - Administrator rights (optional — the tool supports read-only mode without elevation; destructive features auto-request UAC if needed) - [uv](https://docs.astral.sh/uv/) (recommended) — the launcher falls back to `python` if uv is not available +- Python 3.11 or later ### Installation @@ -170,13 +172,17 @@ Upon launching, the interactive menu provides numbered options organized into lo ### Tools (20–22) - **[20] View Log History**: Lists recent toolbox logs and opens the selected file with a paged console viewer. -- **[21] Check for Updates**: Queries the GitHub Releases API, compares with local version, optionally opens browser for download. +- **[21] Check for Updates**: Queries the GitHub Releases API, compares with local version (v1.0.7), optionally opens browser for download. - **[22] Cleanup Exclusion List**: Manages a JSON-based exclusion list (`config/exclusions.json`); paths matching exclusions are skipped during cleanup. Each run writes a structured log under `logs/` with a session header, environment summary, section markers, user cancellations, command start/end markers, and exit codes. Long-running or destructive operations display warnings and require explicit (Y/N) confirmation. Optional system restore points can be created before destructive features.

    (back to top)

    + + +## Roadmap + See the [open issues](https://github.com/LoveDoLove/LDLWinToolBox/issues) for a full list of proposed features (and known issues).

    (back to top)