Skip to content

Fix Windows install double-click launch and NSIS Chinese mojibake - #16

Merged
XYAIStudio merged 1 commit into
mainfrom
cursor/windows-install-launch-90c0
Sep 15, 2026
Merged

XYAIStudio merged 1 commit into
mainfrom
cursor/windows-install-launch-90c0

Conversation

@XYAIStudio

Copy link
Copy Markdown
Owner

Summary

Hotfix for the shipped Windows NSIS installer on v0.0.1.

Bug 1 — double-click does nothing after install

  • Shortcuts now pin WorkingDirectory / SetOutPath to $INSTDIR so Start-in cannot leak to the WebView2 plugin dir.
  • WebView2 user data is %LOCALAPPDATA%\FreeOS\WebView2 (writable). The Microsoft default next to FreeOS.exe under Program Files fails with E_ACCESSDENIED for a normal user and the windowsgui process exits with no UI.
  • Finish-page launch uses IShellDispatch2 (explorer fallback) so the first run is not elevated. An admin Exec was stamping ~/.freeos / desktop.pid at High integrity; the later unelevated shortcut then could not write logs or extract the portable.
  • Instance lock ignores a leftover desktop.pid whose process is not FreeOS.exe (PID reuse / old Octop). Named mutex is the primary Windows lock.
  • If ~/.freeos is not writable, icacls resets Medium integrity so a previous elevated first-run can recover.

Bug 2 — finish checkbox è¿è¡Œ FreeOS

  • Unicode true does not change how makensis reads the .nsi. GitHub windows-latest is en-US (ACP = CP1252), so UTF-8 运行 without a BOM became the screenshot mojibake.
  • project.nsi is UTF-8 with BOM; makensis -INPUTCHARSET UTF8. MUI SimpChinese stock strings were already fine; custom LangStrings were not.

Host launch still sets OCTOP_DESKTOP=1 / FREEOS_DESKTOP=1. Does not change GitHub-only updates, blue theme, FREEOS_STAMP, or Organization OS.

Target branch

  • Base is main (release/* or hotfix/* only)

Type of change

  • Bug fix
  • Release / hotfix

Test plan

  • uv run pytest tests/unit/desktop/test_nsis_uninstall.py tests/unit/desktop/test_auth_brand_surfaces.py -q — 11 passed (shortcut WD, UTF-8 BOM + -INPUTCHARSET UTF8, packaged FreeOS.exe + embedded portable, unelevated finish launch, OCTOP_DESKTOP already covered in Go hostLaunchEnv)
  • CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go test -c in desktop/src compiles
  • ruff + mypy --strict src/octop green in pre-commit
  • FreeOS Desktop Package CI on this PR (windows-amd64 / windows-arm64)
  • After merge: replace v0.0.1 Windows .exe assets; user uninstalls old build then reinstalls

Checklist

  • Updated CHANGELOG.md (if user-facing)
  • README / docs updated (if needed)

Reinstall for testers

  1. Settings → Apps → FreeOS → Uninstall (or uninstall.exe in the install folder).
  2. Optional if a previous elevated run left a High-IL home: delete %USERPROFILE%\.freeos\desktop.pid (keep the rest of .freeos unless the portable is corrupt).
  3. Install the new FreeOS-desktop-windows-amd64-0.0.1.exe / arm64 from the refreshed v0.0.1 release.
  4. Double-click the desktop shortcut; first open extracts the portable under %USERPROFILE%\.freeos\portable and should show the window. Logs: %USERPROFILE%\.freeos\logs\desktop.log.
Open in Web Open in Cursor 

The shipped v0.0.1 NSIS package could look like a no-op after install:
shortcuts inherited the wrong Start-in path, WebView2 tried to write
next to FreeOS.exe under Program Files, and the elevated finish-page
Exec stamped ~/.freeos / desktop.pid at High integrity so a later
unelevated double-click died silently. Pin WorkingDirectory to
$INSTDIR, store WebView2 under %LOCALAPPDATA%\FreeOS\WebView2, launch
via IShellDispatch2 (explorer fallback), ignore leftover pids that
are not FreeOS.exe, and repair a non-writable product home.

Finish-page "运行 FreeOS" was UTF-8 decoded as CP1252 (è¿è¡Œ) because
Unicode true does not change makensis source charset. Save project.nsi
as UTF-8 with BOM and compile with -INPUTCHARSET UTF8.
@XYAIStudio
XYAIStudio marked this pull request as ready for review September 15, 2026 14:51
@XYAIStudio
XYAIStudio merged commit 3db5fc8 into main Sep 15, 2026
12 checks passed
@XYAIStudio
XYAIStudio deleted the cursor/windows-install-launch-90c0 branch September 15, 2026 14:51
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.

2 participants