Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

fix(windows): publish portable build as zip (#857)

Lan4d6db7e00e18
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index c7e30bb7e..8237a6cff 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -7,12 +7,12 @@
# git push origin <branch> v0.2.0 # push → this workflow builds & publishes
#
# Builds installers for every platform defined in the electron-builder config
-# (macOS dmg/zip arm64 and x64, Windows NSIS and portable x64, Linux
+# (macOS dmg/zip arm64 and x64, Windows NSIS and portable ZIP x64, Linux
# AppImage/deb/rpm x64), each
# with its native pi-desktop-host-core Rust sidecar. The Linux app.asar is also
# exported as a system-Electron repackaging asset, and all outputs — with their
# electron-updater latest*.yml feeds — are published to the GitHub Release
-# (D126/D285/D364). macOS tag artifacts are Developer ID-signed, notarized, and
+# (D126/D285/D364/D603). macOS tag artifacts are Developer ID-signed, notarized, and
# stapled before upload (D450 / ADR 0289).
#
# It also builds the headless `pi-host` bundle for every Linux platform the
@@ -511,11 +511,11 @@ jobs:
- name: Create GitHub Release
uses: softprops/action-gh-release@v3
with:
- # D126/D285/D364: all desktop platforms and both native macOS
+ # D126/D285/D364/D603: all desktop platforms and both native macOS
# architectures ship from tag builds — installers, the Windows
- # portable exe, the Linux ASAR, blockmaps, and the latest*.yml
+ # portable ZIP, the Linux ASAR, blockmaps, and the latest*.yml
# feeds that drive electron-updater on each platform (in-app for
- # Windows NSIS and Linux AppImage; macOS and Windows portable remain
+ # Windows NSIS and Linux AppImage; macOS and Windows ZIP remain
# manual-delivery by product policy).
files: dist/*
generate_release_notes: true
diff --git a/README.md b/README.md
index 315c24f38..0f8b2a634 100644
--- a/README.md
+++ b/README.md
@@ -573,7 +573,7 @@ Agent / Plan / Goal
| -------- | ------------- | --------------------------------------- |
| macOS | Apple Silicon | `.dmg` / `.zip` |
| macOS | Intel | `.dmg` / `.zip` |
-| Windows | x64 | Installer / Portable |
+| Windows | x64 | Installer / `.zip` |
| Linux | x64 | `.AppImage` / `.deb` / `.rpm` / `.asar` |
macOS releases are signed with a Developer ID certificate and notarized by Apple.
diff --git a/README.zh-CN.md b/README.zh-CN.md
index 30a4a154b..aa4ccf447 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -576,7 +576,7 @@ Agent / Plan / Goal
| -------- | ------------- | --------------------------------------- |
| macOS | Apple Silicon | `.dmg` / `.zip` |
| macOS | Intel | `.dmg` / `.zip` |
-| Windows | x64 | Installer / Portable |
+| Windows | x64 | 安装程序 / `.zip` |
| Linux | x64 | `.AppImage` / `.deb` / `.rpm` / `.asar` |
macOS Release 使用 Developer ID 签名并经过 Apple Notarization。
diff --git a/apps/desktop/electron/main/updater.ts b/apps/desktop/electron/main/updater.ts
index f0b287177..7eaeea770 100644
--- a/apps/desktop/electron/main/updater.ts
+++ b/apps/desktop/electron/main/updater.ts
@@ -7,11 +7,14 @@
* stables. Delivery mode per install:
* - Windows NSIS / Linux AppImage / packaged macOS → full in-app flow: silent
* background download, "restart to update" prompt, install-on-quit fallback.
- * - Windows portable (`PORTABLE_EXECUTABLE_FILE`) → notify + link. The
+ * - Windows ZIP / legacy portable (`piDistribution = "zip"` or
+ * `PORTABLE_EXECUTABLE_FILE`) → notify + link. The
* NSIS installer must not replace a no-install run.
* - Linux deb (no $APPIMAGE in env) → notify + link.
* - Unpackaged dev runs → disabled (no app-update.yml in resources).
*/
+import { readFileSync } from "node:fs";
+import { join } from "node:path";
import { app, shell } from "electron";
import electronUpdaterPkg from "electron-updater";
import type { UpdateInfo, ProgressInfo } from "electron-updater";
@@ -51,16 +54,22 @@ export type UpdaterOptions = {
/** Overrides for tests. */
platform?: NodeJS.Platform;
isPackaged?: boolean;
+ distribution?: WindowsDistribution;
};
+export type WindowsDistribution = "installed" | "zip";
+
export function resolveUpdateMode(
platform: NodeJS.Platform,
isPackaged: boolean,
env: NodeJS.ProcessEnv = process.env,
+ distribution?: WindowsDistribution,
): UpdateMode {
if (!isPackaged) return "disabled";
if (platform === "win32") {
- return env.PORTABLE_EXECUTABLE_FILE ? "manual" : "in-app";
+ return env.PORTABLE_EXECUTABLE_FILE || distribution === "zip"
+ ? "manual"
+ : "in-app";
}
if (platform === "darwin") return "in-app";
if (platform === "linux" && env.APPIMAGE) return "in-app";
@@ -86,13 +95,49 @@ export class AppUpdaterController {
*/
private installRequested = false;
+ private readPackagedDistribution(
+ isPackaged: boolean,
+ ): WindowsDistribution | undefined {
+ if (!isPackaged) return undefined;
+ try {
+ const packageJson = JSON.parse(
+ readFileSync(join(app.getAppPath(), "package.json"), "utf8"),
+ ) as unknown;
+ if (typeof packageJson !== "object" || packageJson === null) {
+ return undefined;
+ }
+ const distribution = (packageJson as Record<string, unknown>)
+ .piDistribution;
+ return distribution === "installed" || distribution === "zip"
+ ? distribution
+ : undefined;
+ } catch (error) {
+ this.logger.app(
+ "updater",
+ "warn",
+ "packaged distribution metadata unavailable",
+ { data: { detail: String(error) } },
+ );
+ return undefined;
+ }
+ }
+
constructor(options: UpdaterOptions) {
this.logger = options.logger;
this.send = options.send;
this.getLocale = options.getLocale ?? (() => "en");
+ const platform = options.platform ?? process.platform;
+ const isPackaged = options.isPackaged ?? app.isPackaged;
+ const distribution =
+ options.distribution ??
+ (platform === "win32"
+ ? this.readPackagedDistribution(isPackaged)
+ : undefined);
const mode = resolveUpdateMode(
- options.platform ?? process.platform,
- options.isPackaged ?? app.isPackaged,
+ platform,
+ isPackaged,
+ process.env,
+ distribution,
);
this.state = {
mode,
diff --git a/apps/desktop/package.json b/apps/desktop/package.json
index 6b0089a05..277862d17 100644
--- a/apps/desktop/package.json
+++ b/apps/desktop/package.json
@@ -25,9 +25,9 @@
"build:host-release": "cargo build --release --manifest-path ../../Cargo.toml -p host-core",
"bundle:runtime": "pnpm -C ../../packages/agent-runtime bundle",
"pack": "pnpm run build:deps && pnpm run build:host-release && pnpm run bundle:runtime && electron-vite build && electron-builder --dir",
- "dist": "pnpm run build:deps && pnpm run build:host-release && pnpm run bundle:runtime && electron-vite build && electron-builder --publish never",
+ "dist": "pnpm run build:deps && pnpm run build:host-release && pnpm run bundle:runtime && electron-vite build && node ../../scripts/build-desktop-release.mjs",
"dist:mac": "pnpm run build:deps && pnpm run build:host-release && pnpm run bundle:runtime && electron-vite build && electron-builder --mac --publish never",
- "dist:win": "pnpm run build:deps && pnpm run build:host-release && pnpm run bundle:runtime && electron-vite build && electron-builder --win --publish never",
+ "dist:win": "pnpm run build:deps && pnpm run build:host-release && pnpm run bundle:runtime && electron-vite build && node ../../scripts/build-desktop-release.mjs win",
"dist:linux": "pnpm run build:deps && pnpm run build:host-release && pnpm run bundle:runtime && electron-vite build && electron-builder --linux --publish never"
},
"dependencies": {
@@ -87,6 +87,9 @@
"repo": "PI-Desktop"
}
],
+ "extraMetadata": {
+ "piDistribution": "installed"
+ },
"files": [
"out/**/*",
"package.json",
@@ -195,6 +198,7 @@
},
"win": {
"executableName": "PI-Desktop",
+ "artifactName": "PI-Desktop-Portable-${version}.${ext}",
"target": [
{
"target": "nsis",
@@ -203,7 +207,7 @@
]
},
{
- "target": "portable",
+ "target": "zip",
"arch": [
"x64"
]
@@ -227,11 +231,6 @@
"shortcutName": "PI-Desktop",
"artifactName": "PI-Desktop-Setup-${version}.${ext}"
},
- "portable": {
- "artifactName": "PI-Desktop-Portable-${version}.${ext}",
- "requestExecutionLevel": "user",
- "unpackDirName": "PI-Desktop-Portable"
- },
"deb": {
"packageName": "pi-desktop",
"artifactName": "pi-desktop_${version}_${arch}.${ext}"
diff --git a/apps/desktop/test/auto-update.test.mjs b/apps/desktop/test/auto-update.test.mjs
index 73da39bea..a0e25475c 100644
--- a/apps/desktop/test/auto-update.test.mjs
+++ b/apps/desktop/test/auto-update.test.mjs
@@ -24,6 +24,7 @@ const [
appSource,
stylesSource,
pkgSource,
+ buildReleaseSource,
releaseWorkflowSource,
enSource,
zhSource,
@@ -41,6 +42,7 @@ const [
readAppSource(),
loadStyles(),
read("../package.json"),
+ read("../../../scripts/build-desktop-release.mjs"),
read("../../../.github/workflows/release.yml"),
read("../../../packages/i18n/src/locales/en/index.ts"),
read("../../../packages/i18n/src/locales/zh-CN/index.ts"),
@@ -95,7 +97,11 @@ test("updater gates delivery mode by platform and delivery policy", () => {
// Dev builds are disabled outright.
assert.match(updaterSource, /if \(!isPackaged\) return "disabled"/);
assert.match(updaterSource, /win32.*in-app|in-app.*win32/s);
- assert.match(updaterSource, /PORTABLE_EXECUTABLE_FILE \? "manual"/);
+ assert.match(
+ updaterSource,
+ /PORTABLE_EXECUTABLE_FILE[\s\S]*distribution === "zip"/,
+ );
+ assert.match(updaterSource, /piDistribution/);
assert.match(updaterSource, /platform === "darwin"[\s\S]*return "in-app"/);
assert.match(updaterSource, /APPIMAGE/);
assert.match(updaterSource, /autoInstallOnAppQuit = true/);
@@ -231,9 +237,14 @@ test("packaging publishes an electron-updater feed for GitHub Releases", () => {
assert.ok(macTargets.includes("zip"), "mac zip target (Squirrel.Mac feed)");
// electron-builder must never self-publish (implicit tag publishing would
// fail on the missing token and race the softprops release step).
- for (const script of ["dist", "dist:mac", "dist:win", "dist:linux"]) {
- assert.match(pkg.scripts[script], /--publish never/, script);
+ for (const script of ["dist:mac", "dist:win", "dist:linux"]) {
+ assert.match(
+ pkg.scripts[script],
+ /--publish never|build-desktop-release\.mjs/,
+ script,
+ );
}
+ assert.match(pkg.scripts.dist, /build-desktop-release\.mjs/);
assert.equal(pkg.build.linux.executableName, "pi-desktop");
const linuxTargets = pkg.build.linux.target.map((entry) => entry.target);
assert.deepEqual(
@@ -258,17 +269,19 @@ test("packaging publishes an electron-updater feed for GitHub Releases", () => {
// GitHub asset URLs mangle spaces; keep Windows artifact names space-free.
assert.equal(pkg.build.nsis.artifactName, "PI-Desktop-Setup-${version}.${ext}");
const winTargets = pkg.build.win.target.map((entry) => entry.target);
- assert.deepEqual(winTargets, ["nsis", "portable"], "Windows release targets");
+ assert.deepEqual(winTargets, ["nsis", "zip"], "Windows release targets");
+ assert.equal(pkg.build.portable, undefined, "legacy self-extracting target removed");
assert.equal(
- pkg.build.portable.artifactName,
+ pkg.build.win.artifactName,
"PI-Desktop-Portable-${version}.${ext}",
);
- assert.equal(pkg.build.portable.requestExecutionLevel, "user");
- assert.equal(
- pkg.build.portable.unpackDirName,
- "PI-Desktop-Portable",
- "portable extraction path stays stable for Windows taskbar identity",
- );
+ assert.equal(pkg.build.extraMetadata.piDistribution, "installed");
+ assert.match(pkg.scripts["dist:win"], /build-desktop-release\.mjs win/);
+ assert.match(buildReleaseSource, /"--win",\s*"nsis"/);
+ assert.match(buildReleaseSource, /"--win",\s*"zip"/);
+ assert.match(buildReleaseSource, /"--publish",\s*"never"/);
+ assert.match(buildReleaseSource, /piDistribution=installed/);
+ assert.match(buildReleaseSource, /piDistribution=zip/);
// The upload step must carry every updater feed, and the release publishes
// all platforms unfiltered (D126/D285).
assert.match(releaseWorkflowSource, /release\/\*\.zip/);
diff --git a/apps/desktop/test/window-menu.test.mjs b/apps/desktop/test/window-menu.test.mjs
index 507986371..74bcb6019 100644
--- a/apps/desktop/test/window-menu.test.mjs
+++ b/apps/desktop/test/window-menu.test.mjs
@@ -360,9 +360,12 @@ test("desktop packaging builds the native host before every local target", () =>
for (const name of ["pack", "dist", "dist:mac", "dist:win", "dist:linux"]) {
const script = packageJson.scripts[name];
assert.match(script, /pnpm run build:host-release/);
+ const packagingCommand = script.includes("build-desktop-release.mjs")
+ ? "build-desktop-release.mjs"
+ : "electron-builder";
assert.ok(
- script.indexOf("pnpm run build:host-release") < script.indexOf("electron-builder"),
- `${name} must build the native host before electron-builder packages it`,
+ script.indexOf("pnpm run build:host-release") < script.indexOf(packagingCommand),
+ `${name} must build the native host before the packaging command`,
);
}
assert.equal(packageJson.build.win.extraResources[0].to, "bin/pi-desktop-host-core.exe");
diff --git a/docs/adr/0022-application-update-delivery.md b/docs/adr/0022-application-update-delivery.md
index 697522710..e8537519f 100644
--- a/docs/adr/0022-application-update-delivery.md
+++ b/docs/adr/0022-application-update-delivery.md
@@ -1,9 +1,9 @@
# ADR 0022: Application Update Delivery
-- Status: Accepted (amended by D364 / ADR 0197, D450 / ADR 0289)
+- Status: Accepted (amended by D364 / D603 / ADR 0197, D450 / ADR 0289)
- Date: 2026-07-26
- Deciders: PI-Desktop core
-- Related: D120, D126, D364, D010, D450, ADR 0021, ADR 0197, ADR 0289
+- Related: D120, D126, D364, D603, D010, D450, ADR 0021, ADR 0197, ADR 0289
## Context
@@ -22,10 +22,11 @@ download-and-install flow.
cannot supply a feed URL.
2. Development builds keep updates disabled. Packaged macOS, Windows NSIS, and
Linux AppImage use in-app download and quit-and-install delivery. Non-AppImage
- Linux (deb/rpm) and Windows portable builds (`PORTABLE_EXECUTABLE_FILE`) use
+ Linux (deb/rpm) and Windows ZIP builds (`piDistribution = "zip"`) use
notify-and-link delivery so an NSIS installer cannot replace a no-install
- run. (Packaged macOS was notify-and-link until D450 / ADR 0289 qualified the
- signed in-app channel.)
+ run. Legacy portable executables remain manual when
+ `PORTABLE_EXECUTABLE_FILE` is present. (Packaged macOS was notify-and-link
+ until D450 / ADR 0289 qualified the signed in-app channel.)
3. The updater always sets `allowPrerelease = false`. electron-updater would
otherwise pin prerelease installs (for example `0.2.0-rc.6`) to the same
custom channel (`rc`) and never offer a newer stable GitHub latest release.
@@ -54,8 +55,8 @@ download-and-install flow.
- The sandboxed renderer cannot redirect update traffic or install arbitrary
packages.
- Windows NSIS, Linux AppImage, and packaged macOS can update in-app from
- published tag feeds; Linux deb and Windows portable users install from the
- release page.
+ published tag feeds; Linux deb and Windows ZIP users install from the
+ release page after extracting the archive.
- Prerelease installs graduate to newer stable releases through the same
latest feed; a dedicated RC channel is not active.
- In-app bilingual release highlights ship with the build and follow the
@@ -78,3 +79,13 @@ Official GitHub tag macOS artifacts are Developer ID-signed, notarized, and
stapled. Packaged macOS therefore uses the same in-app `electron-updater` lane
as Windows NSIS and Linux AppImage. Local unsigned packaging without a
certificate remains available (D078).
+
+## Amendment (D603)
+
+The Windows no-install lane now publishes a normal ZIP archive instead of
+electron-builder's self-extracting `portable` executable. The release helper
+builds NSIS and ZIP separately and stamps the ZIP app metadata with
+`piDistribution = "zip"`; the updater uses that marker to keep the ZIP manual
+even though ordinary ZIP launches do not set `PORTABLE_EXECUTABLE_FILE`. Users
+extract the archive and run `PI-Desktop.exe`; the NSIS lane and existing data
+directory remain unchanged.
diff --git a/docs/adr/0197-windows-portable-exe.md b/docs/adr/0197-windows-portable-exe.md
index 1cb17c1d5..7d0889bac 100644
--- a/docs/adr/0197-windows-portable-exe.md
+++ b/docs/adr/0197-windows-portable-exe.md
@@ -1,55 +1,61 @@
-# ADR 0197: Publish a Windows Portable Executable
+# ADR 0197: Publish a Windows Portable Package
-- Status: Accepted
-- Date: 2026-09-09
+- Status: Accepted (amended by D603)
+- Date: 2026-09-22
- Deciders: PI-Desktop core
-- Related: D120, D126, D364, ADR 0022, E2E-211
+- Related: D120, D126, D364, D603, ADR 0022, E2E-211
## Context
-Windows tag releases published only an NSIS installer
+Windows tag releases publish an NSIS installer
(`PI-Desktop-Setup-<version>.exe`). Company environments that whitelist a
-single executable, or that block installers, cannot run that artifact without
-an approved install. The request is a no-install `.exe`, not a change to data
-ownership or to the NSIS in-app update lane.
+single executable, or that block installers, also need a no-install package.
+The previous electron-builder `portable` target produced a self-extracting
+executable. In some Windows environments that wrapper could trigger an
+administrator prompt and did not provide a reliable normal executable identity
+for the taskbar.
-electron-builder's `portable` target produces a user-level self-extracting
-executable. It does not write `latest.yml`. Applying the NSIS updater to a
-portable run would launch the installer and convert the no-install copy into
-an installed one.
+The no-install lane must not change data ownership or the NSIS in-app update
+lane. A normal ZIP lets the user choose the extraction directory and launches
+the packaged `PI-Desktop.exe` directly.
## Decision
-1. The Windows x64 release lane publishes both NSIS and portable targets.
-2. The portable artifact name is space-free:
- `PI-Desktop-Portable-${version}.exe`.
-3. Portable requests `user` execution level so launch does not require
- administrator rights.
-4. electron-builder continues to write `latest.yml` only for NSIS. Portable
- does not become an auto-update payload.
-5. Packaged portable runs are detected by `PORTABLE_EXECUTABLE_FILE` and use
- notify-and-link delivery. NSIS installs keep in-app download and
+1. The Windows x64 release lane publishes both NSIS and ZIP targets.
+2. The no-install artifact name is space-free:
+ `PI-Desktop-Portable-${version}.zip`.
+3. The Windows release helper builds NSIS and ZIP in separate
+ electron-builder invocations. The ZIP app metadata contains
+ `piDistribution = "zip"`; installed builds contain `piDistribution =
+ "installed"`.
+4. The ZIP target does not write `latest.yml`. Packaged ZIP runs use
+ notify-and-link delivery, while NSIS installs keep in-app download and
quit-and-install.
+5. The updater continues to recognize `PORTABLE_EXECUTABLE_FILE` for older
+ portable executables, but ordinary ZIP launches use the packaged metadata
+ marker instead.
6. User data, logs, and secrets stay in the existing application data
directory. This decision does not introduce a beside-the-exe profile.
## Consequences
-- Windows users who cannot run an installer can download and launch one
- executable from the GitHub Release.
-- Portable users discover updates in-app and open the releases page; they
- replace the portable file themselves.
+- Windows users who cannot run an installer can download, extract, and launch
+ `PI-Desktop.exe` from the ZIP without a self-extracting wrapper.
+- The extracted executable keeps the normal PI-Desktop Windows identity for
+ taskbar grouping and icon display.
+- ZIP users discover updates in-app and open the releases page; they replace
+ the extracted application themselves.
- NSIS in-app updates, hashes, and feed ownership are unchanged.
-- The portable process still unpacks application files under the Windows temp
- directory for that launch. Whitelisting applies to the downloaded portable
- executable; a policy that also blocks temp-directory execution may still
- require the NSIS install.
+- The ZIP package is larger on disk after extraction than the old temporary
+ self-extracting wrapper, but it avoids runtime extraction and its related
+ execution-policy prompts.
## Alternatives considered
-- Zip of `win-unpacked` only: rejected as the requested artifact is a
- no-install `.exe`.
-- In-app update of portable via the NSIS installer: rejected because it would
+- Keep electron-builder's `portable` target: rejected because its
+ self-extracting wrapper is the source of the administrator-prompt and
+ taskbar-identity problems this amendment addresses.
+- In-app update of ZIP via the NSIS installer: rejected because it would
install the application and require a whitelisted installer.
- Beside-the-exe data directory: rejected as an unrelated data-ownership
change; `PI_DESKTOP_DATA_DIR` already relocates the profile when needed.
diff --git a/docs/adr/README.md b/docs/adr/README.md
index 1bba2caf8..bae9632d5 100644
--- a/docs/adr/README.md
+++ b/docs/adr/README.md
@@ -218,7 +218,7 @@ Each ADR includes:
| 0194 | Optional subagent thinking override | Accepted for implementation |
| 0195 | Viewport-fixed work panel toggle | Accepted (amends 0068 / 0085) |
| 0196 | Show provider retry causes in the active-turn status | Accepted (amends 0175) |
-| 0197 | Publish a Windows Portable Executable | Accepted (amends 0022 / D126) |
+| 0197 | Publish a Windows Portable Package | Accepted (amends 0022 / D126 / D603) |
| 0198 | Name every quiet interval on the live activity row | Accepted (amends 0175 / 0186) |
| 0200 | Host-owned plugin session import and ownership API | Accepted |
| 0201 | Explicit plugin project ids and host-owned session refresh | Accepted |
diff --git a/docs/spec/01-product/01-product-scope.md b/docs/spec/01-product/01-product-scope.md
index a6d281fdd..dbbb6fd88 100644
--- a/docs/spec/01-product/01-product-scope.md
+++ b/docs/spec/01-product/01-product-scope.md
@@ -141,5 +141,5 @@ the internal `page = "chat"` route value; that value is not an operating mode.
|---|---|---|
| macOS Apple Silicon | Published | Primary development and acceptance platform; signing/notarization remains credential-gated |
| macOS Intel | Published | Native x64 DMG/ZIP release lane; signing/notarization remains credential-gated |
-| Windows x64 | Published | NSIS installer, portable exe, and in-app update lane for NSIS; native qualification continues |
+| Windows x64 | Published | NSIS installer, portable ZIP, and in-app update lane for NSIS; native qualification continues |
| Linux x64 | Published | AppImage, deb, and rpm packages; AppImage update lane; glibc 2.35+ (Ubuntu 22.04, Debian 12, Fedora 36+); native qualification continues |
diff --git a/docs/spec/03-runtime/07-process-model.md b/docs/spec/03-runtime/07-process-model.md
index 314b6f9ca..e95a689b4 100644
--- a/docs/spec/03-runtime/07-process-model.md
+++ b/docs/spec/03-runtime/07-process-model.md
@@ -284,8 +284,10 @@ sidecar/host shutdown sequence runs before the updater replaces the app.
- renderer dependencies ship through Vite output rather than duplicate raw
package trees; no interactive PTY native module is packaged
- packaged builds use the Main-owned update controller. macOS, non-AppImage
- Linux, and Windows portable runs are manual-delivery modes; Windows NSIS and
- Linux AppImage use the in-app feeds published by D126 tag releases
+ Linux, and Windows ZIP runs are manual-delivery modes; legacy Windows
+ portable executables remain manual when `PORTABLE_EXECUTABLE_FILE` is set.
+ Windows NSIS and Linux AppImage use the in-app feeds published by D126 tag
+ releases
## 7. Remote target topology (post-MVP)
diff --git a/docs/spec/04-ux/09-interaction-patterns.md b/docs/spec/04-ux/09-interaction-patterns.md
index 66feccd36..2310fd3ca 100644
--- a/docs/spec/04-ux/09-interaction-patterns.md
+++ b/docs/spec/04-ux/09-interaction-patterns.md
@@ -561,8 +561,8 @@ may be retained while exactly one workspace supplies the visible shell context.
- Settings → Info and application-menu checks share one typed update state.
Manual checks expose up-to-date or error feedback; automatic failures do not
open a toast or ambient banner.
-- Manual delivery (non-AppImage Linux and Windows portable runs
- with `PORTABLE_EXECUTABLE_FILE`) stops at `available` and
+- Manual delivery (non-AppImage Linux and Windows ZIP runs, or legacy Windows
+ portable runs with `PORTABLE_EXECUTABLE_FILE`) stops at `available` and
offers the fixed GitHub Releases page. In-app delivery (packaged macOS,
Windows NSIS, and Linux AppImage) automatically advances through
`downloading` to the stable `downloaded` state.
@@ -589,7 +589,7 @@ may be retained while exactly one workspace supplies the visible shell context.
Escape, or the backdrop, and restores focus to the invoking control.
- D126 tag releases publish all platform manifests and installers. Packaged
macOS, Windows NSIS, and Linux AppImage use the in-app lane; Linux deb/rpm
- and Windows portable remain notify-and-link delivery modes.
+ and Windows ZIP remain notify-and-link delivery modes.
## 2. Streaming message behavior
diff --git a/docs/spec/05-security/01-security.md b/docs/spec/05-security/01-security.md
index 31ef9f5e3..87013c18e 100644
--- a/docs/spec/05-security/01-security.md
+++ b/docs/spec/05-security/01-security.md
@@ -210,12 +210,13 @@ claim availability or freshness against a malicious server.
- Feed manifests bind artifacts with electron-builder hashes. An error,
unavailable feed, hash mismatch, or invalid updater state must not install.
- Packaged macOS, Windows NSIS, and Linux AppImage download and install in-app
- from the GitHub Releases feed. Linux deb/rpm and Windows portable detect a
- release and open the fixed releases page.
+ from the GitHub Releases feed. Linux deb/rpm and Windows ZIP detect a
+ release and open the fixed releases page. Legacy Windows portable
+ executables remain manual when `PORTABLE_EXECUTABLE_FILE` is present.
- D126 tag releases publish Windows NSIS and Linux AppImage installers with
their update manifests, plus Linux deb/rpm packages and a Windows portable
- exe. The NSIS and AppImage artifacts activate the existing in-app lanes.
- The portable exe uses notify-and-link delivery and does not write
+ ZIP. The NSIS and AppImage artifacts activate the existing in-app lanes.
+ The portable ZIP uses notify-and-link delivery and does not write
`latest.yml`. macOS tag artifacts are Developer ID-signed, notarized, and
stapled before upload; rollback and staged-rollout qualification remain
release follow-ups.
diff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.md
index ba3dbb65d..f42874a85 100644
--- a/docs/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/spec/06-delivery/04-e2e-test-plan.md
@@ -4211,8 +4211,9 @@ identify the platform validation still needed.
- **Expected**: Update state reports `available` (manual platforms) or
advances through in-app download for packaged macOS, Windows NSIS, and
Linux AppImage with `availableVersion` equal to the newer stable tag. A
- Windows portable run (`PORTABLE_EXECUTABLE_FILE`) stays on the manual
- notify-and-link path and must not download or run the NSIS installer. The
+ Windows portable ZIP run stays on the manual notify-and-link path and must
+ not download or run the NSIS installer; a legacy portable executable is
+ likewise manual when `PORTABLE_EXECUTABLE_FILE` is present. The
client must not report up-to-date merely because no newer release shares the
same `rc` prerelease channel.
- **Specs linked**: `04-ux/09-interaction-patterns.md`,
@@ -11662,26 +11663,29 @@ are withdrawn with ADR 0165.
- **Milestone**: M6+
- **Status**: Unit/source-contract-covered; full UI journey Draft
-#### E2E-211: Windows portable exe launches without an installer (D364)
+#### E2E-211: Windows portable ZIP launches after extraction (D603)
- **Preconditions**: A Windows x64 tag or `dist:win` package has produced both
- `PI-Desktop-Setup-<version>.exe` and `PI-Desktop-Portable-<version>.exe` from
+ `PI-Desktop-Setup-<version>.exe` and `PI-Desktop-Portable-<version>.zip` from
the shared electron-builder config; a clean user profile is available; the
account is a standard user without administrator elevation.
-- **Steps**: 1) Inspect the release directory and `latest.yml`. 2) Launch the
- portable exe without running the NSIS installer. 3) Confirm the process
- environment includes `PORTABLE_EXECUTABLE_FILE`. 4) Invoke Check for Updates.
- 5) Confirm Settings → Info offers the releases page rather than Restart to
- update. 6) Quit and relaunch the same portable file.
+- **Steps**: 1) Inspect the release directory and `latest.yml`. 2) Extract the
+ portable ZIP to a user-writable directory without running the NSIS installer.
+ 3) Launch the extracted `PI-Desktop.exe`. 4) Confirm there is no
+ administrator prompt and that the running app has the PI-Desktop icon and
+ taskbar entry. 5) Invoke Check for Updates. 6) Confirm Settings → Info offers
+ the releases page rather than Restart to update. 7) Quit and relaunch the
+ extracted executable.
- **Expected**: Both Windows artifacts are space-free and uploaded. `latest.yml`
- points at the NSIS installer only. The portable exe starts without a setup
- wizard or administrator prompt, uses the existing application data directory,
- and reports update mode `manual`. An available update does not download or
- run `PI-Desktop-Setup-<version>.exe`. Relaunch restores sessions from that
- same profile.
+ points at the NSIS installer only. The extracted ZIP app starts without a
+ setup wizard or administrator prompt, keeps the normal PI-Desktop taskbar
+ identity/icon, uses the existing application data directory, and reports
+ update mode `manual`. An available update does not download or run
+ `PI-Desktop-Setup-<version>.exe`. Relaunch restores sessions from that same
+ profile.
- **Specs linked**: `01-product/01-product-scope.md`,
`06-delivery/06-release-runbook.md`, `03-runtime/07-process-model.md`,
- ADR 0197 / D364
+ ADR 0197 / D603
- **Acceptance**: Quality (release packaging)
- **Milestone**: M6+
- **Status**: Unit/source-contract covered (`auto-update.test.mjs`); native
diff --git a/docs/spec/06-delivery/06-release-runbook.md b/docs/spec/06-delivery/06-release-runbook.md
index eebeb5211..220d9fe2a 100644
--- a/docs/spec/06-delivery/06-release-runbook.md
+++ b/docs/spec/06-delivery/06-release-runbook.md
@@ -1,6 +1,6 @@
# 06. Desktop Release Runbook
-> Scope: D126/D285 tag artifacts for macOS arm64 and Intel x64, Windows x64,
+> Scope: D126/D285/D603 tag artifacts for macOS arm64 and Intel x64, Windows x64,
> and Linux x64, including the Linux system-Electron ASAR asset;
> macOS signing/notarization remains the detailed qualification lane below.
> Cross-references: [milestones](01-mvp-milestones.md) · [process model](../03-runtime/07-process-model.md) · [security](../05-security/01-security.md)
@@ -578,7 +578,7 @@ Manual smoke on a clean profile (`PI_DESKTOP_DATA_DIR=$(mktemp -d)`):
The repository exposes native-runner commands for every release target. Each
packaging command first runs `build:host-release`, then bundles the agent
-runtime and Electron app. D126/D285 tag workflows publish these outputs and
+runtime and Electron app. D126/D285/D603 tag workflows publish these outputs and
their electron-updater manifests. Run a target command on that target OS:
```text
@@ -588,11 +588,15 @@ Windows: pnpm --filter @pi-desktop/desktop dist:win
Linux: pnpm --filter @pi-desktop/desktop dist:linux
```
+The Windows `dist:win` command runs `scripts/build-desktop-release.mjs`,
+which invokes electron-builder once for NSIS and once for ZIP so each package
+gets the correct updater distribution marker.
+
The macOS packages include `bin/pi-desktop-host-core` built for their runner
architecture; Windows includes `bin/pi-desktop-host-core.exe`; Linux includes
`bin/pi-desktop-host-core`. Signing, rollback, and installer upgrade
qualification remain release hardening work; publication is active under
-D126/D285.
+D126/D285/D603.
Native-runner output matrix:
@@ -601,15 +605,18 @@ Native-runner output matrix:
- macOS Intel x64: `PI-Desktop-<version>-x64.dmg` and
`PI-Desktop-<version>-x64-mac.zip`
- Windows x64: NSIS installer `PI-Desktop-Setup-<version>.exe` and portable
- exe `PI-Desktop-Portable-<version>.exe`
+ ZIP `PI-Desktop-Portable-<version>.zip`
- Linux x64: AppImage, deb, and rpm
- Linux x64 system Electron asset: `PI-Desktop-<version>-linux-x64.asar`
-The portable Windows target does not write `latest.yml`. Packaged portable
-runs use notify-and-link delivery (`PORTABLE_EXECUTABLE_FILE`); NSIS keeps
-the in-app download and quit-and-install lane. Data stays in the existing
-application data directory. Portable requests user execution level, so launch
-does not require administrator rights.
+The portable Windows ZIP target does not write `latest.yml`. The Windows
+release helper builds NSIS and ZIP separately and stamps the ZIP app metadata
+with `piDistribution = "zip"`; packaged ZIP runs use notify-and-link delivery.
+Legacy portable executables remain manual when `PORTABLE_EXECUTABLE_FILE` is
+present. NSIS keeps the in-app download and quit-and-install lane. Data stays
+in the existing application data directory. Users extract the ZIP and launch
+`PI-Desktop.exe` directly, so the package does not run a self-extracting
+wrapper or request administrator execution.
RPM targets pass `_build_id_links none` to FPM. Bundled Electron binaries live
under `/opt/PI-Desktop`; omitting global `/usr/lib/.build-id` links prevents
@@ -636,7 +643,7 @@ Shell smoke on each native runner:
## 7. Known limitations
-- Linux deb/rpm and the Windows portable exe remain notify-and-link update
+- Linux deb/rpm and the Windows portable ZIP remain notify-and-link update
modes. Packaged macOS, Windows NSIS, and Linux AppImage use in-app
`electron-updater`.
- Linux x64 packages are built on Ubuntu 22.04 so host-core needs glibc 2.35
diff --git a/docs/spec/08-meta/decisions-log.md b/docs/spec/08-meta/decisions-log.md
index d6f203ca2..380b89801 100644
--- a/docs/spec/08-meta/decisions-log.md
+++ b/docs/spec/08-meta/decisions-log.md
@@ -28,7 +28,7 @@ This log freezes previously open questions into concrete decisions.
| D452 | Plan and goal artifacts open in the bundled file view | **The contract approval card's artifact opener hands the immutable `.pi/plan/*.md` or `.pi/goal/*.md` path to the bundled `pi.file-manager` view whenever that view is launchable, and to the host file tab otherwise — the same preference and fallback a chat file reference already uses (ADR 0241). The artifact still creates or activates a tab in its originating session, so the approval reveal itself is unchanged; only the surface changes. Renderer-only; no protocol, host, storage, artifact-content, or permission change. See D189, ADR 0043, `04-ux/08-component-spec.md` §5.4 and §10A.2, `04-ux/09-interaction-patterns.md` §5A, E2E-106.** | The approval opener used a host file tab while every other project file the conversation names already opens in the user's own file view, so a plan or goal landed in the one surface the user does not browse project files in. |
| D459 | Restore resizable sidebar width with collapse-below-threshold | **Amend D408 / ADR 0238 and restore ADR 0141 (ADR 0290): the expanded sidebar is again a renderer-owned `240px..520px` column (default `275px`) with a right-edge handle that previews on pointer-down, persists on release, and supports ArrowLeft/ArrowRight (16px), Home, and End. A pointer width below `160px` collapses as a user action without overwriting the preferred expanded width; keyboard resize never collapses. Live maximum is the three-column remainder after MainChat's 450px floor. Renderer only; existing `pi.desktop.sidebarWidth` preference. See E2E-168.** | Long labels need reclaimable width; ADR 0238's fixed 275px pin blocked that while the live three-column budget could already cap a user-chosen width. This decision was mistakenly recorded as D451 (already used by Review-opens-only-on-explicit-user-action); renumbered per issue #620. |
| D457 | Signed macOS DMG is a two-icon install | **Amend D406 / ADR 0232 / ADR 0204: official and local DMGs contain only PI-Desktop.app and the Applications link on a branded 720×440 plate. They no longer include `If app won't open, read this.txt` or the command helper. macOS ZIP packages still ship both the opening note and `PI-Desktop-macOS-open.command` for trusted unsigned artifacts. See ADR 0296 and E2E-196b.** | Tagged DMGs are signed and notarized (D450); the unsigned-opening note on the installer read as an error. |
-| D450 | Signed macOS GitHub Releases | **Amend D078 / ADR 0022: GitHub tag releases Developer ID-sign, notarize (`notarytool` via electron-builder 26), staple, and Gatekeeper-verify macOS DMG/ZIP before upload, using identity `Developer ID Application: XingYu Liu (DUV63RKYTW)` / team `DUV63RKYTW` from Actions secrets (`CSC_LINK`, `CSC_KEY_PASSWORD`, `APPLE_ID`, `APPLE_APP_SPECIFIC_PASSWORD`, `APPLE_TEAM_ID`). Missing secrets fail the job. Local unsigned packaging without a certificate remains. `workflow_dispatch` may set `sign_macos: false` only for unsigned debug artifacts. Packaged macOS uses in-app `electron-updater` (ZIP + merged `latest-mac.yml`); Linux deb/rpm and Windows portable stay notify-and-link. No afterPack/afterSign adhoc codesign (ADR 0278).** | Production DMGs must open without a Gatekeeper warning, and signed macOS installs can download and restart into a new tag. See ADR 0289, E2E-196c, E2E-067A. |
+| D450 | Signed macOS GitHub Releases | **Amend D078 / ADR 0022: GitHub tag releases Developer ID-sign, notarize (`notarytool` via electron-builder 26), staple, and Gatekeeper-verify macOS DMG/ZIP before upload, using identity `Developer ID Application: XingYu Liu (DUV63RKYTW)` / team `DUV63RKYTW` from Actions secrets (`CSC_LINK`, `CSC_KEY_PASSWORD`, `APPLE_ID`, `APPLE_APP_SPECIFIC_PASSWORD`, `APPLE_TEAM_ID`). Missing secrets fail the job. Local unsigned packaging without a certificate remains. `workflow_dispatch` may set `sign_macos: false` only for unsigned debug artifacts. Packaged macOS uses in-app `electron-updater` (ZIP + merged `latest-mac.yml`); Linux deb/rpm and Windows portable ZIP stay notify-and-link. No afterPack/afterSign adhoc codesign (ADR 0278).** | Production DMGs must open without a Gatekeeper warning, and signed macOS installs can download and restart into a new tag. See ADR 0289, E2E-196c, E2E-067A. |
## B. Secondary implementation defaults
@@ -349,7 +349,7 @@ Gold source: local Codex electron captures; latest row wins where rows conflict.
| ID | Topic | Decision | Rationale |
|---|---|---|---|
| D118 | Platform application menu and window chrome | **macOS installs a conventional system application menu and keeps hidden-inset traffic lights. Windows/Linux use the shared 46px frameless shell with localized File/Edit/View/Window/Help menus and renderer-drawn minimize/maximize-or-restore/close controls. Both menu surfaces route renderer-owned actions through a fixed `AppMenuCommand` allowlist; renderer menus route native editing/window actions through a separate fixed allowlist. Target packaging builds the local release host before Electron packaging. This adds platform-ready shell behavior but does not reverse D010: Windows/Linux release qualification remains post-MVP.** | A default Electron menu leaves macOS shell commands incomplete, while a frameless Windows/Linux window otherwise loses both application menus and window controls. Shared allowlists keep behavior consistent without exposing an arbitrary privileged command bridge. |
-| D120 | Application update delivery | *(amended by D364)* **Electron Main exclusively owns a fixed GitHub Releases feed, update polling, typed state, and install lifecycle. Development is disabled; packaged macOS and non-AppImage Linux use notify-and-link delivery, while Windows NSIS and Linux AppImage download in-app and install on quit. Renderer IPC cannot provide feed URLs. Automatic failures stay ambient, explicit checks surface status, and downloaded state remains actionable. The updater always forces `allowPrerelease = false` so prerelease installs (for example `0.2.0-rc.6`) track GitHub's latest stable release instead of electron-updater's default same-channel pin. D126 later publishes every platform feed produced by the tag matrix while macOS remains manual until a signed channel is qualified.** | Keep package installation outside the sandboxed renderer, match delivery to each installer format, and provide one consistent state across menus, Settings, and the update banner (ADR 0022). Without the stable-channel pin, RC builds never surface newer stables because electron-updater treats `rc` as a custom channel. |
+| D120 | Application update delivery | *(amended by D364 / D603)* **Electron Main exclusively owns a fixed GitHub Releases feed, update polling, typed state, and install lifecycle. Development is disabled; packaged macOS and non-AppImage Linux use notify-and-link delivery, while Windows NSIS and Linux AppImage download in-app and install on quit. Renderer IPC cannot provide feed URLs. Automatic failures stay ambient, explicit checks surface status, and downloaded state remains actionable. The updater always forces `allowPrerelease = false` so prerelease installs (for example `0.2.0-rc.6`) track GitHub's latest stable release instead of electron-updater's default same-channel pin. D126 later publishes every platform feed produced by the tag matrix while macOS remains manual until a signed channel is qualified.** | Keep package installation outside the sandboxed renderer, match delivery to each installer format, and provide one consistent state across menus, Settings, and the update banner (ADR 0022). Without the stable-channel pin, RC builds never surface newer stables because electron-updater treats `rc` as a custom channel. |
| D313 | Main-owned GitHub issue feedback | **GitHub issue forms are the only intake path. The bug form requires description, reproduction steps, expected and actual behavior, app version, and OS; the feature form requires a problem and a proposed change. Settings → Info exposes one Report a problem action on `pi-desktop/app/openFeedback`. Electron Main builds a fixed `bug_report.yml` URL, prefills `app-version` / `os` / `environment` from Main-owned version info, and opens it with `shell.openExternal`. The renderer cannot supply a URL. Feature requests stay on GitHub's template picker. No host-protocol, storage, or update-feed change (ADR 0157).** | Reports without version or steps cannot be triaged, and a renderer-chosen destination would weaken the same Main-owned GitHub URL rule as D120. |
| D330 | Main-owned `openExternal` protocol allowlist | **Every `shell.openExternal` call parses the URL first. Only `http:`, `https:` (hostname plus a written `//`), and `mailto:` (non-empty address) reach the OS, as a normalized href. `file:`, `javascript:`, `data:`, and custom URI schemes throw `DISALLOWED_EXTERNAL_URL` / plugin `INVALID_ARGUMENT`. Window-open handlers deny in-app and catch the error. Workspace files keep using `shell.openPath` after the path gate (ADR 0109). Preview "open in browser" uses the allowlist for web/mail URLs and `openPath` for an in-root file page (ADR 0168).** | Unvalidated `setWindowOpenHandler` → `openExternal` lets a clicked `ms-msdt:` / `file:` / custom-scheme link invoke an OS protocol handler. |
| D332 | Classified plugin file preview and live workspace events | **Amend ADR 0104 / 0105 / 0109 / 0111: add `fs.readPreview` under `fs.read` (text / image data URL / binary / tooLarge, same caps as the host Files tab). Broadcast panel events to docked views as well as detached windows. Deliver `workspace:changed` to panels and plugin processes. The bundled Files view restores Open with default app, search, image preview, and copy path on those public channels.** | `fs.readText` cannot preview images or cap large binaries; docked views missed `appearance:changed`; Files polled for project switches. |
@@ -462,8 +462,9 @@ section mirrors only marketplace/catalog items still blocking nothing.
| ID | Topic | Decision | Rationale |
|---|---|---|---|
-| D126 | Three-platform release delivery (lifts D010) | *(amended by D364)* **Tag builds publish every artifact the matrix produces to the GitHub Release: macOS dmg/zip (arm64), Windows NSIS x64, Linux AppImage + deb (x64), each with blockmaps and the platform's `latest*.yml` electron-updater feed. Publishing the feeds activates D120's in-app update lanes for Windows NSIS and Linux AppImage; macOS stays in notify-and-link mode until a signed channel is qualified. The NSIS artifact name is pinned space-free (`PI-Desktop-Setup-${version}.${ext}`) because GitHub asset URLs mangle spaces. D010's macOS-only scope is lifted per the baseline-bump rule (baseline `0.4.7`); the release pipeline itself was qualified end-to-end on v0.1.1-rc.1/v0.1.1.** | The pipeline builds and validates all three platforms on every tag anyway; keeping installers as expiring Actions artifacts (90-day retention) withheld them from users without adding safety. Publishing the update feeds is the point of shipping: platforms with in-app lanes update silently, and future platform regressions surface through real installs instead of unused artifacts. |
-| D364 | Windows portable exe without installer | **Amend D120 / D126 / ADR 0022: tag builds publish a Windows x64 portable exe `PI-Desktop-Portable-${version}.exe` alongside the NSIS installer `PI-Desktop-Setup-${version}.exe`. The portable target does not write `latest.yml`. Packaged portable runs (`PORTABLE_EXECUTABLE_FILE`) use notify-and-link delivery. NSIS installs keep in-app download and quit-and-install. Data stays in the existing application data directory. Portable requests user execution level.** | Company environments that whitelist a single executable cannot run the NSIS installer. Applying the NSIS updater to a portable run would install the app, so portable stays manual (ADR 0197, E2E-211). |
+| D126 | Three-platform release delivery (lifts D010) | *(amended by D364 / D603)* **Tag builds publish every artifact the matrix produces to the GitHub Release: macOS dmg/zip (arm64), Windows NSIS x64, Linux AppImage + deb (x64), each with blockmaps and the platform's `latest*.yml` electron-updater feed. Publishing the feeds activates D120's in-app update lanes for Windows NSIS and Linux AppImage; macOS stays in notify-and-link mode until a signed channel is qualified. The NSIS artifact name is pinned space-free (`PI-Desktop-Setup-${version}.${ext}`) because GitHub asset URLs mangle spaces. D010's macOS-only scope is lifted per the baseline-bump rule (baseline `0.4.7`); the release pipeline itself was qualified end-to-end on v0.1.1-rc.1/v0.1.1.** | The pipeline builds and validates all three platforms on every tag anyway; keeping installers as expiring Actions artifacts (90-day retention) withheld them from users without adding safety. Publishing the update feeds is the point of shipping: platforms with in-app lanes update silently, and future platform regressions surface through real installs instead of unused artifacts. |
+| D364 | Windows portable exe without installer | *(superseded by D603)* **Amend D120 / D126 / ADR 0022: tag builds publish a Windows x64 portable exe `PI-Desktop-Portable-${version}.exe` alongside the NSIS installer `PI-Desktop-Setup-${version}.exe`. The portable target does not write `latest.yml`. Packaged portable runs (`PORTABLE_EXECUTABLE_FILE`) use notify-and-link delivery. NSIS installs keep in-app download and quit-and-install. Data stays in the existing application data directory. Portable requests user execution level.** | Company environments that whitelist a single executable cannot run the NSIS installer. Applying the NSIS updater to a portable run would install the app, so portable stays manual (ADR 0197, E2E-211). |
+| D603 | Windows portable delivery uses a normal ZIP | **Amend D364 / ADR 0022 / ADR 0197: tag builds publish a Windows x64 portable ZIP `PI-Desktop-Portable-${version}.zip` alongside the NSIS installer `PI-Desktop-Setup-${version}.exe`. The Windows release helper builds NSIS and ZIP separately, stamps ZIP app metadata with `piDistribution = "zip"`, and keeps the ZIP target out of `latest.yml`. Extracted ZIP runs use notify-and-link delivery; the updater still recognizes `PORTABLE_EXECUTABLE_FILE` for older portable executables. Data stays in the existing application data directory.** | The self-extracting portable wrapper could trigger administrator prompts and did not provide a reliable normal executable identity for the taskbar. A user-extracted ZIP launches `PI-Desktop.exe` directly and preserves the manual-update boundary. |
| D260 | Release documentation is a version surface | **A stable version bump must update every version-bearing surface before the tag: the shipped-locale in-app changelog and its test list, every workspace `package.json` including `docs/package.json` (a third workspace root `scripts/release.mjs` previously skipped), the Cargo workspace version and `host-core` lockfile entry, `APP_VERSION`, and the `<major>.<minor>.x` release line stated in `README.md` and `README.zh-CN.md`. `scripts/check-release-docs.mjs` verifies all of them; `scripts/release.mjs` runs it after bumping and refuses to commit or tag while any surface disagrees, with `--skip-docs-check` reserved for deliberate non-release bumps. Extends D164.** | The in-app changelog gate alone left published documentation behind: the READMEs still advertised the `0.5.x` line at `0.10.8`, and `docs/package.json` sat at `0.5.8`. A tag is irreversible, so the check runs before the tag exists rather than as review etiquette. |
| D371 | Explicit unsigned macOS first-launch helper | *(amended by D406 and D443)* **Every macOS distribution ships an executable `PI-Desktop-macOS-open.command`, placed on the DMG in a visible first-launch row below the drag-to-Applications gesture. It searches only `/Applications/PI-Desktop.app` and `~/Applications/PI-Desktop.app`, verifies `CFBundleIdentifier` is `net.aiuo.pi-desktop`, removes only `com.apple.quarantine` when present, and opens the app. It never uses `sudo`, accepts no arbitrary path, and does not replace Developer ID signing or notarization.** | The unsigned macOS lane can be blocked by quarantine with a misleading damaged-app message, and the terminal-only `xattr -cr` note was broader than the launch failure requires (ADR 0204, E2E-196b) |
| D443 | Canonical application ID and macOS codesign identifier | **Amend D141 / D371 / ADR 0204: the application ID is `net.aiuo.pi-desktop` (`APP_ID`, electron-builder `appId`, macOS `CFBundleIdentifier`, Windows AppUserModelID). Development macOS hosts use `net.aiuo.pi-desktop.dev`. Do not adhoc-sign the unsigned pack in `afterPack`/`afterSign`: nested Electron helpers are still unsigned and `codesign` fails with `code object is not signed at all`. See ADR 0278 and issue #524.** | The owner domain is `net.aiuo.pi-desktop`. Binding the unsigned outer identifier is deferred until a helper-safe pack path exists. |
@@ -4221,6 +4222,19 @@ D193, and D194.
data directory. Portable requests user execution level.
- See ADR 0197 and E2E-211.
+## 2026-09-22 — Windows portable delivery uses a normal ZIP (D603)
+
+- Decision D603 amends D364 / ADR 0022 / ADR 0197. The Windows x64 lane now
+ publishes `PI-Desktop-Portable-<version>.zip` beside the NSIS installer.
+ The release helper builds the two targets separately and stamps the ZIP app
+ metadata with `piDistribution = "zip"`; the ZIP target does not write
+ `latest.yml`.
+- Users extract the ZIP and launch `PI-Desktop.exe` directly. The ZIP run uses
+ notify-and-link update delivery, while the updater keeps recognizing
+ `PORTABLE_EXECUTABLE_FILE` for older portable executables. The existing data
+ directory and NSIS in-app update lane are unchanged.
+- See ADR 0197 and E2E-211.
+
## 2026-09-09 — Name every quiet interval on the live activity row (D365)
- ADR 0175 named only `waiting-model`, `retrying`, and `waiting-subagents`.
diff --git a/docs/zh-CN/adr/index.md b/docs/zh-CN/adr/index.md
index b9b943fdb..507d6dea7 100644
--- a/docs/zh-CN/adr/index.md
+++ b/docs/zh-CN/adr/index.md
@@ -53,7 +53,7 @@ ADR 记录那些不应被静默改变的架构选择。中文入口与英文索
| [ADR 0194:可选的子智能体思考覆盖](/adr/0194-subagent-thinking-parameter-omission) | 子智能体可继承、显式关闭或不发送思考参数 |
| [ADR 0195:视口固定的工作面板开关](/adr/0195-viewport-fixed-work-panel-toggle) | 非设置页右上角提供与 Cmd/Ctrl+J 等价的指针开关 |
| [ADR 0196:在进行中重试行显示 provider 原因](/adr/0196-retry-cause-in-active-turn-status) | 悬停或聚焦重试状态行时显示错误摘要、错误码和安全的 provider 消息 |
-| [ADR 0197:发布 Windows 免安装便携版](/adr/0197-windows-portable-exe) | Windows x64 通道额外发布 Portable exe,安装程序仍走应用内更新 |
+| [ADR 0197:发布 Windows 免安装便携包](/adr/0197-windows-portable-exe) | Windows x64 通道额外发布可解压 ZIP,安装程序仍走应用内更新 |
| [ADR 0198:为每个安静间隔命名活动行](/adr/0198-quiet-interval-activity-phases) | 补齐 starting / preparing / compacting / recovering,并在等待 Subagent 时展示各自的粗粒度动作 |
| [ADR 0200:宿主拥有的插件会话导入与归属 API](/adr/0200-plugin-owned-session-api) | 插件历史会话由主机生成 id,并按插件、来源和外部 id 归属 |
| [ADR 0201:显式插件项目 id 与宿主拥有的会话刷新](/adr/0201-plugin-project-ids-and-session-refresh) | 插件可显式绑定主机项目,成功写入由主机通知渲染器刷新 |
@@ -263,7 +263,7 @@ ADR 记录那些不应被静默改变的架构选择。中文入口与英文索
| 0194 | [可选的子智能体思考覆盖](/adr/0194-subagent-thinking-parameter-omission) | 已接受待实现 |
| 0195 | [视口固定的工作面板开关](/adr/0195-viewport-fixed-work-panel-toggle) | 已接受(修订 ADR 0068 / ADR 0085) |
| 0196 | [在进行中重试行显示 provider 原因](/adr/0196-retry-cause-in-active-turn-status) | 已接受(修订 ADR 0175) |
-| 0197 | [发布 Windows 免安装便携版](/adr/0197-windows-portable-exe) | 已接受(修订 ADR 0022 / D126) |
+| 0197 | [发布 Windows 免安装便携包](/adr/0197-windows-portable-exe) | 已接受(修订 ADR 0022 / D126 / D603) |
| 0198 | [为每个安静间隔命名活动行](/adr/0198-quiet-interval-activity-phases) | 已接受(修订 ADR 0175 / ADR 0186) |
| 0200 | [宿主拥有的插件会话导入与归属 API](/adr/0200-plugin-owned-session-api) | 已接受 |
| 0201 | [显式插件项目 id 与宿主拥有的会话刷新](/adr/0201-plugin-project-ids-and-session-refresh) | 已接受 |
diff --git a/docs/zh-CN/spec/01-product/01-product-scope.md b/docs/zh-CN/spec/01-product/01-product-scope.md
index 377f1b154..f1138ce99 100644
--- a/docs/zh-CN/spec/01-product/01-product-scope.md
+++ b/docs/zh-CN/spec/01-product/01-product-scope.md
@@ -135,5 +135,5 @@ Plan 和 Goal 是合约模式,而不是严格的只读安全配置文件:Bas
|---|---|---|
| macOS 苹果芯片 | 已发表 | 初级开发及验收平台; signing/notarization 仍受凭证控制 |
| macOS 英特尔 | 已发表 | 本机 x64 DMG/ZIP 发布通道;signing/notarization 仍受凭证控制 |
-| Windows x64 | 已发表 | NSIS 安装程序、免安装便携版 exe,以及仅适用于 NSIS 的应用内更新通道;本土资格继续 |
+| Windows x64 | 已发表 | NSIS 安装程序、免安装便携版 ZIP,以及仅适用于 NSIS 的应用内更新通道;本土资格继续 |
| Linux x64 | 已发表 | AppImage、deb 和 rpm 包;AppImage 更新通道;glibc 2.35+(Ubuntu 22.04、Debian 12、Fedora 36+);本土资格继续 |
diff --git a/docs/zh-CN/spec/03-runtime/07-process-model.md b/docs/zh-CN/spec/03-runtime/07-process-model.md
index 839ac68f2..aaeed5435 100644
--- a/docs/zh-CN/spec/03-runtime/07-process-model.md
+++ b/docs/zh-CN/spec/03-runtime/07-process-model.md
@@ -216,9 +216,10 @@ sidecar/host 关闭序列在更新程序替换应用程序之前运行。
它调用的纯 JS 助手无需更改进程或协议所有权
- 渲染器依赖项通过 Vite 输出传送,而不是重复原始数据
包树;桌面包不再携带交互式 PTY 原生模块
-- 打包版本使用 Main 拥有的更新控制器。 macOS、非 AppImage
- Linux 和 Windows 便携版运行为手动交付模式; Windows NSIS 和
- Linux AppImage 使用 D126 标签发布的应用内提要
+- 打包版本使用 Main 拥有的更新控制器。macOS、非 AppImage Linux 和
+ Windows ZIP 运行为手动交付模式;旧 Windows 便携版 exe 在设置了
+ `PORTABLE_EXECUTABLE_FILE` 时仍保持手动交付。Windows NSIS 和 Linux
+ AppImage 使用 D126 标签发布的应用内提要
## 7. 远程目标拓扑(MVP 后)
diff --git a/docs/zh-CN/spec/04-ux/09-interaction-patterns.md b/docs/zh-CN/spec/04-ux/09-interaction-patterns.md
index 0b3eca442..4d4c92d22 100644
--- a/docs/zh-CN/spec/04-ux/09-interaction-patterns.md
+++ b/docs/zh-CN/spec/04-ux/09-interaction-patterns.md
@@ -459,7 +459,7 @@
- 设置 → 信息和应用程序菜单检查共享一种类型的更新状态。
手动检查公开最新或错误反馈;自动故障不会
打开 Toast 或环境横幅。
-- 手动交付(非 AppImage Linux,以及带有 `PORTABLE_EXECUTABLE_FILE` 的 Windows 便携版运行)在 `available` 停止,并提供固定的 GitHub 发布页面。应用内交付(打包的 macOS、Windows NSIS 和 Linux AppImage)自动推进 `downloading` 到稳定的 `downloaded` 状态。
+- 手动交付(非 AppImage Linux、Windows ZIP,以及带有 `PORTABLE_EXECUTABLE_FILE` 的旧 Windows 便携版运行)在 `available` 停止,并提供固定的 GitHub 发布页面。应用内交付(打包的 macOS、Windows NSIS 和 Linux AppImage)自动推进 `downloading` 到稳定的 `downloaded` 状态。
- `downloaded` 保持可操作状态,直至重新启动更新或正常应用退出;
稍后的 scheduled/manual 检查不会将其替换为 `checking`。
- 紧凑的更新通知仅出现在主窗格的右上角安全区域中
@@ -481,7 +481,7 @@
当前版本和发现的可用版本标识为
紧凑的徽章。列表独立滚动,通过其关闭控制关闭,
转义或背景,并将焦点恢复到调用控件。
-- D126 标签版本发布所有平台清单和安装程序。打包的 macOS、Windows NSIS 和 Linux AppImage 使用应用内通道;Linux deb/rpm 和 Windows 便携版保持通知和链接传递模式。
+- D126 标签版本发布所有平台清单和安装程序。打包的 macOS、Windows NSIS 和 Linux AppImage 使用应用内通道;Linux deb/rpm 和 Windows ZIP 保持通知和链接传递模式。
## 2. 流消息行为
diff --git a/docs/zh-CN/spec/05-security/01-security.md b/docs/zh-CN/spec/05-security/01-security.md
index 514ef8c11..a0302c408 100644
--- a/docs/zh-CN/spec/05-security/01-security.md
+++ b/docs/zh-CN/spec/05-security/01-security.md
@@ -147,8 +147,8 @@ MCP 市场只接受无凭据的公网 HTTPS 源和目录端点。Main 在每一
GitHub 的最新稳定版本而不是同通道预发布 pin。
- Feed 清单将工件与电子构建器哈希绑定。一个错误,
无法安装提要、哈希不匹配或无效的更新程序状态。
-- 打包的 macOS、Windows NSIS 和 Linux AppImage 从 GitHub Releases 源应用内下载并安装。Linux deb/rpm 和 Windows 便携版只检测新版本并打开固定发布页。
-- D126 标签版本发布 Windows NSIS 和 Linux AppImage 安装程序及其更新清单,以及 Linux deb/rpm 包和 Windows 便携版 exe。NSIS、AppImage 与打包的 macOS 走应用内通道。便携版 exe 使用通知加链接交付,并且不写入 `latest.yml`。macOS 标签工件在上传前完成 Developer ID 签名、公证和装订;回滚和分阶段推出仍是发布后续工作。
+- 打包的 macOS、Windows NSIS 和 Linux AppImage 从 GitHub Releases 源应用内下载并安装。Linux deb/rpm 和 Windows ZIP 只检测新版本并打开固定发布页;旧 Windows 便携版 exe 在存在 `PORTABLE_EXECUTABLE_FILE` 时仍保持手动更新。
+- D126 标签版本发布 Windows NSIS 和 Linux AppImage 安装程序及其更新清单,以及 Linux deb/rpm 包和 Windows 便携版 ZIP。NSIS、AppImage 与打包的 macOS 走应用内通道。便携版 ZIP 使用通知加链接交付,并且不写入 `latest.yml`。macOS 标签工件在上传前完成 Developer ID 签名、公证和装订;回滚和分阶段推出仍是发布后续工作。
- 客户端不携带 GitHub 令牌。私人或其他无法访问的提要
关闭失败;自动故障保持在环境状态,显式检查会暴露
错误。
diff --git a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
index aa612a8be..11380db7d 100644
--- a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
@@ -2727,9 +2727,9 @@ PI-Desktop 图标;两个表面都不会暴露库存 Electron 名称或图标
设置 → 信息。
- **预期**:更新状态报告 `available`(手动平台)或
通过应用内下载 Windows NSIS / Linux AppImage 取得进展
- `availableVersion` 等于较新的稳定标签。Windows 便携版运行
- (`PORTABLE_EXECUTABLE_FILE`)保持手动通知加链接路径,不得下载或运行
- NSIS 安装程序。客户不得举报
+ `availableVersion` 等于较新的稳定标签。Windows 便携版 ZIP 运行保持手动通知加链接路径,
+ 不得下载或运行 NSIS 安装程序;旧便携版 exe 在存在 `PORTABLE_EXECUTABLE_FILE` 时同样
+ 保持手动更新。客户不得举报
最新只是因为没有较新的版本共享相同的 `rc` 预发行版
频道。
- **链接规格**:`04-ux/09-interaction-patterns.md`,
@@ -7090,21 +7090,22 @@ eleven-tool-round desktop paths are verified by
- **验收**:A(应用启动)、质量(全新安装打包)
- **里程碑**:M6+
- **状态**:源码契约已覆盖;全新 Windows x64 与 ARM64 资格验证仍需运行器验证(适用变更合入前需在具备条件的环境中运行 E2E)
-#### E2E-211:Windows 便携版 exe 无需安装即可启动(D364)
+#### E2E-211:Windows 便携版 ZIP 解压后即可启动(D603)
- **前提条件**:Windows x64 标签或 `dist:win` 包已从共享 electron-builder 配置
- 产出 `PI-Desktop-Setup-<version>.exe` 和 `PI-Desktop-Portable-<version>.exe`;
+ 产出 `PI-Desktop-Setup-<version>.exe` 和 `PI-Desktop-Portable-<version>.zip`;
有干净用户配置;账户是无需管理员提升的标准用户。
-- **步骤**:1) 检查发布目录和 `latest.yml`。2) 不运行 NSIS 安装程序,直接启动
- 便携版 exe。3) 确认进程环境包含 `PORTABLE_EXECUTABLE_FILE`。4) 调用检查更新。
- 5) 确认设置 → 信息提供发布页而不是“重启以更新”。6) 退出并再次启动同一便携文件。
+- **步骤**:1) 检查发布目录和 `latest.yml`。2) 将便携版 ZIP 解压到用户可写目录,
+ 不运行 NSIS 安装程序。3) 启动解压后的 `PI-Desktop.exe`。4) 确认没有管理员提示,
+ 且运行中的应用显示 PI-Desktop 图标和任务栏入口。5) 调用检查更新。6) 确认设置 → 信息
+ 提供发布页而不是“重启以更新”。7) 退出并再次启动解压后的可执行文件。
- **预期**:两个 Windows 工件都无空格并已上传。`latest.yml` 只指向 NSIS 安装程序。
- 便携版 exe 无需安装向导或管理员提示即可启动,使用现有应用数据目录,
- 并报告更新模式 `manual`。可用更新不会下载或运行
+ ZIP 解压后的应用无需安装向导或管理员提示即可启动,保持正常的 PI-Desktop 任务栏
+ 标识和图标,使用现有应用数据目录,并报告更新模式 `manual`。可用更新不会下载或运行
`PI-Desktop-Setup-<version>.exe`。再次启动从同一配置恢复会话。
- **链接规格**:`01-product/01-product-scope.md`、
`06-delivery/06-release-runbook.md`、`03-runtime/07-process-model.md`、
- ADR 0197 / D364
+ ADR 0197 / D603
- **验收**:质量(发布打包)
- **里程碑**:M6+
- **状态**:单元/源合同已覆盖(`auto-update.test.mjs`);本机 Windows 启动仍为
diff --git a/docs/zh-CN/spec/06-delivery/06-release-runbook.md b/docs/zh-CN/spec/06-delivery/06-release-runbook.md
index 6a81eab7d..b0865822e 100644
--- a/docs/zh-CN/spec/06-delivery/06-release-runbook.md
+++ b/docs/zh-CN/spec/06-delivery/06-release-runbook.md
@@ -3,7 +3,7 @@
> **翻译说明:** 本页是与 [英文源规格](/spec/06-delivery/06-release-runbook) 一一对应的机器辅助翻译。代码、协议字段和标识符保持原文;如翻译与英文源事实有歧义,以英文版本为准。
-> 范围:macOS arm64、Intel x64、Windows x64 和 Linux x64 的 D126/D285 标记工件;
+> 范围:macOS arm64、Intel x64、Windows x64 和 Linux x64 的 D126/D285/D603 标记工件;
> macOS signing/notarization 保留下面的详细资格通道。
> 交叉引用:[里程碑](/zh-CN/spec/06-delivery/01-mvp-milestones) · [进程模型](/zh-CN/spec/03-runtime/07-process-model) · [安全性](/zh-CN/spec/05-security/01-security)
@@ -479,7 +479,7 @@ project/Temporary 使用消息加会话图标创建控件。
该存储库为每个发布目标公开本机运行器构建命令。
每个打包命令首先运行 `build:host-release`,然后捆绑代理
-运行时和 Electron 应用程序。D126/D285 标签工作流程发布这些输出及其
+运行时和 Electron 应用程序。D126/D285/D603 标签工作流程发布这些输出及其
电子更新程序清单。在该目标操作系统上运行目标命令:
```text
@@ -489,10 +489,13 @@ Windows: pnpm --filter @pi-desktop/desktop dist:win
Linux: pnpm --filter @pi-desktop/desktop dist:linux
```
+Windows 的 `dist:win` 命令会运行 `scripts/build-desktop-release.mjs`,分别调用
+一次 electron-builder 构建 NSIS 和 ZIP,确保每个包写入正确的更新器发行类型标记。
+
macOS 软件包包括按本机架构构建的 `bin/pi-desktop-host-core`;Windows
软件包包括 `bin/pi-desktop-host-core.exe`;Linux 包括
`bin/pi-desktop-host-core`。签名、回滚和安装程序升级资质仍保持发布
-硬化工作;发布本身已在 D126/D285 下启用。
+硬化工作;发布本身已在 D126/D285/D603 下启用。
Native-runner 输出矩阵:
@@ -501,13 +504,15 @@ Native-runner 输出矩阵:
- macOS Intel x64:`PI-Desktop-<version>-x64.dmg` 和
`PI-Desktop-<version>-x64-mac.zip`
- Windows x64:NSIS 安装程序 `PI-Desktop-Setup-<version>.exe` 和便携版
- exe `PI-Desktop-Portable-<version>.exe`
+ ZIP `PI-Desktop-Portable-<version>.zip`
- Linux x64:AppImage、deb 和 rpm
- Linux x64 系统 Electron 产物:`PI-Desktop-<version>-linux-x64.asar`
-便携版 Windows 目标不会写入 `latest.yml`。已打包的便携版运行使用通知加链接
-交付(`PORTABLE_EXECUTABLE_FILE`);NSIS 仍走应用内下载并在退出时安装。
-数据仍在现有应用数据目录。便携版请求 user 执行级别,因此启动不需要管理员权限。
+便携版 Windows ZIP 目标不会写入 `latest.yml`。Windows 发布脚本会分别构建 NSIS
+和 ZIP,并给 ZIP 的应用元数据写入 `piDistribution = "zip"`;已打包的 ZIP 运行使用
+通知加链接交付。旧便携版 exe 仍在存在 `PORTABLE_EXECUTABLE_FILE` 时保持手动更新。
+NSIS 仍走应用内下载并在退出时安装。数据仍在现有应用数据目录。用户解压 ZIP 后
+直接运行 `PI-Desktop.exe`,不会启动自解压包装器,也不会请求管理员权限。
RPM 目标会向 FPM 传入 `_build_id_links none`。捆绑的 Electron 二进制文件位于
`/opt/PI-Desktop` 下;省略全局 `/usr/lib/.build-id` 链接,可以避免与其他捆绑相同
@@ -533,6 +538,6 @@ electron PI-Desktop-<version>-linux-x64.asar
## 7. 已知限制
-- Linux deb/rpm 和 Windows 便携版 exe 仍保持通知和链接更新模式。打包的 macOS、Windows NSIS 和 Linux AppImage 使用应用内 `electron-updater`。
+- Linux deb/rpm 和 Windows 便携版 ZIP 仍保持通知和链接更新模式。打包的 macOS、Windows NSIS 和 Linux AppImage 使用应用内 `electron-updater`。
- Linux x64 包在 Ubuntu 22.04 上构建,因此 host-core 需要 glibc 2.35 或更高版本(Ubuntu 22.04、Debian 12、Fedora 36+)。标签作业运行 `scripts/check-linux-host-glibc.mjs`,拒绝需要更新 glibc 的二进制文件。
- 回滚、分阶段部署和预发布渠道政策仍是开放的发布工作。现有未签名 macOS 安装可能需要先手动安装一次已签名 DMG,之后应用内更新才能成功。
diff --git a/docs/zh-CN/spec/08-meta/decisions-log.md b/docs/zh-CN/spec/08-meta/decisions-log.md
index 2b3cd5c68..ae5077a49 100644
--- a/docs/zh-CN/spec/08-meta/decisions-log.md
+++ b/docs/zh-CN/spec/08-meta/decisions-log.md
@@ -31,7 +31,7 @@
| D452 | 计划与目标工件在内置文件视图中打开 | **审批卡的工件打开器把不可变的 `.pi/plan/*.md` 或 `.pi/goal/*.md` 路径交给内置 `pi.file-manager` 视图(该视图可启动时),否则交给宿主机文件标签——与对话文件引用已有的偏好与回退一致(ADR 0241)。工件仍会在其来源会话中创建或激活标签,因此审批揭示本身不变,只有承载界面改变。仅渲染进程;不改协议、宿主、存储、工件内容或权限。见 D189、ADR 0043、`04-ux/08-component-spec.md` §5.4 与 §10A.2、`04-ux/09-interaction-patterns.md` §5A、E2E-106。** | 审批打开器原先使用宿主机文件标签,而对话提到的其它项目文件都已进入用户自己的文件视图,于是计划或目标落在了用户唯一不浏览项目文件的界面上。 |
| D459 | 恢复可拖拽侧边栏宽度,过窄时收起 | **修订 D408 / ADR 0238 并恢复 ADR 0141(ADR 0290):展开侧边栏重新成为渲染层拥有的 `240px..520px` 列(默认 `275px`),右缘手柄在指针按下时预览、释放时持久,并支持左右方向键(16px)、Home 与 End。指针宽度低于 `160px` 时以用户操作收起,不覆盖首选展开宽度;键盘调整永不收起。实时上限为扣除 MainChat 450px 下限后的三栏余量。仅渲染进程;沿用 `pi.desktop.sidebarWidth` 偏好。见 E2E-168。** | 长标签需要可回收宽度;ADR 0238 固定 275px 会挡住这一点,而三栏实时预算本就可以限制用户选定的宽度。该决策曾被误记为 D451(已由「审阅面板只在用户主动操作时打开」占用);按 issue #620 改号。 |
| D457 | 已签名 macOS DMG 改为双图标安装 | **修订 D406 / ADR 0232 / ADR 0204:正式与本地 DMG 只包含 PI-Desktop.app 和 Applications 链接,使用 720×440 品牌背景。不再放入 `If app won't open, read this.txt` 或 command 助手。macOS ZIP 仍附带打开说明和 `PI-Desktop-macOS-open.command`,供可信未签名工件使用。见 ADR 0296 与 E2E-196b。** | 标签 DMG 已签名公证(D450);安装盘上的未签名打开说明读起来像报错。 |
-| D450 | 签名的 macOS GitHub Release | **修订 D078 / ADR 0022:GitHub tag 发布使用身份 `Developer ID Application: XingYu Liu (DUV63RKYTW)` / 团队 `DUV63RKYTW`,通过 Actions 密钥(`CSC_LINK`、`CSC_KEY_PASSWORD`、`APPLE_ID`、`APPLE_APP_SPECIFIC_PASSWORD`、`APPLE_TEAM_ID`)对 macOS DMG/ZIP 做 Developer ID 签名、`notarytool` 公证、装订和 Gatekeeper 校验;缺少密钥则失败。无证书的本地未签名打包仍可用。`workflow_dispatch` 仅可把 `sign_macos: false` 用于未签名调试产物。打包的 macOS 走应用内 `electron-updater`(ZIP + 合并后的 `latest-mac.yml`);Linux deb/rpm 与 Windows portable 仍为通知并打开发布页。禁止 afterPack/afterSign adhoc 签名(ADR 0278)。** | 正式 DMG 应无需 Gatekeeper 警告即可打开,已签名 macOS 安装可下载并重启到新 tag。见 ADR 0289、E2E-196c、E2E-067A。 |
+| D450 | 签名的 macOS GitHub Release | **修订 D078 / ADR 0022:GitHub tag 发布使用身份 `Developer ID Application: XingYu Liu (DUV63RKYTW)` / 团队 `DUV63RKYTW`,通过 Actions 密钥(`CSC_LINK`、`CSC_KEY_PASSWORD`、`APPLE_ID`、`APPLE_APP_SPECIFIC_PASSWORD`、`APPLE_TEAM_ID`)对 macOS DMG/ZIP 做 Developer ID 签名、`notarytool` 公证、装订和 Gatekeeper 校验;缺少密钥则失败。无证书的本地未签名打包仍可用。`workflow_dispatch` 仅可把 `sign_macos: false` 用于未签名调试产物。打包的 macOS 走应用内 `electron-updater`(ZIP + 合并后的 `latest-mac.yml`);Linux deb/rpm 与 Windows 便携版 ZIP 仍为通知并打开发布页。禁止 afterPack/afterSign adhoc 签名(ADR 0278)。** | 正式 DMG 应无需 Gatekeeper 警告即可打开,已签名 macOS 安装可下载并重启到新 tag。见 ADR 0289、E2E-196c、E2E-067A。 |
## B. 辅助实现默认值
@@ -352,7 +352,7 @@
| 身份证号 | 主题 | 决定 | 基本原理 |
|---|---|---|---|
| D118 | 平台应用程序菜单和窗口镶边 | **macOS 安装传统的系统应用程序菜单并保留隐藏式交通信号灯。 Windows/Linux 使用共享的 46px 无框架外壳以及本地化的 File/Edit/View/Window/Help 菜单和渲染器绘制的 minimize/maximize-or-restore/close 控件。两个菜单表面都通过固定的 `AppMenuCommand` 允许列表路由渲染器拥有的操作;渲染器菜单通过单独的固定允许列表路由本机 editing/window 操作。目标打包在 Electron 打包之前构建本地发布主机。这增加了平台就绪的 shell 行为,但不会逆转 D010:Windows/Linux 发布资格在 MVP 后仍然有效。** | 默认的 Electron 菜单会使 macOS shell 命令不完整,而无框 Windows/Linux 窗口会丢失应用程序菜单和窗口控件。共享允许列表可以保持行为一致,而不会暴露任意特权命令桥。 |
-| D120 | 应用程序更新交付 | *(amended by D364)* **Electron Main 独家拥有固定的 GitHub 发布源、更新轮询、类型化状态和安装生命周期。开发被禁用;打包的 macOS 和非 AppImage Linux 使用通知和链接传递,而 Windows NSIS 和 Linux AppImage 在应用程序内下载并在退出时安装。 Renderer IPC 无法提供 Feed URL。自动故障保持环境状态,显式检查表面状态,下载状态保持可操作。更新程序始终强制使用 `allowPrerelease = false`,因此预发布安装(例如 `0.2.0-rc.6`)会跟踪 GitHub 的最新稳定版本,而不是 electro-updater 的默认同通道引脚。 D126 随后发布由标签矩阵生成的每个平台提要,而 macOS 仍保持手动状态,直到签名通道合格为止。** | 将软件包安装保持在沙盒渲染器之外,匹配每种安装程序格式的交付,并在菜单、设置和更新横幅之间提供一种一致的状态 (ADR 0022)。如果没有稳定通道引脚,RC 不会构建更新的稳定通道,因为电子更新程序将 `rc` 视为自定义通道。 |
+| D120 | 应用程序更新交付 | *(amended by D364 / D603)* **Electron Main 独家拥有固定的 GitHub 发布源、更新轮询、类型化状态和安装生命周期。开发被禁用;打包的 macOS 和非 AppImage Linux 使用通知和链接传递,而 Windows NSIS 和 Linux AppImage 在应用程序内下载并在退出时安装。 Renderer IPC 无法提供 Feed URL。自动故障保持环境状态,显式检查表面状态,下载状态保持可操作。更新程序始终强制使用 `allowPrerelease = false`,因此预发布安装(例如 `0.2.0-rc.6`)会跟踪 GitHub 的最新稳定版本,而不是 electro-updater 的默认同通道引脚。 D126 随后发布由标签矩阵生成的每个平台提要,而 macOS 仍保持手动状态,直到签名通道合格为止。** | 将软件包安装保持在沙盒渲染器之外,匹配每种安装程序格式的交付,并在菜单、设置和更新横幅之间提供一种一致的状态 (ADR 0022)。如果没有稳定通道引脚,RC 不会构建更新的稳定通道,因为电子更新程序将 `rc` 视为自定义通道。 |
| D313 | 主进程拥有的 GitHub 问题反馈 | **GitHub issue 表单是唯一入口。Bug 表单必填描述、复现步骤、预期/实际行为、应用版本和操作系统;功能表单必填问题和期望改动。设置 → 信息提供一条「问题反馈」,走 `pi-desktop/app/openFeedback`。Electron Main 构造固定的 `bug_report.yml` URL,用主进程版本信息预填 `app-version` / `os` / `environment`,再以 `shell.openExternal` 打开。渲染器不能提供 URL。功能请求仍从 GitHub 模板选择器进入。不改 host 协议、存储或更新源(ADR 0157)。** | 缺少版本或复现步骤的报告无法排查;由渲染器选择目标会削弱 D120 同样的「GitHub URL 归主进程」规则。 |
| D330 | 由主进程拥有的 openExternal 协议白名单 | **每次 `shell.openExternal` 先解析 URL。只有 `http:`、`https:`(含主机名和写出的 `//`)以及 `mailto:`(非空地址)会以规范化 href 到达操作系统。`file:`、`javascript:`、`data:` 和自定义方案被拒绝。见 ADR 0168。** | 任意协议的 openExternal 会把沙箱渲染器变成打开本地文件或执行脚本的入口。 |
| D332 | 分类的插件文件预览与实时工作区事件 | **修订 ADR 0104 / 0105 / 0109 / 0111:在 `fs.read` 下增加 `fs.readPreview`(文本 / 图片 data URL / 二进制 / tooLarge,上限与宿主 Files 页相同)。工作区事件同时广播给停靠视图和独立面板。** | 插件需要与 Files 页同类的预览,以及工作区变更的实时信号。 |
@@ -464,8 +464,9 @@
| 身份证号 | 主题 | 决定 | 基本原理 |
|---|---|---|---|
-| D126 | 三平台发布交付(电梯D010) | *(amended by D364)* **标签构建将矩阵生成的每个工件发布到 GitHub 版本:macOS dmg/zip (arm64)、Windows NSIS x64、Linux AppImage + deb (x64),每个都有块图和平台的 `latest*.yml` 电子更新器提要。发布提要会激活 D120 的 Windows NSIS 和 Linux AppImage 的应用内更新通道; macOS 保持通知和链接模式,直到签名通道合格为止。 NSIS 工件名称固定为无空格 (`PI-Desktop-Setup-${version}.${ext}`),因为 GitHub 资产 URL 会损坏空格。根据基线凹凸规则(基线 `0.4.7`),D010 的仅限 macOS 范围被提升;发布管道本身在 v0.1.1-rc.1/v0.1.1 上通过了端到端合格。** | 无论如何,管道都会在每个标签上构建并验证所有三个平台;将安装程序保留为过期的 Actions 工件(保留 90 天)会阻止用户安装它们,而不会增加安全性。发布更新源是交付的重点:具有应用程序内通道的平台会静默更新,并且未来的平台回归会通过实际安装而不是未使用的工件来呈现。 |
-| D364 | Windows portable exe without installer | **Amend D120 / D126 / ADR 0022: tag builds publish a Windows x64 portable exe `PI-Desktop-Portable-${version}.exe` alongside the NSIS installer `PI-Desktop-Setup-${version}.exe`. The portable target does not write `latest.yml`. Packaged portable runs (`PORTABLE_EXECUTABLE_FILE`) use notify-and-link delivery. NSIS installs keep in-app download and quit-and-install. Data stays in the existing application data directory. Portable requests user execution level.** | Company environments that whitelist a single executable cannot run the NSIS installer. Applying the NSIS updater to a portable run would install the app, so portable stays manual (ADR 0197, E2E-211). |
+| D126 | 三平台发布交付(电梯D010) | *(amended by D364 / D603)* **标签构建将矩阵生成的每个工件发布到 GitHub 版本:macOS dmg/zip (arm64)、Windows NSIS x64、Linux AppImage + deb (x64),每个都有块图和平台的 `latest*.yml` 电子更新器提要。发布提要会激活 D120 的 Windows NSIS 和 Linux AppImage 的应用内更新通道; macOS 保持通知和链接模式,直到签名通道合格为止。 NSIS 工件名称固定为无空格 (`PI-Desktop-Setup-${version}.${ext}`),因为 GitHub 资产 URL 会损坏空格。根据基线凹凸规则(基线 `0.4.7`),D010 的仅限 macOS 范围被提升;发布管道本身在 v0.1.1-rc.1/v0.1.1 上通过了端到端合格。** | 无论如何,管道都会在每个标签上构建并验证所有三个平台;将安装程序保留为过期的 Actions 工件(保留 90 天)会阻止用户安装它们,而不会增加安全性。发布更新源是交付的重点:具有应用程序内通道的平台会静默更新,并且未来的平台回归会通过实际安装而不是未使用的工件来呈现。 |
+| D364 | Windows portable exe without installer | *(superseded by D603)* **Amend D120 / D126 / ADR 0022: tag builds publish a Windows x64 portable exe `PI-Desktop-Portable-${version}.exe` alongside the NSIS installer `PI-Desktop-Setup-${version}.exe`. The portable target does not write `latest.yml`. Packaged portable runs (`PORTABLE_EXECUTABLE_FILE`) use notify-and-link delivery. NSIS installs keep in-app download and quit-and-install. Data stays in the existing application data directory. Portable requests user execution level.** | Company environments that whitelist a single executable cannot run the NSIS installer. Applying the NSIS updater to a portable run would install the app, so portable stays manual (ADR 0197, E2E-211). |
+| D603 | Windows portable delivery uses a normal ZIP | **Amend D364 / ADR 0022 / ADR 0197: tag builds publish a Windows x64 portable ZIP `PI-Desktop-Portable-${version}.zip` alongside the NSIS installer `PI-Desktop-Setup-${version}.exe`. The Windows release helper builds NSIS and ZIP separately, stamps ZIP app metadata with `piDistribution = "zip"`, and keeps the ZIP target out of `latest.yml`. Extracted ZIP runs use notify-and-link delivery; the updater still recognizes `PORTABLE_EXECUTABLE_FILE` for older portable executables. Data stays in the existing application data directory.** | The self-extracting portable wrapper could trigger administrator prompts and did not provide a reliable normal executable identity for the taskbar. A user-extracted ZIP launches `PI-Desktop.exe` directly and preserves the manual-update boundary. |
| D260 | 发布文档是一个版本载体 | **稳定版本号提升必须在打标签之前更新每一处带版本号的载体:双语言的应用内变更日志及其测试清单、每个工作区的 `package.json`(包括之前被第三个工作区根 `scripts/release.mjs` 跳过的 `docs/package.json`)、Cargo 工作区版本与 `host-core` 的锁文件条目、`APP_VERSION`,以及 `README.md` 和 `README.zh-CN.md` 中声明的 `<major>.<minor>.x` 发布线。`scripts/check-release-docs.mjs` 校验全部这些;`scripts/release.mjs` 在提升版本号之后运行它,只要任一载体不一致就拒绝提交或打标签,`--skip-docs-check` 仅保留给刻意的非发布性版本提升。扩展 D164。** | 仅有应用内变更日志这道闸门,导致已发布的文档落后:版本已到 `0.10.8`,两个 README 仍在宣传 `0.5.x` 线,而 `docs/package.json` 停在 `0.5.8`。标签是不可逆的,所以这项检查在标签存在之前运行,而不是作为评审礼节。 |
| D371 | 显式的未签名 macOS 首次启动助手 | *(由 D406 和 D443 修订)* **每个 macOS 分发都附带可执行的 `PI-Desktop-macOS-open.command`,放在 DMG 上拖入 Applications 手势下方的可见首启行。它只查找 `/Applications/PI-Desktop.app` 与 `~/Applications/PI-Desktop.app`,校验 `CFBundleIdentifier` 为 `net.aiuo.pi-desktop`,仅在存在时移除 `com.apple.quarantine`,然后打开应用。永不使用 `sudo`,不接受任意路径,也不替代 Developer ID 签名或公证。** | 未签名的 macOS 通道可能被 quarantine 拦截并显示误导性的\"已损坏\"提示,而仅限终端的 `xattr -cr` 说明比启动失败所需的范围更宽(ADR 0204,E2E-196b) |
| D443 | 规范应用 ID 与 macOS 代码签名标识 | **修订 D141 / D371 / ADR 0204:应用 ID 为 `net.aiuo.pi-desktop`(`APP_ID`、electron-builder `appId`、macOS `CFBundleIdentifier`、Windows AppUserModelID)。开发用 macOS 宿主为 `net.aiuo.pi-desktop.dev`。不要在 `afterPack`/`afterSign` 对未签名包做 adhoc 签名:嵌套 Electron helper 此时尚未签名,`codesign` 会报 `code object is not signed at all`。见 ADR 0278、issue #524。** | 所有者域名为 `net.aiuo.pi-desktop`。未签名包的 Identifier 绑定推迟到有安全的 helper 签名路径之后。 |
@@ -3546,6 +3547,16 @@ D193 和 D194。
user 执行级别。
- 参见 ADR 0197 与 E2E-211。
+## 2026-09-22 —— Windows 便携交付改为普通 ZIP(D603)
+
+- 决策 D603 修订 D364 / ADR 0022 / ADR 0197。Windows x64 通道现在在 NSIS 安装程序
+ 旁发布 `PI-Desktop-Portable-<version>.zip`。发布脚本分别构建两个目标,并给 ZIP
+ 应用元数据写入 `piDistribution = "zip"`;ZIP 目标不写入 `latest.yml`。
+- 用户解压 ZIP 后直接启动 `PI-Desktop.exe`。ZIP 运行使用通知加链接更新交付,更新器
+ 仍识别旧便携版 exe 的 `PORTABLE_EXECUTABLE_FILE`。现有数据目录和 NSIS 应用内更新
+ 通道保持不变。
+- 参见 ADR 0197 与 E2E-211。
+
## 2026-09-09 —— 为每个安静间隔命名活动行(D365)
- ADR 0175 只命名了 `waiting-model`、`retrying` 和 `waiting-subagents`。
diff --git a/packages/shared/src/types/platform.ts b/packages/shared/src/types/platform.ts
index 2a757438a..ea274969d 100644
--- a/packages/shared/src/types/platform.ts
+++ b/packages/shared/src/types/platform.ts
@@ -38,7 +38,7 @@ export type HostStatusEvent = {
* - in-app: electron-updater downloads and installs (Windows NSIS, Linux
* AppImage, packaged macOS)
* - manual: we only detect new versions and link to the releases page
- * (Linux deb/rpm, Windows portable)
+ * (Linux deb/rpm, Windows ZIP)
* - disabled: development / unpackaged build
*/
export type UpdateMode = "in-app" | "manual" | "disabled";
diff --git a/scripts/README.md b/scripts/README.md
index f0853564f..d7c6d8472 100644
--- a/scripts/README.md
+++ b/scripts/README.md
@@ -29,6 +29,7 @@ disagrees, so a green `check:release-docs` is a precondition, not a substitute.
| `macos-signing-watchdog.mjs` | `node scripts/macos-signing-watchdog.mjs [options] -- <command>` | Run a long silent phase (`electron-builder` signing, `notarytool submit --wait`) with a heartbeat, phase tracking, stall diagnostics (last file, `ps` state, codesign log tail), per-file codesign timings, and a hard timeout that fails instead of hanging; it forwards the child output and exit code unchanged and redacts `CSC_KEY_PASSWORD`/`APPLE_APP_SPECIFIC_PASSWORD`/`CSC_LINK` values plus `--password` arguments |
| `macos-codesign-shim.sh` | used by `macos-signing-watchdog.mjs` | PATH shim that timestamps every `codesign` invocation and then executes the real `codesign`; inert unless `PI_CODESIGN_LOG` is set |
| `export-linux-asar.mjs` | `node scripts/export-linux-asar.mjs` | Copy the Linux `linux-unpacked/resources/app.asar` into the versioned release asset used for system-Electron repackaging |
+| `build-desktop-release.mjs` | called by the desktop `dist` / `dist:win` scripts | Build the native runner target without publishing; Windows runs separate NSIS and ZIP passes and stamps their updater distribution metadata |
| `check-linux-host-glibc.mjs` | `node scripts/check-linux-host-glibc.mjs [bin]` | Fail a Linux host-core binary whose needed glibc is above 2.35 |
| `make-icon.py` | `python3 scripts/make-icon.py` | Derive the package PNG, the macOS tray template, and the iconset/ICNS from the canonical PNG |
| `publish-screenshots.py` | `python3 scripts/publish-screenshots.py` | Publish documentation screenshots |
diff --git a/scripts/build-desktop-release.mjs b/scripts/build-desktop-release.mjs
new file mode 100644
index 000000000..7203cf1f6
--- /dev/null
+++ b/scripts/build-desktop-release.mjs
@@ -0,0 +1,70 @@
+import { spawn } from "node:child_process";
+import process from "node:process";
+
+const forwardedArgs = process.argv.slice(2);
+
+const hostTarget =
+ process.platform === "win32"
+ ? "win"
+ : process.platform === "darwin"
+ ? "mac"
+ : "linux";
+const requestedTarget = ["linux", "mac", "win"].includes(forwardedArgs[0])
+ ? forwardedArgs.shift()
+ : undefined;
+const target = requestedTarget ?? hostTarget;
+
+if (!["linux", "mac", "win"].includes(target)) {
+ throw new Error(`Unsupported desktop release target: ${target}`);
+}
+
+const pnpmCommand = process.platform === "win32" ? "pnpm.cmd" : "pnpm";
+
+function runBuilder(args) {
+ return new Promise((resolve, reject) => {
+ const child = spawn(pnpmCommand, ["exec", "electron-builder", ...args], {
+ stdio: "inherit",
+ });
+
+ child.once("error", reject);
+ child.once("exit", (code, signal) => {
+ if (code === 0) {
+ resolve();
+ return;
+ }
+ reject(
+ new Error(
+ `electron-builder ${target} target failed with ${
+ code === null ? `signal ${signal ?? "unknown"}` : `exit code ${code}`
+ }`,
+ ),
+ );
+ });
+ });
+}
+
+if (target === "win") {
+ await runBuilder([
+ "--win",
+ "nsis",
+ "--publish",
+ "never",
+ ...forwardedArgs,
+ "-c.extraMetadata.piDistribution=installed",
+ ]);
+ await runBuilder([
+ "--win",
+ "zip",
+ "--publish",
+ "never",
+ ...forwardedArgs,
+ "-c.extraMetadata.piDistribution=zip",
+ ]);
+} else {
+ await runBuilder([
+ `--${target}`,
+ "--publish",
+ "never",
+ ...forwardedArgs,
+ ]);
+}