Skip to content

fix: Preserve user language and input method settings during setup - #1959

Merged
fxliang merged 3 commits into
rime:masterfrom
cary-rowen:fix-safe-language-profile-setup
Oct 31, 2026
Merged

fxliang merged 3 commits into
rime:masterfrom
cary-rowen:fix-safe-language-profile-setup

Conversation

@cary-rowen

Copy link
Copy Markdown
Contributor

Installing or upgrading Weasel has been observed to change the Windows display language or restore a previously removed Microsoft Pinyin input method. This PR changes how setup updates input method registration and the current user’s language list.

Microsoft documents that Windows dynamically adjusts display language and default input method settings based on the user language list, and recommends the International PowerShell cmdlets for updating these settings on a running system.

Changes:

  • Replace the installation and uninstallation calls to InstallLayoutOrTip with a PowerShell helper that reads the existing list through Get-WinUserLanguageList, modifies Weasel entries, and writes it back through Set-WinUserLanguageList. Skip writing the list when no change is needed.
  • Preserve TSF profiles during upgrades while updating and registering the components, avoiding removal and re-addition of the input method.
  • Migrate the current user’s legacy IMM entries to TSF, retaining the earliest Weasel position and updating a default input method override that references the legacy entry. Keep shared IMM registration and binaries during upgrades so other accounts can still use them; remove them during uninstallation.
  • If the selected Chinese language entry is absent, leave the language list unchanged and prompt the user to add it in Windows Settings during interactive setup.

Add helper unit tests and installer regression tests covering input method ordering, duplicate entries, repeated execution, legacy migration, preservation of shared resources during upgrades, and uninstallation cleanup. Installer tests also check the language list, display language override, and default input method override.

Closes #1296.
Closes #1849.

Update only Weasel entries in the current user language list, writing it only when needed. Preserve TSF profiles during upgrades and include the helper in installer and source-build output.
…iles

Replace current-user IMM entries with TSF entries at their existing position and preserve the default input method. Keep shared legacy registrations and binaries during upgrades; clean them on uninstallation after updating the current user.
Add helper unit tests and installer regression checks to the existing Windows MSBuild job. Check input method order, display language and default overrides, legacy migration, and shared IMM cleanup.
@cary-rowen cary-rowen changed the title Preserve user language and input method settings during setup fix: Preserve user language and input method settings during setup Oct 20, 2026
@cary-rowen

Copy link
Copy Markdown
Contributor Author

cc @fxliang would love to get your thoughts on this when you have a moment.

@fxliang

fxliang commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

LGTM

@fxliang
fxliang merged commit f96ed24 into rime:master Oct 31, 2026
3 checks passed
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.

安装完小狼毫后重启电脑,系统语言变成英文。 0.16.0 升级到0.16.1 重启系统之后 win11系统语言变成了英文

2 participants