Skip to content

fix(desktop): remember the install path across Windows updates#3060

Open
HUQIANTAO wants to merge 1 commit into
esengine:main-v2from
HUQIANTAO:pr/installer-remember-path
Open

fix(desktop): remember the install path across Windows updates#3060
HUQIANTAO wants to merge 1 commit into
esengine:main-v2from
HUQIANTAO:pr/installer-remember-path

Conversation

@HUQIANTAO
Copy link
Copy Markdown
Contributor

Summary

The Windows installer hard-coded InstallDir $LOCALAPPDATA\Programs\Reasonix. On update (silent /S from the auto-updater, or interactive) the user was forced back to the per-user default even if they had moved the install to a different drive. The silent auto-updater would re-run with /S into the wrong dir and leave the previous install orphaned.

Problem

The auto-updater downloads a fresh installer and re-runs it with /S. NSIS's default InstallDir is the literal $LOCALAPPDATA\Programs\Reasonix, so the silent install lands there even if the previous install was at D:\Tools\Reasonix. The user-visible effect: updates don't replace the binary the user launched from, the launcher/shortcut stops pointing at the active install, and the old dir is orphaned (and grows with every update).

Changes

  • Switch the installer to InstallDirRegKey HKCU ${UNINST_KEY} "InstallLocation" so the next install inherits the previous path.
  • Fall back to the per-user default in .onInit when the value is missing (first install, uninstaller registry wiped, or the value is empty).
  • Persist the resolved path to InstallLocation on every install, so the silent auto-updater can find it next time.

Test plan

  • makensis parses the file (CI does this on the build script).
  • Manual: clean install → install dir is the per-user default. Move the install to D:\Tools\Reasonix, run the installer again → it lands at D:\Tools\Reasonix. Wipe the uninstaller registry, run the installer again → it falls back to the per-user default.

Closes esengine#3031

The Windows installer hard-coded `InstallDir$LOCALAPPDATA\Programs\`. On update (silent /S from the auto-updater, or interactive) the user was forced back to the per-user default even if they had moved the install to a different drive (e.g. `D:\Tools\Reasonix`). The auto-updater in particular would re-run with /S into the wrong dir and leave the previous install orphaned at the original path.

This change:

* Switches the installer to `InstallDirRegKey HKCU ${UNINST_KEY} "InstallLocation"` so the next install inherits the previous path.
* Falls back to the per-user default in `.onInit` when the value is missing (first install, uninstaller registry wiped, or the value is empty).
* Persists the resolved path to `InstallLocation` on every install, so the silent auto-updater can find it next time.
* The persisted value is written *before* the GetSize block so the registry is always consistent with the installed files.
@github-actions github-actions Bot added the v2 Go rewrite (1.x) — main-v2 branch, active development label Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant