thcrap icon indicating copy to clipboard operation
thcrap copied to clipboard

Network folder paths are not correctly normalized for games.js (at least by old thcrap_configure)

Open Dobby233Liu opened this issue 2 years ago • 2 comments

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: image

Failed to start <thcrap path>\<executable path>
The system cannot find the path specified.

Dobby233Liu avatar Apr 29 '23 07:04 Dobby233Liu

A possible fix would be to add a special case in str_slash_normalize ensuring that network paths start with \\ instead of //

brliron avatar Apr 29 '23 08:04 brliron

As a temporary workaround you can map the network drive to give it a drive letter.

DankRank avatar Apr 29 '23 11:04 DankRank