-
Notifications
You must be signed in to change notification settings - Fork 33
Description
Description
If the Native Hub executable is on a different drive than the Unity editor installation, launching it after the first time fails with the exception:
Unhandled standard exception of type "class std::filesystem::filesystem_error" with message "directory_iterator::directory_iterator: The system cannot find the path specified.: "\Program Files\Unity\Hub\Editor""; terminating the application.
%AppData%\UnityHubNative\editorPaths.txt indeed contains \Program Files\Unity\Hub\Editor without the drive letter as the editor path. This path refers to a directory on the same drive as the executable, which doesn't exist.
editorPaths.txt can be edited manually to add the correct drive letter, fixing the problem. If the file is deleted, it is created again without the drive letter.
To Reproduce
- Use a computer that has never run Native Hub before, or delete the
UnityHubNativedirectory in%AppData%. - Place Native Hub executable on a different drive than the Unity installation. For example, if Unity is installed on the default path in
C:, have the executable onD:. - Start Native Hub for the first time, without an error.
- Close Native Hub.
- Start Native Hub for the second time.
- Exception is thrown and Native Hub closes.
Expected behavior
- The editor path should be saved including the drive letter, i.e. as "absolute path".
- If the editor directory is not found, Native Hub should not close with an exception. It should re-scan or ask the user for a valid directory.
Computer information:
- OS: Windows 10 Pro 22H2 x64