thpatch / thcrap

Touhou Community Reliant Automatic Patcher
https://www.thpatch.net
The Unlicense
547 stars 40 forks source link

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

Open Dobby233Liu opened 1 year ago

Dobby233Liu commented 1 year ago

To reproduce this issue:

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.
brliron commented 1 year ago

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

DankRank commented 1 year ago

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