SpectrumQT / XXMI-Launcher

GNU General Public License v3.0
128 stars 5 forks source link

Genshin (CN) Launch Error: FileNotFoundError Due to Incorrect Registry Path #7

Closed JerryAZR closed 1 month ago

JerryAZR commented 1 month ago

When attempting to launch Genshin (CN), the following error occurs:

2024-09-30 00:02:25,938,938 core.packages.model_importers.gimi_package DEBUG Checking DCR... 2024-09-30 00:02:25,982,982 root ERROR Traceback (most recent call last): File "app.py", line 362, in launch File "core\event_manager.py", line 43, in Fire File "core\packages\model_importers\model_importer.py", line 243, in start_game File "core\packages\model_importers\gimi_package.py", line 142, in initialize_game_launch File "core\packages\model_importers\gimi_package.py", line 195, in disable_dcr FileNotFoundError: [WinError 2] The system cannot find the file specified

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "app.py", line 408, in wrap_errors File "app.py", line 372, in launch Exception: GIMI Loading Failed: [WinError 2] The system cannot find the file specified

Upon investigating, I found that the relevant registry key for Genshin is located at:

Computer\HKEY_CURRENT_USER\Software\miHoYo\原神

However, the code is attempting to access ...\miHoYo\Genshin Impact in gimi_package.py:195 (disable_dcr)

Since the correct path seems to be region-based, a simple modification may not suffice. We might need to implement a more dynamic approach to handle different regions.

If you're currently busy, I would be happy to assist in developing a fix and submitting a pull request if that would help.

SpectrumQT commented 1 month ago

Hello! Next version will support both keys. Hopefully the inner registry structure of this key isn't different (I need a full registry dump of HKEY_CURRENT_USER\Software\miHoYo\原神 to be sure). There will be also an option to disable this tweak via settings.

SpectrumQT commented 1 month ago

Issue is fixed in 1.0.0 update. If CN GI client registry doesn't have further differences, it should work now. If it still fails with new update, uncheck General Settings -> Disable DCR checkbox and let me know.