Auto-update was failing on Windows because OpenLessIme.dll is a TSF input-method
DLL: once registered, Windows maps it into every text-input client process
(browsers, IDEs, chat apps...). The installer's PREINSTALL hook tried to
overwrite the file directly while it was still mapped, hitting a sharing
violation and aborting the update.
NSIS hook (openless-ime-hooks.nsh):
- PREINSTALL now calls OPENLESS_IME_UNREGISTER_X86/X64 first to release the
COM/TSF registration. On a fresh install this is a harmless no-op (existing
unregister macros log the exit code without aborting).
- DLL bytes are written to OpenLessIme.dll.new and atomically renamed into
place. If the old DLL is still locked by a TSF client process, Delete fails
and we fall back to Rename /REBOOTOK + SetRebootFlag — Windows queues the
replacement via PendingFileRenameOperations and the new bytes activate after
the next reboot. Same TSF registration path is preserved, so re-registration
in POSTINSTALL stays valid across the reboot.
WiX (openless-ime.wxs):
- UnregisterOpenLessImeX86/X64 now also fire Before InstallFiles when a
previous version is installed (Installed AND NOT REMOVE). Original condition
(REMOVE="ALL", Before RemoveFiles) only covered the dedicated uninstall
sequence; auto-update / minor-upgrade skipped it entirely and ran straight
into the same sharing violation as NSIS.
Bumps to 1.2.24-5 (Beta-5).
Co-authored-by: baiqing <lbx12309@icloud.com>