fraganator / archive-cache-manager

A LaunchBox plugin which extracts and caches large ROM archives, letting you play games faster.
GNU Lesser General Public License v2.1
11 stars 5 forks source link

Games with unusually long paths fail to launch. #40

Open Ranmizuno opened 1 year ago

Ranmizuno commented 1 year ago

Hi. I think my case is a rare case, but I would appreciate it if you could handle this. I understand that there was an update for shortening the file name last time. Now SNK Neo Geo Pocket long ROM name has been successfully cached.

But for example with SNK Neo Geo CD "Bakumatsu Roman Daini Maku - Gekka no Kenshi - Tsuki ni Saku Hana, Chiri Yuku Hana ~ The Last Blade 2 (Japan) (En, Ja, Es, Pt).7z" The game fails to start like.

In the ArchiveCache folder "Bakumatsu Roman Daini Maku - Gekka no...The Last Blade 2 (Japan) (En,Ja,Es,Pt).7z - B40128" folder. When I throw this in the trash, I get a warning that the path is too long.

I remember that the folder name had a limit of 84 characters. If you remove "-B40128" it will be 84 characters or less, but if you include "-B40128" it will be 91 characters.

"Bakumatsu Roman Daini Maku - Gekka no ...The Last Blade 2 (Japan) (En,Ja,Es,Pt).7z - B40128" contains "Bakumatsu Roman Daini Maku - Gekka no Kenshi - Tsuki ni Saku Hana, Chiri Yuku Hana ~ The Last Blade 2 (Japan) (En,Ja,Es,Pt) (Track 01).bin".

Also, the bin is supposed to be copied to the SNK Neo Geo CD, but only the cue is copied and the bin is not copied at all. Is this because it exceeds the 255 character limit?

Looking at the contents of the Link file, "C:\Users\Mia\LaunchBox\ArchiveCache\Bakumatsu Roman Daini Maku - Gekka no ...The Last Blade 2 (Japan) (En,Ja,Es,Pt).7z - B40128"

probably "C:\Users\Mia\LaunchBox\ArchiveCache\Bakumatsu Roman Daini Maku - Gekka no ...The Last Blade 2 (Japan) (En,Ja,Es,Pt).7z - B40128\Bakumatsu Roman Daini Maku - Gekka no Kenshi - Tsuki ni Saku Hana, Chiri Yuku Hana ~ The Last Blade 2 (Japan) (En,Ja,Es,Pt) (Track 01).bin”

266 characters in total. For the time being, long paths are enabled by editing the Windows registry, but it seems that files that are too long still fail to be cached.

This filename is from the Redump database.

Ranmizuno commented 1 year ago

Titles like this didn't launch as well. http://forum.redump.org/post/78808/#p78808

I created a new folder called "C:\A\" and specified it as the ArchiveCache folder, but it failed to start. No error hopup from 7z. Return to LB as it is from the boot screen.

RetroArch log

[libretro ERROR] File Bakumatsu Roman Daini Maku - Gekka no Kenshi - Tsuki ni Saku Hana, Chiri Yuku Hana ~ The Last Blade 2 (Japan) (En,Ja,Es,Pt) (Track 01).bin could not be opened. [libretro ERROR] Could not open CUE file: C:\Users\Mia\LaunchBox\ArchiveCache\Bakumatsu Roman Daini Maku - Gekka no ...The Last Blade 2 (Japan) (En,Ja,Es,Pt).7z - B40128\Bakumatsu Roman Daini Maku - Gekka no Kenshi - Tsuki ni Saku Hana, Chiri Yuku Hana ~ The Last Blade 2 (Japan) (En,Ja,Es,Pt).cue

This is embarrassingly peculiar to Japan... I think it's a title name.

The Japanese title + Japanese subtitle tends to be the name of the product name, so the title will be quite long. This time it's SNK Neo Geo CD, but I think there are similar possibilities for other platforms.

fraganator commented 1 year ago

Hi @Ranmizuno , thanks for raising the issue. The current path length check is for 255 chars, and for anything longer than that the archive folder path is shortened using the ... ellipsis in the middle. The problem is the check assumes the archive's file contents have the same name / length as the archive. In this case it's longer due to the additional " (Track 01)" in the filename, pushing the full path length to 266 chars.

I'll fix it up for the next release.