86Box / 86BoxManager

A configuration manager for the 86Box emulator
MIT License
352 stars 45 forks source link

[BUG] 86Box.exe not found even when it should be #112

Open Usalabs opened 1 year ago

Usalabs commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Open 86box manager
  2. Click on Settings
  3. Click on Browse at 86box path
  4. Navigate to 86box folder
  5. click 'Select' to select the folder where 86box.exe is located
  6. 86box manager then reports that 86Box.exe is not found

Expected behavior A clear and concise description of what you expected to happen. The version of 86box I have is the most recent one I downloaded from github 3.11 64bit version for windows, the 86box manager should be able to see 86box.exe in c:\users\\86box path, but it doesn't.

Screenshots If applicable, add screenshots to help explain your problem. Screenshot 1 shows the location where 86Box is found. Screenshot 2 shows when browse is pressed in the 86Box manager path Screenshot 3 shows 86Box.exe not found even though it shows the right path.

Environment (please complete the following information):

Additional context Add any other context about the problem here. 86box-location 86box-manager-requesting-location 86box-manager-error

daviunic commented 1 year ago

I am unable to reproduce the issue on my system (Win10 x64 22H2, same 86Box and 86Box manager versions as you reported). Are there any non-ASCII characters in your username? Should not be a problem, but asking just in case. I assume permissions on this folder are fine as well. Have you tried using any other folder to see if that works?

Usalabs commented 1 year ago

No unusual characters, just plain ASCII in lowercase, and only 7 characters in length. I do have folder protection enabled, and access to that folder is allowed in the exception list, otherwise I would get a warning from MS defender.

I even tried not using nested folders and tried directly from the C drive root, IE, C:\x86Box (uppercase is irrelevant for windows), and even put the manager in the same folder, and I still get the same result.

I'm wondering if the path is hardwired, because even though I put in the path to 86box.exe, when I close the settings and re-open it, the default path 'C:\Program Files (x86)\86Box\' is still there.

ADDENDUM I found the problem, no matter what path is entered, the program is literally looking at 'C:\Program Files (x86)\86Box\' and if 86box.exe is not there then it shows not found, I tested this by creating a folder at 'C:\Program Files (x86)\86Box\' and copied 86box.exe in there and the screenshot is the result, it actually found 86box.exe at that location, and being that the zip file that was downloaded didn't have an installer, it is supposed to be unzipped in any folder, and the manager is supposed to look at the location entered, but it doesn't, the manager is expecting 86box.exe at: 'C:\Program Files (x86)\86Box\' regardless of any entry in the custom path. 86box-found

daviunic commented 1 year ago

Can you verify what the EXEdir registry value in the HKEY_CURRENT_USER\SOFTWARE\86Box key contains? It should be the directory you chose and that's the value used, unless said registry key doesn't exist, at which point it does default to program files.

Your problem implies there's a problem with reading and/or writing that key. By default every user can write to their own CURRENT_USER hive, unless you've made some changes to the permissions there I guess.

EDIT: I see that if an exception happens when trying to parse that registry key, we silently fallback to default values. Perhaps an error should be shown instead to let the user know there's a problem. I'll probably do this for the 1.7.5 update regardless of what turns out to be the problem in your case.

Usalabs commented 1 year ago

The registry entry show the default path:

HKCU->Software->86Box->EXEdir = C:\Program Files (x86)\86Box\

It seems I have to manually edit that value so that the manager can see that path, but when I try to enter a different path using the manager settings, the manager doesn't read that location, it seems that the manager doesn't write to the registry, and only accepts what's present in that key value.

I tested this by creating an empty folder without even placing 86Box.exe inside it, and entering c:\testing into the 'select folder' after hitting Browse in the manager settings and instead of the manager displaying 'Not Found' it still showed the current version of 86Box as if it was still looking in the path set by the registry, not by my entry from within the manager.

ADDENDUM Perhaps a sort of 'debugging?' option, in the advanced tab of settings, and a short description under that checkbox would say something like "If you're having problems with errors being displayed, check this box to display debugging information for reporting to the developer", could be implemented.

On Wed, Dec 28, 2022 at 9:59 AM David Simunič @.***> wrote:

Can you verify what the EXEdir registry value in the HKEY_CURRENT_USER\SOFTWARE\86Box key contains? It should be the directory you chose and that's the value used, unless said registry key doesn't exist, at which point it does default to program files.

— Reply to this email directly, view it on GitHub https://github.com/86Box/86BoxManager/issues/112#issuecomment-1366793684, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGLA7XD3F7ORKRVOOW7GOATWPRWYBANCNFSM6AAAAAATIPBL5A . You are receiving this because you authored the thread.Message ID: @.***>

-- Virus-free. www.avast.com ( https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link )

daviunic commented 1 year ago

I'm preparing an update that will handle registry issues a bit better to help avoid weird issues like this. In the mean time, have you tried deleting the 86Box key entirely? This will wipe all the settings and VMs (backup the subkey if you want to keep those), perhaps something's just bugged out.

Usalabs commented 1 year ago

I tried the removal of the EXEdir, key, and tried setting the path in the manager settings and it showed the not found error, and when I checked for the key in the registry, it wasn't there, but when I re-added the key: EXEdir=<proper path to 86Box.exe> the manager then showed the version and compatibility.

After removing the value EXEdir, I created a registry file 'exedir-path.reg' with these values:-

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\SOFTWARE\86Box] "EXEdir"="C:\86box\"

Then I double clicked it to add it from the file and then opened the settings in the 86box manager and it showed the 86Box version and compatibility, it does seem that for some reason, the manager doesn't write to the registry, I don't have any 3rd party antivirus, only using defender, with ransomware protection enabled, with the 86box folder allowed to be written to, but then again, the manager my be attempting to write to the registry but failing silently.