thcrap
thcrap copied to clipboard
Network folder paths are not correctly normalized for games.js (at least by old thcrap_configure)
To reproduce this issue:
- Make a network folder with a Touhou game in it
- Make old thcrap_configure scan for games in that folder and generate configurations
Then observe that in games.js, the paths to the game executables in your network folder are written in the form of //host/path, e.g.:
{
"th08": "//vmware-host/Shared Folders/beast/Touhou 8 - Imperishable Night/vpatch.exe",
"th08_custom": "//vmware-host/Shared Folders/beast/Touhou 8 - Imperishable Night/custom.exe"
}
But the host part in the paths should really be written in the form of \\host, and without editing games.js to something like the below:
{
"th08": "\\\\vmware-host/Shared Folders/beast/Touhou 8 - Imperishable Night/vpatch.exe",
"th08_custom": "\\\\vmware-host/Shared Folders/beast/Touhou 8 - Imperishable Night/custom.exe"
}
thcrap_loader will fail to start the executables with bad paths, with the following error:

Failed to start <thcrap path>\<executable path>
The system cannot find the path specified.
A possible fix would be to add a special case in str_slash_normalize ensuring that network paths start with \\ instead of //
As a temporary workaround you can map the network drive to give it a drive letter.