MobyGamer / total-dos-launcher

A system for easily loading and running thousands of DOS programs on vintage hardware
MIT License
109 stars 10 forks source link

Included pkunzip fails to unzip some .zip archives #51

Closed MobyGamer closed 10 months ago

MobyGamer commented 2 years ago

Some .zip archives are compressed with 2.50 or other slightly off compressors, and pkunzip 2.04g will sometimes fail to unzip them. Akuma noted that P7ZIP included with freedos can unzip seemingly everything ok, using the following syntax:

P7ZIP x %s -o"%d"

This should probably be included in handlers.ini, and tested on 8088 hardware to see how much slower than pkunzip.exe it is. If it's not too slow, consider switching to it.

MobyGamer commented 2 years ago

Further clarification: When using the %d without quotes it inserted a trailing backslash, "cache.dir/mygame\/"

psakhis commented 10 months ago

I think with -o"%d" isn't working because last backslash "cache.dir/game/" prevents creating directory with p7zip

We need "%g" or something without last backslash

MobyGamer commented 10 months ago

Since there can be only one .zip handler defined, and since the P7ZIP x %s -o"%d" syntax works, do we really need a second option?

psakhis commented 10 months ago

I can't it work here. I'm using P7ZIP version 4.65.

If i do it manually, for example P7ZIP.EXE X XXXXX.ZIP -O"C:\TEMP\"fails because last backslash

Error: Can not create output directory C:\TEMP"/

TDL.LOG

..
2023111319250136: Amok (1996)
2023111319250197: cache dir C:\TEMP\CACHE.DIR\AMOK1996 not found; attempting to create
2023111319250197: Entering handler framework: ZIP
2023111319250197: Execution template:  x AMOK1996.ZIP -o"C:\TEMP\CACHE.DIR\AMOK1996\"
2023111319250197: Switching to files\ to execute c:\drivers\p7zip\p7zip.exe x AMOK1996.ZIP -o"C:\TEMP\CACHE.DIR\AMOK1996\"
=ERROR=  2023111319250268: EXEC failure; Error code = 2
2023111319250268: Switching back to files
2023111319250268: Saving DOS screen contents
=ERROR=  2023111319250268: Error code received during extraction
Warning: 2023111319251136: the exact error.
2023111319251136: Found 1 files in C:\TEMP\CACHE.DIR\AMOK1996
2023111319251136: Entering handler framework: ???
2023111319251542: was extracted).  Press ESC to leave LIST when done.
..
MobyGamer commented 10 months ago

Interesting; thanks for providing the log. I've downloaded freedos 1.3 and extracted p7zip to test with it, and the actual problem is that p7zip (as shipped in FreeDOS 1.3) is expecting forward slashes in the output directory string, and not backslashes as is the norm for all MS-DOS operating systems. If I use forward slashes, even with a trailing forward slash, it works -- although it ignores the drive designation:

F:\>P7ZIP\P7ZIP.EXE x AMOK1996.ZIP -o"c:/temp/cache.dir/amok1996/"

7-Zip (A) 4.65  Copyright (c) 1999-2009 Igor Pavlov  2009-02-03
p7zip Version 4.65 (locale=C,Utf16=off,HugeFiles=off,1 CPU)

Processing archive: AMOK1996.ZIP

Extracting  ADRV688.DIG
Extracting  AMOK.BAT
Extracting  AMOKDOS.EXE
Extracting  AMOKLOGO.P8B
Extracting  AMOKWIN.EXE
Extracting  ANIMS
Extracting  ANIMS/DEBRIEF.HN2
Extracting  ANIMS/DEBRIEF.P8B

Break signaled

F:\>
F:\>dir c:\temp\cache.dir\amok1996 /w

 Volume in drive C is C_DRIVE
 Volume Serial Number is 76CA-1A21
 Directory of C:\TEMP\CACHE.DIR

File not found - "C:\TEMP\CACHE.DIR\AMOK1996"
    0 File(s)                 0 Bytes
    0 Dir(s)         16,777,216 Bytes free

F:\>dir f:\temp\cache.dir\amok1996 /w

 Volume in drive F is F_DRIVE
 Volume Serial Number is 587F-8029
 Directory of F:\TEMP\CACHE.DIR\AMOK1996

[.]             [..]            [ANIMS]         ADRV688.DIG     AMOK.BAT
AMOKDOS.EXE     AMOKLOGO.P8B    AMOKWIN.EXE
    5 File(s)         1,048,999 Bytes
    3 Dir(s)    756,766,539,776 Bytes free

F:\>

As these are really bugs in the version of p7zip that ships with FreeDOS 1.3, I don't feel it's my responsibility to fix. I could provide options for both giving the path with forward slashes, as well as no trailing slash, but it still wouldn't work because that version of p7zip also ignores the drive letter.

If someone fixes the version of p7zip that comes with FreeDOS 1.3, let me know where the fixed version is and I can re-test.

An alternative is to write a small batch file that makes p7zip work like pkunzip, and call that batch file via "command.com /c path\to\name.bat" in handlers.ini.

psakhis commented 10 months ago

Oh great discovery. Which version of p7zip is working?

And congrats for this launcher, it's really really god.

MobyGamer commented 10 months ago

I don't use FreeDOS or p7zip so I'm afraid I can't say which version is working. I would refer the FreeDOS package maintainers to this thread to see if they can observe, and fix, the behavior.

Thanks for the kind words :-) I hope to add more search features someday when I have more time.

psakhis commented 10 months ago

The only thing I miss is reopening in the last selected game; just some games needs reset to switch memory conditions and this feature would prevent research game again.

Thx very much!

MobyGamer commented 10 months ago

Oh, you mean returning to the same game after DOS is restarted? I could add that as a feature; I'll create a github issue for it.

To ensure you're using the latest version (there have been bug fixes since 2020), grab the new .EXE from the distro\ directory in this repo; I just updated it.

MobyGamer commented 10 months ago

Because p7zip is buggy, and because it also requires a 386+ (I thought it could run on 8088), I'm going to close this issue. I've added @psakhis 's feature request as a new issue.