Portable mode: a portable.txt beside the executable keeps the settings in VectorCraftData (#1366)

This commit is contained in:
Marco Arnulfo
2026-10-16 15:27:55 +07:00
committed by bflatastic
parent 6fc79c33b7
commit 314bfe802f
6 changed files with 163 additions and 13 deletions
+2
View File
@@ -11,6 +11,8 @@ Set `VECTORCRAFT_CONFIG_DIR` to a dedicated directory for an isolated native tes
logs, recovery and user libraries then use that root, without importing the legacy DrawCraft profile.
An unset override preserves the usual platform paths and legacy migration; an explicitly empty override
disables those paths. `VECTORCRAFT_NO_PREFS` continues to disable preference reads and writes.
Without the override, a `portable.txt` or `VectorCraft.portable` file beside the executable (as in the
Windows portable zip) puts that root in `VectorCraftData` next to the executable.
**Only requests are read.** Every line must be a JSON object with a string `method` (`id` and `params`
are optional; blank lines are skipped). Anything else gets one error reply
+7
View File
@@ -113,6 +113,13 @@ to the target triple, so host build scripts aren't affected.
- Before packaging, the script checks each binary's PE machine type against `-Arch` (an x64 build
can never ship labelled arm64), that `vectorcraft.exe` is a GUI program (no console window) and
that `vectorcraft-cli.exe` is a console program.
- **Portable zip:** it ships `packaging/windows/portable.txt` beside `vectorcraft.exe`. That
marker (or a `VectorCraft.portable` file) switches on portable mode, as in PhotoCraft: `ui.json`
and the folders next to it (Swatches, Graphic Styles, Fonts, Data Recovery, logs…) go to
`VectorCraftData\` next to the exe instead of `%APPDATA%\VectorCraft`. If that folder isn't
writable the app logs a warning and uses `%APPDATA%`. The MSI has no marker.
`VECTORCRAFT_CONFIG_DIR` still wins. The logic is in `apps/vectorcraft/src/profile.rs` and works
the same on macOS and Linux.
- `vectorcraft.wxs` (WiX) is a per-machine install into Program Files with a Start Menu shortcut
and an App Paths entry (Win+R `vectorcraft`). Same-version upgrades are allowed, so release
candidates replace each other.