From 1120ad8a76fb26794a201ed218b1e6b6f5aebe94 Mon Sep 17 00:00:00 2001 From: rony Date: Sat, 27 Jun 2026 01:43:23 +0200 Subject: [PATCH 1/4] docs(win): Phase 7 implementation plan (packaging & release) --- ...-windows-port-phase-7-packaging-release.md | 160 ++++++++++++++++++ 1 file changed, 160 insertions(+) create mode 100644 docs/superpowers/plans/2026-06-26-windows-port-phase-7-packaging-release.md diff --git a/docs/superpowers/plans/2026-06-26-windows-port-phase-7-packaging-release.md b/docs/superpowers/plans/2026-06-26-windows-port-phase-7-packaging-release.md new file mode 100644 index 0000000..5bfed5e --- /dev/null +++ b/docs/superpowers/plans/2026-06-26-windows-port-phase-7-packaging-release.md @@ -0,0 +1,160 @@ +# Windows Port — Phase 7: Packaging & Release — Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: superpowers:subagent-driven-development. Steps use checkbox (`- [ ]`). + +> **Plan series.** Phase **7 of 8** (final). Phases 0–6 merged. Branch: `feat/win-phase-7`. + +**Goal:** Ship-ready Windows release: version bumped to 0.5.0, a CHANGELOG entry documenting full Windows support, a README Windows section, and a final polish of accumulated cosmetic minors. The unsigned NSIS installer (already wired in `windows.yml`) is validated end-to-end via `workflow_dispatch`. + +**Architecture:** This is a release/docs/polish phase — no new platform runtime code. Version lives in the workspace `Cargo.toml` (`[workspace.package] version`) and `ui/package.json`; `tauri.conf.json` has no `version` key so it inherits from Cargo. The NSIS installer build is `windows.yml` (`cargo tauri build --bundles nsis`, triggered on `v*` tags / manual). + +**Tech Stack:** TOML/JSON/Markdown; existing Rust/Svelte (cosmetic touches only). + +## Global Constraints + +- Do NOT regress Linux/macOS/Windows. Cosmetic/doc changes only in code; no behavior change. +- Keep `// SPDX-License-Identifier: GPL-3.0-or-later`. +- Version is a single source bumped consistently: workspace `Cargo.toml` + `ui/package.json` (both 0.4.1 → 0.5.0). `tauri.conf.json` inherits from Cargo (no version key — leave it). +- Verification per task: `cargo fmt --all --check` + `cargo clippy -p freeyourdisk --all-targets -- -D warnings` GREEN (for code touches); `pnpm --dir ui check` + `pnpm --dir ui build` GREEN (for frontend touches); CHANGELOG/README are prose (no build impact). + +--- + +### Task 1: Version bump 0.5.0 + CHANGELOG + +**Files:** Modify `Cargo.toml` (`[workspace.package] version`), `ui/package.json` (`version`), `CHANGELOG.md` (new top entry). + +**Interfaces:** none (release metadata). + +- [ ] **Step 1: Bump workspace Cargo version** + +In `Cargo.toml`, change the `[workspace.package]` `version = "0.4.1"` to `version = "0.5.0"`. + +- [ ] **Step 2: Bump UI version** + +In `ui/package.json`, change `"version": "0.4.1"` to `"version": "0.5.0"`. + +- [ ] **Step 3: CHANGELOG entry** + +Insert this entry in `CHANGELOG.md` immediately above the `## [0.4.1] - 2026-06-25` entry: + +```markdown +## [0.5.0] - 2026-06-27 + +### Added + +- **Windows 10/11 support (full feature parity).** FreeYourDisk now runs natively + on Windows alongside Linux and macOS, with the same dashboard, disk breakdown, + application manager, disk-health/SMART, task manager, scheduling and low-space + monitor: + - **Paths & scan.** Disk usage, app caches (`%LOCALAPPDATA%`/`%APPDATA%`) and + temp (`%LOCALAPPDATA%\Temp`, `%WINDIR%\Temp`) are enumerated with Windows-aware + roots; system size sums the real Windows system roots. + - **Privileged cleanup.** Elevation uses a UAC self-relaunch (PowerShell + `Start-Process -Verb RunAs`) into a headless `--apply` mode — no bundled + service. Deletions are re-validated against a hard-coded `C:\Windows\Temp` + zone; the elevated IPC uses unguessable random-nonce temp paths. + - **Applications.** Inventory from the registry Uninstall keys + MSIX/Store + packages (`Get-AppxPackage`); uninstall via the app's own uninstaller / + `Remove-AppxPackage`; update detection + best-effort update via `winget`. + - **Disk health / SMART.** Disk list + uptime via `sysinfo`; SMART read through + an elevated `smartctl` (guided `winget install smartmontools`). + - **Task manager.** Process termination (`TerminateProcess` via `sysinfo`) with + a Windows critical-process safelist. + - **Scheduling & UX.** Weekly cleanup via the Task Scheduler (`schtasks`); + autostart via the `HKCU\…\Run` key; native WinRT toast notifications. +- **Unsigned NSIS installer** built on a Windows runner (`windows.yml`), bundling + the WebView2 bootstrapper. + +### Notes + +- The Windows installer is unsigned (no Authenticode certificate); SmartScreen may + warn on first run. Code signing can be added later via certificate secrets. +- Toast notifications currently display under the PowerShell app identity; a + dedicated Start-menu AppUserModelID is a future refinement. +``` + +- [ ] **Step 4: Verify** — `cargo fmt --all --check` (no Rust change, just confirm clean); `pnpm --dir ui check` (package.json version change is inert). Confirm `cargo metadata --no-deps --format-version 1 | grep -o '"version":"0.5.0"'` resolves (workspace picked up the bump). + +- [ ] **Step 5: Commit** + +```bash +git add Cargo.toml Cargo.lock ui/package.json CHANGELOG.md +git commit -m "chore(release): v0.5.0 — Windows 10/11 support" +``` + +--- + +### Task 2: README Windows section + +**Files:** Modify `README.md`. + +**Interfaces:** none (docs). + +- [ ] **Step 1: Add a Windows section** + +Add a "Windows" subsection to README.md under the existing install/platform documentation (mirror the structure used for Linux/macOS). Cover: +- **Requirements:** Windows 10 (1803+) or 11, x64. WebView2 runtime (the installer bundles the bootstrapper, which fetches it if absent — needs internet on first install). +- **Install:** download the unsigned `*-setup.exe` from the latest release (or build it — see below); SmartScreen may warn (unsigned) → "More info" → "Run anyway". +- **Features:** same as Linux/macOS — dashboard, disk breakdown, applications (registry + Microsoft Store), disk health/SMART (`winget install smartmontools` for SMART), task manager, weekly scheduled cleanup, autostart, low-space toasts. Privileged cleanup prompts via UAC. +- **Build from source:** `pnpm --dir ui install && pnpm --dir ui build` then `cargo tauri build --bundles nsis` (Rust + Node 22 + the Tauri CLI). Note the `--bundles nsis` flag is required. + +Match the README's existing tone/heading depth. Do not restructure unrelated sections. + +- [ ] **Step 2: Verify** — render-check the Markdown (headings balanced, code fences closed). No build impact. + +- [ ] **Step 3: Commit** + +```bash +git add README.md +git commit -m "docs(win): README Windows install + features + build-from-source" +``` + +--- + +### Task 3: Final polish of cosmetic minors + +**Files:** Modify `src-tauri/src/applications.rs` (stale doc comments), `src-tauri/src/commands.rs` (Linux schedule doc orphan), `ui/src/lib/api.ts` + `ui/src/lib/views/Applications.svelte` (add macOS `app` source). + +**Interfaces:** none (cosmetic + completing an enum). + +- [ ] **Step 1: Refresh applications.rs stale docs** + +In `applications.rs`, update the module doc and the `AppEntry.source` field comment so they list all sources, not just the Linux ones. Change the `source` comment from the Linux-only list to: `"apt" | "flatpak" | "snap" | "appimage" | "app" (macOS) | "registry" | "msix" (Windows)`. Update the module-level doc similarly if it enumerates sources. No code change. + +- [ ] **Step 2: Strip the macOS parenthetical from the Linux schedule doc** + +In `commands.rs`, the `#[cfg(target_os = "linux")]` `schedule_enabled` doc comment reads "…systemd on Linux, launchd on macOS." Since this arm is now Linux-only, change it to just describe Linux (e.g., "Whether the weekly cleanup systemd user timer is enabled."). The macOS arm has its own doc. + +- [ ] **Step 3: Add the macOS `app` source to the frontend AppSource** + +In `ui/src/lib/api.ts`, add `"app"` to the `AppSource` union (the macOS backend emits `source: "app"` for `/Applications` bundles). In `ui/src/lib/views/Applications.svelte`, add an `app` entry to `SOURCE_COLOR` (a macOS-appropriate colour, e.g. a neutral grey `#8e8e93`) and ensure its label renders. This removes the uncolored-badge gap for macOS. + +- [ ] **Step 4: Verify** + +```bash +cargo fmt --all && cargo clippy -p freeyourdisk --all-targets -- -D warnings # GREEN (doc-only Rust) +pnpm --dir ui check && pnpm --dir ui build # GREEN (AppSource change) +``` + +- [ ] **Step 5: Commit** + +```bash +git add src-tauri/src/applications.rs src-tauri/src/commands.rs ui/src/lib/api.ts ui/src/lib/views/Applications.svelte +git commit -m "polish(win): refresh app-source docs, Linux schedule doc, add macOS 'app' source label" +``` + +--- + +## Self-Review + +**Spec coverage:** version bump (Task 1), CHANGELOG documenting all 6 feature phases (Task 1), README Windows section (Task 2), cosmetic polish of accumulated minors (Task 3). The NSIS installer build is validated by the controller via `workflow_dispatch` on `windows.yml` (the per-push CI clippy gate only compiles — it never builds the installer). + +**Placeholder scan:** none. The unsigned-installer and AUMID items are documented release notes (intentional, deferred), not placeholders. + +**Type consistency:** version "0.5.0" applied to both Cargo workspace + ui/package.json (tauri.conf inherits). `AppSource` union gains `"app"`; `SOURCE_COLOR` gains the matching key (frontend exhaustiveness improved). + +## Notes for later (explicitly deferred, non-blocking) +- Authenticode code signing of the NSIS installer (needs a certificate). +- A dedicated FreeYourDisk AppUserModelID + Start-menu shortcut so toasts show the app name (Phase-6 toast reuses the PowerShell AUMID). +- smartctl detection (`smartdeps` PATH+ProgramFiles) vs the elevated reader (ProgramFiles-only) can disagree for PATH-only smartctl installs (Phase-3 minor; winget happy-path is fine). +- macOS privhelper `ROOT_ZONES` `/tmp` not canonicalized to `/private/tmp` (pre-existing macOS bug, not Windows). From 0a43ee71063266b85d9e87408c71272be5cd4956 Mon Sep 17 00:00:00 2001 From: rony Date: Sat, 27 Jun 2026 01:46:10 +0200 Subject: [PATCH 2/4] =?UTF-8?q?chore(release):=20v0.5.0=20=E2=80=94=20Wind?= =?UTF-8?q?ows=2010/11=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 34 ++++++++++++++++++++++++++++++++++ Cargo.lock | 12 ++++++------ Cargo.toml | 2 +- ui/package.json | 2 +- 4 files changed, 42 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06e2a91..642188e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,40 @@ All notable changes to FreeYourDisk are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/) and the project adheres to [Semantic Versioning](https://semver.org/). +## [0.5.0] - 2026-06-27 + +### Added + +- **Windows 10/11 support (full feature parity).** FreeYourDisk now runs natively + on Windows alongside Linux and macOS, with the same dashboard, disk breakdown, + application manager, disk-health/SMART, task manager, scheduling and low-space + monitor: + - **Paths & scan.** Disk usage, app caches (`%LOCALAPPDATA%`/`%APPDATA%`) and + temp (`%LOCALAPPDATA%\Temp`, `%WINDIR%\Temp`) are enumerated with Windows-aware + roots; system size sums the real Windows system roots. + - **Privileged cleanup.** Elevation uses a UAC self-relaunch (PowerShell + `Start-Process -Verb RunAs`) into a headless `--apply` mode — no bundled + service. Deletions are re-validated against a hard-coded `C:\Windows\Temp` + zone; the elevated IPC uses unguessable random-nonce temp paths. + - **Applications.** Inventory from the registry Uninstall keys + MSIX/Store + packages (`Get-AppxPackage`); uninstall via the app's own uninstaller / + `Remove-AppxPackage`; update detection + best-effort update via `winget`. + - **Disk health / SMART.** Disk list + uptime via `sysinfo`; SMART read through + an elevated `smartctl` (guided `winget install smartmontools`). + - **Task manager.** Process termination (`TerminateProcess` via `sysinfo`) with + a Windows critical-process safelist. + - **Scheduling & UX.** Weekly cleanup via the Task Scheduler (`schtasks`); + autostart via the `HKCU\…\Run` key; native WinRT toast notifications. +- **Unsigned NSIS installer** built on a Windows runner (`windows.yml`), bundling + the WebView2 bootstrapper. + +### Notes + +- The Windows installer is unsigned (no Authenticode certificate); SmartScreen may + warn on first run. Code signing can be added later via certificate secrets. +- Toast notifications currently display under the PowerShell app identity; a + dedicated Start-menu AppUserModelID is a future refinement. + ## [0.4.1] - 2026-06-25 ### Added diff --git a/Cargo.lock b/Cargo.lock index 3a94f4f..fe539d8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -385,7 +385,7 @@ dependencies = [ [[package]] name = "core-ipc" -version = "0.4.1" +version = "0.5.0" dependencies = [ "serde", "serde_json", @@ -393,7 +393,7 @@ dependencies = [ [[package]] name = "core-scan" -version = "0.4.1" +version = "0.5.0" dependencies = [ "jwalk", "rayon", @@ -404,7 +404,7 @@ dependencies = [ [[package]] name = "core-services" -version = "0.4.1" +version = "0.5.0" dependencies = [ "core-ipc", "core-scan", @@ -414,7 +414,7 @@ dependencies = [ [[package]] name = "core-trash" -version = "0.4.1" +version = "0.5.0" dependencies = [ "core-ipc", "dunce", @@ -908,7 +908,7 @@ dependencies = [ [[package]] name = "freeyourdisk" -version = "0.4.1" +version = "0.5.0" dependencies = [ "core-ipc", "core-scan", @@ -930,7 +930,7 @@ dependencies = [ [[package]] name = "freeyourdisk-helper" -version = "0.4.1" +version = "0.5.0" dependencies = [ "core-ipc", "core-trash", diff --git a/Cargo.toml b/Cargo.toml index 32f91f8..6138958 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ members = [ ] [workspace.package] -version = "0.4.1" +version = "0.5.0" edition = "2021" license = "GPL-3.0-or-later" authors = ["rony "] diff --git a/ui/package.json b/ui/package.json index a248b9d..c520a24 100644 --- a/ui/package.json +++ b/ui/package.json @@ -1,7 +1,7 @@ { "name": "freeyourdisk-ui", "private": true, - "version": "0.4.1", + "version": "0.5.0", "type": "module", "license": "GPL-3.0-or-later", "scripts": { From 903eeef87a3e2952b515048f12ff352a78542b5c Mon Sep 17 00:00:00 2001 From: rony Date: Sat, 27 Jun 2026 01:53:09 +0200 Subject: [PATCH 3/4] docs(windows): add requirements, install, and build-from-source section --- README.md | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b16c677..64a77aa 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,11 @@ **English** · [Français](README.fr.md) -A modern Linux desktop utility that scans your disk and **safely** reclaims -space: temporary files, oversized files, stale git worktrees, developer caches, -**installed applications** and a **file-type breakdown** — around a 3D usage -donut, with a recoverable-by-default deletion model. +A modern **Linux and Windows** desktop utility that scans your disk and +**safely** reclaims space: temporary files, oversized files, stale git +worktrees, developer caches, **installed applications** and a **file-type +breakdown** — around a 3D usage donut, with a recoverable-by-default deletion +model. Built with **Tauri** (Rust core + WebView), licensed **GPL-3.0-or-later**. @@ -157,6 +158,34 @@ cargo tauri build # produces deb, rpm and AppImage bundles The standalone binary is at `target/release/freeyourdisk`. +### Prerequisites (Windows 10 1803+ / 11 · x64) + +[WebView2](https://developer.microsoft.com/en-us/microsoft-edge/webview2/) is +required (pre-installed on Windows 11; the NSIS setup installs it automatically +on Windows 10). Rust ([rustup.rs](https://rustup.rs)) and Node 22+ / pnpm are +also required. + +```bash +# Recommended for the Disk health section: +winget install smartmontools # puts smartctl on PATH +``` + +**Installing from a release:** download the `*-setup.exe` (unsigned NSIS +installer) from the [Releases](../../releases) page. Windows SmartScreen may +warn "Unknown publisher" — click **More info → Run anyway** to proceed. + +**Platform differences vs Linux:** privileged cleanup (system paths such as +`%WINDIR%\Temp`) prompts a **UAC elevation** dialog instead of Polkit / +`pkexec`. Scheduled cleanup uses a weekly **Task Scheduler** task instead of a +systemd user timer. + +### Build a release / .exe installer (Windows) + +```bash +pnpm --dir ui install && pnpm --dir ui build +cargo tauri build --bundles nsis # produces the NSIS installer +``` + ## Project layout ``` From 78cc9a790b179a932ce9c9b45dd95d8338bab362 Mon Sep 17 00:00:00 2001 From: rony Date: Sat, 27 Jun 2026 02:01:24 +0200 Subject: [PATCH 4/4] =?UTF-8?q?docs/feat:=20cosmetic=20polish=20=E2=80=94?= =?UTF-8?q?=20sources=20doc=20+=20macOS=20app=20badge?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - applications.rs: update module doc to mention macOS (.app) and Windows (registry/msix); expand AppEntry.source comment to list all 6 source variants - commands.rs: fix schedule_enabled doc (Linux-only wording; macOS uses launchd but that arm has its own docs) - api.ts: add 'app' to AppSource union (macOS .app bundles) - Applications.svelte: add app: '#8e8e93' to SOURCE_COLOR map (neutral grey badge for macOS app bundles) --- src-tauri/src/applications.rs | 9 +++++---- src-tauri/src/commands.rs | 2 +- ui/src/lib/api.ts | 1 + ui/src/lib/views/Applications.svelte | 1 + 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src-tauri/src/applications.rs b/src-tauri/src/applications.rs index 82207dd..59532b2 100644 --- a/src-tauri/src/applications.rs +++ b/src-tauri/src/applications.rs @@ -1,7 +1,8 @@ // SPDX-License-Identifier: GPL-3.0-or-later -//! Installed-application inventory: apt (dpkg), flatpak, snap and AppImages, -//! ranked by disk space. Supports batch uninstall and batch update; checking -//! for newer versions is a separate, on-demand pass. +//! Installed-application inventory: apt (dpkg), flatpak, snap and AppImages +//! on Linux; `.app` bundles on macOS; registry entries and MSIX packages on +//! Windows. Ranked by disk space. Supports batch uninstall and batch update; +//! checking for newer versions is a separate, on-demand pass. use serde::Serialize; use std::collections::HashSet; @@ -16,7 +17,7 @@ pub struct AppEntry { /// `appimage:/abs/path`. pub id: String, pub name: String, - /// "apt" | "flatpak" | "snap" | "appimage" + /// "apt" | "flatpak" | "snap" | "appimage" | "app" (macOS) | "registry" | "msix" (Windows) pub source: String, pub version: Option, pub size_bytes: u64, diff --git a/src-tauri/src/commands.rs b/src-tauri/src/commands.rs index b532f89..ba5eb44 100644 --- a/src-tauri/src/commands.rs +++ b/src-tauri/src/commands.rs @@ -104,7 +104,7 @@ pub async fn disk_usage() -> Result, String> { .map_err(|e| e.to_string()) } -/// Whether the weekly cleanup timer is enabled (systemd on Linux, launchd on macOS). +/// Whether the weekly cleanup timer is enabled (systemd user timer). #[cfg(target_os = "linux")] #[tauri::command] pub fn schedule_enabled() -> bool { diff --git a/ui/src/lib/api.ts b/ui/src/lib/api.ts index cb9715d..10e5038 100644 --- a/ui/src/lib/api.ts +++ b/ui/src/lib/api.ts @@ -115,6 +115,7 @@ export type AppSource = | "flatpak" | "snap" | "appimage" + | "app" | "registry" | "msix"; diff --git a/ui/src/lib/views/Applications.svelte b/ui/src/lib/views/Applications.svelte index 4505aa0..71694da 100644 --- a/ui/src/lib/views/Applications.svelte +++ b/ui/src/lib/views/Applications.svelte @@ -30,6 +30,7 @@ flatpak: "#4a90d9", snap: "#f5732b", appimage: "#f7a800", + app: "#8e8e93", // macOS app bundles (neutral grey) registry: "#0078d4", // Windows blue msix: "#5c2d91", // Microsoft purple };