1818#define DEV7_MUTEX_LAUNCH " /tmp/DEV7_INSTANCE_MUTEX"
1919#endif
2020
21+ namespace fs = std::filesystem;
22+
2123bool fileExists (const std::string& filename) {
2224#ifdef _WIN32
2325 return _access (filename.c_str (), 0 ) == 0 ;
@@ -119,7 +121,7 @@ void showTraceTXT() {
119121void modifyAdibou3Ini () {
120122
121123 // Check if Adibou3.ini exists
122- if (!std::filesystem ::exists (" Adibou3.ini" )) {
124+ if (!fs ::exists (" Adibou3.ini" )) {
123125 std::cout << " Error: This directory does not seem to be an Adibou 3 game directory.\n " << std::endl;
124126 std::cout << " Press Enter to exit DEV7Launcher" << std::endl;
125127 getchar ();
@@ -131,12 +133,12 @@ void modifyAdibou3Ini() {
131133 // WORKAROUND: rename ADIBOU3.INI to Adibou3.ini so it will be read by the Editors as Adibou3.ini to avoid problems being loaded.
132134
133135#ifdef _WIN32
134- if (!std::filesystem ::exists (" Adibou3.ini" )) {
136+ if (!fs ::exists (" Adibou3.ini" )) {
135137 system (" ren ADIBOU3.INI Adibou3.ini" );
136138 }
137139 system (" notepad Adibou3.ini" );
138140#else
139- if (!std::filesystem ::exists (" Adibou3.ini" )) {
141+ if (!fs ::exists (" Adibou3.ini" )) {
140142 int move_adibou3 = system (" mv ADIBOU3.INI Adibou3.ini" );
141143 }
142144 int nano_adibou3 = system (" nano Adibou3.ini" );
@@ -146,7 +148,7 @@ void modifyAdibou3Ini() {
146148void modifyAdi5Ini () {
147149
148150 // Check if Data/ADI5.ini exists
149- if (!std::filesystem ::exists (" Data/ADI5.ini" )) {
151+ if (!fs ::exists (" Data/ADI5.ini" )) {
150152 std::cout << " Error: This directory does not seem to be an Adi 5 game directory.\n " << std::endl;
151153 std::cout << " Press Enter to exit DEV7Launcher" << std::endl;
152154 getchar ();
@@ -166,9 +168,9 @@ void openLicenceFile() {
166168 std::string licenseFile = " Lizenzvereinbarung.txt" ;
167169 std::string warrantyFile = " garantie.txt" ;
168170 std::string lisezMoiFile = " LISEZ MOI.txt" ;
169- bool foundLicense = std::filesystem ::exists (licenseFile);
170- bool foundWarranty = std::filesystem ::exists (warrantyFile);
171- bool foundLisezMoi = std::filesystem ::exists (lisezMoiFile);
171+ bool foundLicense = fs ::exists (licenseFile);
172+ bool foundWarranty = fs ::exists (warrantyFile);
173+ bool foundLisezMoi = fs ::exists (lisezMoiFile);
172174
173175 if (foundLicense || foundWarranty || foundLisezMoi) {
174176 std::string filename;
@@ -214,7 +216,7 @@ void Ed4Intro() {
214216 std::string Ed4IntroEXE = " Ed4Intro.exe" ;
215217
216218 // Check if Ed4Intro.exe exists
217- if (!std::filesystem ::exists (" Ed4Intro.exe" )) {
219+ if (!fs ::exists (" Ed4Intro.exe" )) {
218220 std::cout << " Error: This directory does not seem to be an Le Pays des pierres magiques game directory.\n " << std::endl;
219221 return ;
220222 }
@@ -427,4 +429,4 @@ if (restartChoice == 'n' || restartChoice == 'N') {
427429
428430return 0 ;
429431
430- }
432+ } // End of namespace fs
0 commit comments