saramibreak / DiscImageCreator

This is the disc (CD, GD, DVD, HD-DVD, BD, GC/Wii, XBOX, XBOX 360) and disk (Floppy, MO, USB etc) image creation tool
http://forum.redump.org/topic/10483/discimagecreator/
Apache License 2.0
530 stars 45 forks source link

[Q] change the default path of the driveOffset.txt file on linux. how? #160

Closed sl1pkn07 closed 1 year ago

sl1pkn07 commented 1 year ago

Hi

i want to change the default path of the file driveOffset.txt. in linux, wich is seems need to store in /usr/local/share/DiscImageCreator instead of /usr/share/DiscImageCreator where i have installed the data program

searching in the code, only i can found the path in here for the file default.dat:

https://github.com/saramibreak/DiscImageCreator/blob/bb05d981dbb3a39dd583d03a429a06e7a8c871c2/DiscImageCreator/xml.cpp#L604-L608

but i cant found for the file driveOffset.txt (this can be applicable to ReadErrorProtect.txt and C2ErrorProtect.txt files)

any help?

greetings

saramibreak commented 1 year ago

DiscImageCreator_test.tar.gz

added this code.

#ifdef _WIN32
    fpDrive = OpenProgrammabledFile(_T("driveOffset.txt"), _T("r"));
#else
    if (PathFileExists("/usr/local/share/DiscImageCreator/driveOffset.txt")) {
        fpDrive = _tfopen(_T("/usr/local/share/DiscImageCreator/driveOffset.txt"), _T("r"));
    }
    else if (PathFileExists("/usr/share/DiscImageCreator/driveOffset.txt")) {
        fpDrive = _tfopen(_T("/usr/share/DiscImageCreator/driveOffset.txt"), _T("r"));
    }
    else {
        fpDrive = OpenProgrammabledFile(_T("driveOffset.txt"), _T("r"));
    }
#endif
saramibreak commented 1 year ago

@sl1pkn07 Is this working as you expected?

sl1pkn07 commented 1 year ago

sorry the delay. yes, working. is possible add to upstream?

greetings

saramibreak commented 1 year ago

DiscImageCreator_test.tar.gz Also added ReadErrorProtect.txt and C2ErrorProtect.txt