joncampbell123 / dosbox-x

DOSBox-X fork of the DOSBox project
GNU General Public License v2.0
2.65k stars 376 forks source link

[GTA1] CD-Rom incorrectly copied as read only preventing configuration changes #3639

Closed henk717 closed 7 months ago

henk717 commented 2 years ago

Describe the bug

The Grand Theft Auto 1 DOS installer makes use of XCOPY, copying the file attributes as well. In DOSBox Daum the files on the disk are read as regular files, so when XCOPY copies them over they will be written to disk as writable files. In DOSBox-X 0.84.1 when the GTA installer is ran the system will report the files as Read Only, so the files written to disk are marked as Read Only. This makes it impossible to change the settings of the game and select your sound card until you manually remove the read only flag.

Steps to reproduce the behaviour

Use an ISO image of the GTA 1 installer for DOS and run trough it with the default options with the C: drive mounted to a folder. The files copied over will now be marked Read Only preventing future modification by the game.

Expected behavior

The files on the disk do not have read only attributes inside the DOS environment (Does DOS normally have this?) resulting in a working copy of the game.

What operating system(s) this bug have occurred on?

Windows 10 (Likely platform agnostic)

What version(s) of DOSBox-X have this bug?

Tested on 0.84.1 MingGW, likely all versions

Used configuration

100% default

Output log

No response

Additional information

No response

Have you checked that no similar bug report(s) exist?

Code of Conduct & Contributing Guidelines

rderooy commented 2 years ago

The xcopy included with DOSBox-X is from FreeDOS, and has not seen an update for a very long time. https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.2/repos/pkg-html/xcopy.html

henk717 commented 2 years ago

Yes, this is correct and prior to submitting the bug report I compared the two versions and ruled out XCOPY itself, the problem is deeper.

At first I assumed that real MS-Dos would also not have this issue, but I have just done further testing and it seems to be consistent in 86Box with MS-Dos 7.1 when the FreeDOS XCOPY is used so I looked further. DOSBox Daum seems to lack file attrib support, which means it can not write the files as read only preventing the issue from occurring.

So the incorrect behavior is related to the FreeDOS XCOPY, but DOSBox Daum does not result in this behavior because of its lack of read only attrib support. That means the bug would either need to be fixed in XCOPY, or a mode could be added that prevents read only files from being written as read only to bypass the issue.

maron2000 commented 2 years ago

According to FreeDOS gitlab page (https://gitlab.com/FreeDOS/base/xcopy) FreeDOS XCOPY is maintained at https://github.com/FDOS/xcopy Maybe better to discuss bugs specific to FreeDOS XCOPY there.

joncampbell123 commented 1 year ago

I seem to remember that MS-DOS had always set the read-only bit for files on CD-ROM because, well, it's read only anyway. Is the game using XCOPY with a flag that says to remove the read-only bit or ignore attributes?

henk717 commented 1 year ago

I assume so, its of course a closed source setup. When I replace xcopy with the one from msdos the behavior dissapears so that has been my workaround for now. Dosbox would need either an updated xcopy that handles it correctly or a mode where like daum the read only flag is ignored when saving to disk.

Switch123456789 commented 7 months ago

I ran into the same problem today (with GTA1 and plenty of other programs), I am on arch & use ext4 filesystem. The thing that makes it quite confusing to me is that it was working fine at some point last year. If xcopy wasn't changed since 15+ years, why did it work last year then? :thinking:

Switch123456789 commented 7 months ago

Nice :) I gave the latest version a try and the file-attributes are correct now. GTA works fine as expected, thanks!