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
+4 -1
View File
@@ -5,7 +5,7 @@
.DESCRIPTION
Produces, in $env:DIST (default: dist/release):
vectorcraft-<version>-windows-<arch>.msi per-machine installer (WiX v5)
vectorcraft-<version>-windows-<arch>-portable.zip vectorcraft.exe + vectorcraft-cli.exe
vectorcraft-<version>-windows-<arch>-portable.zip vectorcraft.exe + vectorcraft-cli.exe + portable.txt
The binaries link the C runtime statically (+crt-static), so neither the MSI nor the portable
zip needs the Visual C++ redistributable. Signing is delegated to sign.ps1 (skipped with a
@@ -165,6 +165,9 @@ Remove-Item -Recurse -Force $Portable -ErrorAction SilentlyContinue
New-Item -ItemType Directory -Force -Path $Portable | Out-Null
Copy-Item (Join-Path $Stage '*.exe') $Portable
Copy-Item -Recurse (Join-Path $Docs '*') $Portable
# portable.txt beside vectorcraft.exe switches on portable mode: settings, libraries, recovery
# files and logs go to VectorCraftData\ next to the exe instead of %APPDATA% (#1366; see profile.rs).
Copy-Item (Join-Path $PSScriptRoot 'portable.txt') $Portable
$Zip = Join-Path $Dist "vectorcraft-$Version-windows-$Arch-portable.zip"
Remove-Item -Force $Zip -ErrorAction SilentlyContinue
Compress-Archive -Path $Portable -DestinationPath $Zip
+10
View File
@@ -0,0 +1,10 @@
VectorCraft portable mode
While this file sits next to vectorcraft.exe, VectorCraft keeps its preferences, swatch and
graphic style libraries, added fonts, crash-recovery files and logs in the VectorCraftData folder
beside it, and writes nothing to %APPDATA%. Copy the whole folder to move VectorCraft with its
settings.
Delete this file to use the normal per-user settings folder (%APPDATA%\VectorCraft) instead.
If VectorCraftData can't be written (for example on a read-only drive), VectorCraft logs a
warning and uses %APPDATA%\VectorCraft instead.
+2
View File
@@ -70,6 +70,8 @@ try {
Copy-Item vendor/windows-link/license-mit (Join-Path $Stage 'LICENSE-windows-link-MIT')
Copy-Item vendor/windows-link/license-apache-2.0 (Join-Path $Stage 'LICENSE-windows-link-Apache-2.0')
Copy-Item docs/windows7.md (Join-Path $Stage 'WINDOWS7.md')
# portable.txt switches on portable mode, as in the regular portable zip (#1366).
Copy-Item (Join-Path $PSScriptRoot 'portable.txt') $Stage
if ($env:CRAFT_FONTS_DIR) {
foreach ($ofl in Get-ChildItem (Join-Path $env:CRAFT_FONTS_DIR 'fonts\*\OFL.txt')) {
Copy-Item $ofl.FullName (Join-Path $Stage "OFL-$($ofl.Directory.Name).txt")