ItsSim / fsolauncher

Official FreeSO Launcher made with Electron
https://beta.freeso.org
Mozilla Public License 2.0
13 stars 9 forks source link

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

Closed ItsSim closed 12 months ago

ItsSim commented 1 year ago

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):

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