Skip to content

feat: modernize Windows installer UI - #12970

Draft
huhuanming wants to merge 9 commits into
xfrom
codex/nsis-duilib-ui-integration
Draft

feat: modernize Windows installer UI#12970
huhuanming wants to merge 9 commits into
xfrom
codex/nsis-duilib-ui-integration

Conversation

@huhuanming

@huhuanming huhuanming commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • integrate the Win32 Unicode nsis-duilib-ui plugin and versioned OneKey theme resources
  • preserve electron-builder/NSIS as the authoritative installation engine while replacing its visible pages with the approved Win10/Win11 UI
  • keep the native NSIS window as the automatic fallback when plugin or theme initialization fails
  • keep promotional/ad cards out of the installer

The MIT plugin source, preview app, theme system, and NSIS demos live at https://github.com/huhuanming/nsis-duilib-ui.

Install and upgrade state flow

The integration now treats these five points as acceptance requirements:

  1. electron-builder resolves the previous per-user/per-machine installation and directory first.
  2. The modern UI is displayed only after that state has been captured.
  3. A registry-backed upgrade uses the dedicated upgrade page; scope and path are read-only.
  4. A fresh install alone shows scope selection and the Change directory action.
  5. A fresh directory choice is written to $INSTDIR after electron-builder's hidden install-mode page has finished, so scope/elevation handling cannot overwrite it.

Additional handling:

  • a unique previous scope is reused automatically; when both scopes exist, the user gets a dedicated upgrade-scope chooser
  • /allusers and /currentuser remain authoritative and skip the scope page
  • the elevated UAC inner process does not reopen the outer scope UI
  • uninstall and failure callbacks continue to use themed pages, with native fallback preserved

Progress and i18n

  • progress is monotonic within one attempt: lower NSIS samples are ignored instead of making the bar move backwards
  • ResetProgress is the only operation allowed to lower progress, and is called explicitly before a new attempt
  • the installer matches all 19 effective OneKey locales, plus the existing en alias: bn, de, en-US, es, fr-FR, hi-IN, id, it-IT, ja-JP, ko-KR, pt, pt-BR, ru, th-TH, uk-UA, vi, zh-CN, zh-HK, and zh-TW
  • selection uses Windows display-language GetUserDefaultUILanguage LANGID semantics rather than formatting locale; Portuguese and Chinese regional LANGIDs map to the correct variants, with English fallback

Validation

  • Release native build and CTest: 4/4 passed (version, theme, renderer, monotonic progress)
  • NSIS demos and silent smoke compile/pass
  • electron-builder 26.4.0 x64 target completed the actual makensis installer and uninstaller compilation with the final script, DLL, and theme
  • safe isolated test installer verified:
    • fresh install opens the scope chooser
    • current-user silent install persists the selected directory
    • a subsequent launch opens the read-only upgrade page with that directory
    • test registry/install data was removed afterward; the installed OneKey application was not changed
  • final recordings were frame-checked for fresh scope, read-only upgrade, and Welcome -> 42% -> 72% -> Finish progress flow
  • DLL/theme copies in this PR are byte-for-byte identical to the independent source repository build/theme
  • all source and integration commits have valid GPG signatures

Local check limitation

yarn agent:check --profile commit was invoked before commit. This worktree has no Yarn node_modules state file, so Yarn stops before project checks with Couldn't find the node_modules state file. The focused native tests, NSIS demo/smoke, safe runtime flows, and real electron-builder/makensis compilation pass.

The real product failure/uninstall callbacks were compile-validated rather than forced against an installed OneKey application. Runtime failure/uninstall behavior was exercised through the safe demos using the identical DLL, pages, and NSIS event contract.

Notes

  • the NSIS host and plugin remain x86 Unicode even when the Electron payload is x64 or ARM64
  • runtime baseline is Windows 10/11
  • local test installers are not Authenticode-signed because this machine has no product signing certificate

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.

1 participant