Skip to content

首页博客

v0.5.4

Fixed ​

Critical bug: installer overwrites the user's PATH ​

Symptom: After installing or updating smtc2web, the user's PATH environment variable was reset to contain only the installation directory, breaking uv, winget, npm, and other command-line tools.

Cause: The NSIS install script used ReadRegStr to read the existing PATH. When the PATH length exceeded the NSIS string limit (1024 characters in this build), the read failed and returned an empty value; the old code misjudged "read failed" as "PATH is empty" and overwrote the entire PATH with the installation directory.

Fix: The install script now first queries the real PATH length via the Win32 API (RegQueryValueEx), and only appends or removes entries when the length is confirmed to be safe; when PATH is too long it simply skips and never overwrites. The uninstall logic is hardened as well and matches each entry precisely to avoid accidentally deleting other paths that contain the same prefix.

Note: Due to the NSIS string length limit, when the user's PATH exceeds about 1000 characters, smtc2web will not add itself to PATH automatically (it can be added manually), but it will no longer break any existing entries.

If you have already encountered the PATH overwrite issue, you can restore the original content in the registry at HKCU\Environment\Path and reopen the terminal for the change to take effect.

基于 MIT 许可 发布