ItsSim / fsolauncher

Official FreeSO Launcher made with Electron

Home Page:https://beta.freeso.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Windows] winreg not returning UTF8 values (Windows Registry)

ItsSim opened this issue · comments

commented

Describe the bug
When using the winreg library (which we use on Windows to store installation paths and read them) to obtain a value (an installation path) from a registry key, the value does not include accents and special characters. This causes problems when checking if the path (the registry value) exists.

For example, if the value is C:\Àrea de travalho\FreeSO Game, it returns C:\Area de travalho\FreeSO Game, without the accent.

This is not very critical since most installations do not include these special characters, and those that are having problems can be instructed to install in paths without them.

Launcher Version
*

To Reproduce
Steps to reproduce the behavior:

  1. Make sure you're using the latest production build
  2. Use the launcher to install the game in a path with accents (Like, for example: C:\Àrea de travalho) on Windows
  3. Once the installation is done, press the Play button. An error will appear indicating "C:\Area de travalho\FreeSO Game\FreeSO\FreeSO.exe" (notice A instead of À) does not exist.

Expected behavior
The winreg library should return the UTF8 value with accents. A copy of the library in /vendor/ can be added with the fix, since https://github.com/voomly/node-winreg is pretty much abandoned.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows
  • Version: 11
  • Build: [e.g. 22000.376]

Additional context
Registry usage is in the src/fsolauncher/lib/registry.js file (which could also use a nice refactor...)