Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Diagnostic info shows wrong OS name and architecture #406

Open
n0samu opened this issue Sep 10, 2023 · 2 comments
Open

[BUG] Diagnostic info shows wrong OS name and architecture #406

n0samu opened this issue Sep 10, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@n0samu
Copy link
Member

n0samu commented Sep 10, 2023

Describe the bug
On my PC (Windows 10 Pro 64-bit), the launcher's diagnostic info (Logs => Copy Diagnostics) says:

Operating System: Windows 10 Enterprise
Architecture:     ia32

To Reproduce
Steps to reproduce the behavior:

  1. Click the Logs tab of the launcher
  2. Click Copy Diagnostics
  3. Paste and observe the values

Expected behavior
Operating system and architecture should match what is shown in System Information and elsewhere.

Desktop (please complete the following information):

  • OS: Windows 10 Pro 64-bit
  • Flashpoint Version: 12
@n0samu n0samu added the bug Something isn't working label Sep 10, 2023
@oblivioncth
Copy link
Contributor

oblivioncth commented Oct 31, 2023

Relevant source:

message = message + 'Operating System: ' + os.version() + '\n';

So there's two things going on here, but oddly enough the root issue seems to be a Windows quirk.

The launcher gets this info via Node.JS' os module, specifically os.version() and os.arch().

First, os.arch() specifically returns the architecture that the binary was compiled for, not the current host system. Since the launcher is a 32-bit application this will always show ia32. proccess.arch is an alternative to this, but I think it might suffer from the same limiation.

For os.version() things get weirder. The underlying C library that Node uses gets the name from Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName, which on my system is "Windows 10 Pro"; however, it seems that this library doesn't specifically request access to the 64-bit registry via KEY_WOW64_64KEY and just uses the default mask. Since the application is 32-bit, the checked value is redirected to Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion\ProductName and... for whatever bizarre reason, on my system the value of that key is "Windows 10 Enterprise".

Seems like Microsoft goofed.

I suppose the only around both of these is to try to find a module that better handles querying information of the host operating system (though introducing another dependency just for this sure feels shitty), or pull these values manually with os-dependent code :/

EDIT:

Seems the architecture aspect of it has been addressed before. Easy on Windows, complicated everywhere else nodejs/node#17036

@oblivioncth
Copy link
Contributor

Fixed the edition name issue upstream, but of course it will be some time until the update is integrated into a Node release and then that release is integrated into an Electron release, and finally the Launcher is updated to use that XD.

libuv/libuv#4191 (review)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants