Skip to content

feat(portable): add portable data directory and Windows portable package - #90

Merged
qybaihe merged 2 commits into
mainfrom
feat/portable-package
Nov 30, 2026
Merged

qybaihe merged 2 commits into
mainfrom
feat/portable-package

Conversation

@qybaihe

@qybaihe qybaihe commented Nov 30, 2026

Copy link
Copy Markdown
Owner

Why

Goal: give BotArk users a no-install portable build that keeps accounts, sessions, and settings beside the executable (closes #87).

What changed

  • Added src/main/portableDataDir.ts to resolve userData once at startup, in order: --user-data-dir=<path>, PORTABLE_EXECUTABLE_DIR (set by the Windows portable launcher), a sibling BotArkData folder or .botark-portable marker (next to the executable, or next to BotArk.app on macOS), legacy bothub migration, then the default path.
  • Portable candidates are verified with a real file create/delete probe. If the location is read-only, startup logs a warning and falls back to the default userData instead of crashing.
  • Added the Windows portable target (BotArk-Portable-<version>-x64.exe) alongside NSIS.
  • Documented portable mode in README.md, docs/readme/README_zh.md, and CHANGELOG.md.

Scope

Startup path resolution, electron-builder Windows targets, and docs. Existing NSIS auto-update artifacts and default installs are unchanged.

Blast Radius

src/main/index.ts delegates its legacy bothub check to resolveUserDataDir. Without a CLI flag, PORTABLE_EXECUTABLE_DIR, BotArkData, or .botark-portable marker, resolution follows the exact previous logic.

Verification

  • npm run typecheck passed.
  • npx vitest run src/main/portableDataDir.test.ts: 19 tests passed (CLI flags, Windows env var, macOS .app sibling detection, marker file, read-only fallback, precedence over legacy bothub).
  • npx electron-vite build passed. Windows .exe packaging runs in this PR's windows-latest CI job.
  • Note: the local OAuth token lacks workflow scope, so a one-line release.yml asset-check addition ('Portable.*\.exe$') is kept as a local patch rather than in this branch. The existing '\.exe$' check already matches both Windows artifacts.

Closes #87

张少谦 added 2 commits November 30, 2026 19:52
Resolve userData at startup in order of --user-data-dir, PORTABLE_EXECUTABLE_DIR, a sibling BotArkData folder or .botark-portable marker, legacy bothub migration, then the default userData path. Verify portable writability with a probe file and fall back to the default userData with a warning when read-only.

Add the Windows portable target (BotArk-Portable-<version>-<arch>.exe) alongside NSIS, and document portable mode.

Closes #87
@qybaihe

qybaihe commented Nov 30, 2026

Copy link
Copy Markdown
Owner Author

Windows 与 macOS CI 打包均已通过,确认生成 BotArk-Portable-0.17.1-x64.exe 与 BotArk-Setup-0.17.1-x64.exe;20 个便携目录单测在 macOS 与 Windows 上全部通过。现合并到 main。

@qybaihe
qybaihe merged commit d6445c5 into main Nov 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

佬 搞个便携包用用

1 participant