From 485046bf3504cc22f63bbc020942d51025b50b98 Mon Sep 17 00:00:00 2001 From: hxw <530313@qq.com> Date: Fri, 9 Oct 2026 09:04:50 -0500 Subject: [PATCH] Issue #399: Windows MSI: choose the install folder; upgrades keep it The interactive installer now walks Welcome -> Destination Folder -> Ready -> progress -> Completed (from #79). Destination Folder is WiX's InstallDirDlg: Program Files\LightCraft by default, Change... browses, and WixUIValidatePath refuses a folder that can't be used. The chosen folder is written to HKLM\Software\LightCraft\InstallFolder and read back (into PREVIOUSINSTALLFOLDER, then INSTALLFOLDER after AppSearch unless given on the command line), so a major upgrade stays in the user's folder instead of moving back to Program Files. Silent and passive installs show no dialogs and take INSTALLFOLDER=.... packaging-lint fails if lightcraft.wxs loses the folder page, the remembered folder or the completion page's launch action. Tested with wix 5.0.2 (x64, arm64, x86 build) and msiexec /qn: upgrade from 0.4.0 stays in Program Files; a custom INSTALLFOLDER install, an upgrade without it (stays), an upgrade with another INSTALLFOLDER (moves there), and uninstall (files, folder and registry value removed). Co-Authored-By: Claude Opus 5.5 --- .github/workflows/packaging-lint.yml | 5 +++ README.md | 4 +- docs/whats-new.md | 4 ++ packaging/windows/lightcraft.wxs | 63 +++++++++++++++++++++++----- 4 files changed, 65 insertions(+), 11 deletions(-) diff --git a/.github/workflows/packaging-lint.yml b/.github/workflows/packaging-lint.yml index 0e2388a62..ed2d8f00a 100644 --- a/.github/workflows/packaging-lint.yml +++ b/.github/workflows/packaging-lint.yml @@ -51,6 +51,11 @@ jobs: if grep -oE '' 'Value="InstallDirDlg"' '' \ + 'Key="Software\LightCraft" Name="InstallFolder"' 'Value="LaunchLightcraft"'; do + grep -qF "$want" packaging/windows/lightcraft.wxs || { echo "::error::lightcraft.wxs lost: $want"; exit 1; } + done desktop-file-validate packaging/linux/ai.storyteller.lightcraft.desktop sed -e 's/@VERSION@/0.0.0/' -e 's/@DATE@/2026-01-01/' packaging/linux/ai.storyteller.lightcraft.metainfo.xml.in >"$RUNNER_TEMP/ai.storyteller.lightcraft.metainfo.xml" appstreamcli validate --no-net --explain "$RUNNER_TEMP/ai.storyteller.lightcraft.metainfo.xml" diff --git a/README.md b/README.md index e93683c63..ba7c960f9 100644 --- a/README.md +++ b/README.md @@ -444,7 +444,9 @@ Questions, ideas or a bug you'd like to talk through first? Bring them to [Disco | arm64 (Snapdragon and other ARM PCs) | `lightcraft--windows-arm64.msi` | `lightcraft--windows-arm64-portable.zip` | | x86 (32-bit) | `lightcraft--windows-x86.msi` | `lightcraft--windows-x86-portable.zip` | -Installers and executables are code-signed. +Installers and executables are code-signed. The installer asks where to install (`C:\Program Files\LightCraft` by +default; upgrades stay in the folder you chose) and ends on a page confirming LightCraft was installed, with an +option to start it. For unattended installs: `msiexec /i lightcraft--windows-x64.msi /qn INSTALLFOLDER="D:\Apps\LightCraft\"`. ### macOS diff --git a/docs/whats-new.md b/docs/whats-new.md index 96b10a974..afcc1328e 100644 --- a/docs/whats-new.md +++ b/docs/whats-new.md @@ -129,6 +129,10 @@ ) ### Reliability +- The Windows installer asks where to install LightCraft (Program Files by default; upgrades keep the folder you + chose) and ends on a page saying it was installed, with a "Launch LightCraft" box. It used to finish without a word, + so a successful install looked like nothing had happened (issues #18, #399). Silent installs (`/qn`, `/passive`) + show no dialogs and take `INSTALLFOLDER=...`. - If the desktop app can't open its window (for example when no graphics device can be used), it now says so in a message box that names the log file, instead of quitting without a trace (issue #260). - On macOS, single-key shortcuts that appear in the menu bar now work: E, C, H, M, ⇧P, I, K, D, ratings 0–5, diff --git a/packaging/windows/lightcraft.wxs b/packaging/windows/lightcraft.wxs index b6de42cfe..ce98a7143 100644 --- a/packaging/windows/lightcraft.wxs +++ b/packaging/windows/lightcraft.wxs @@ -6,7 +6,8 @@ wix build lightcraft.wxs -arch x64 -ext WixToolset.UI.wixext/5.0.2 -ext WixToolset.Util.wixext/5.0.2 -d Version=1.2.3 -d BinDir=... -d IconPath=... -d UiDialogBmp=... -d UiBannerBmp=... -o out.msi - Per-machine install into Program Files, a Start Menu shortcut, `.pcraft` owned by LightCraft, + Per-machine install into Program Files (or the folder chosen in the installer, or + `INSTALLFOLDER=...` on the msiexec command line; upgrades keep it), a Start Menu shortcut, `.pcraft` owned by LightCraft, and LightCraft offered under "Open with" for PSD/PSB and the image formats it reads (without taking over the user's default app for them). --> @@ -35,6 +36,14 @@ + + + + + @@ -45,12 +54,15 @@ - - + + + + + + + + + + + + + + + + + + + + @@ -131,6 +173,7 @@ +