Skip to content

Commit 1640e9c

Browse files
committed
fixes'
2 parents ce62db6 + ddbfd1d commit 1640e9c

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

launcher/src/CmderLauncher.cpp

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
207207
PathCombine(cfgPath, exeDir, L"vendor\\conemu-maximus5\\ConEmu.xml");
208208

209209
// Set path to Cmder default ConEmu config file
210-
PathCombine(defaultCfgPath, exeDir, L"config\\vendor\\ConEmu.xml.default");
210+
PathCombine(defaultCfgPath, exeDir, L"vendor\\ConEmu.xml.default");
211211

212212
// Check for machine-specific then user config source file.
213213
PathCombine(cpuCfgPath, userConfigDirPath, L"ConEmu-%COMPUTERNAME%.xml");
@@ -216,75 +216,76 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
216216
// Set path to Cmder user ConEmu config file
217217
PathCombine(userCfgPath, userConfigDirPath, L"user-ConEmu.xml");
218218

219-
if (PathFileExists(cpuCfgPath)) // If machine-specific ConEmu config file exists - use it.
219+
if (PathFileExists(cpuCfgPath)) // config/ConEmu-%COMPUTERNAME%.xml file exists, use it.
220220
{
221-
if (PathFileExists(cfgPath)) // If vendor ConEmu config file exists - back it up to config/ConEmu-%COMPUTERNAME%.xml.
221+
if (PathFileExists(cfgPath)) // vendor/conemu-maximus5/ConEmu.xml file exists, copy vendor/conemu-maximus5/ConEmu.xml to config/ConEmu-%COMPUTERNAME%.xml.
222222
{
223223
if (!CopyFile(cfgPath, cpuCfgPath, FALSE))
224224
{
225225
MessageBox(NULL,
226226
(GetLastError() == ERROR_ACCESS_DENIED)
227-
? L"Failed to copy ConEmu.xml file to ConEmu-%COMPUTERNAME%.xml backup location! Restart Cmder as Administrator."
228-
: L"Failed to copy ConEmu.xml file to ConEmu-%COMPUTERNAME%.xml backup location!", MB_TITLE, MB_ICONSTOP);
227+
? L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/ConEmu-%COMPUTERNAME%.xml! Access Denied."
228+
: L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/ConEmu-%COMPUTERNAME%.xml!", MB_TITLE, MB_ICONSTOP);
229229
exit(1);
230230
}
231231
}
232-
else // If vendor ConEmu config file does not exists - Copy machine-specific config/ConEmu-%COMPUTERNAME%.xml to vendor ConEmu.xml file
232+
else // vendor/conemu-maximus5/ConEmu.xml config file does not exist, copy config/ConEmu-%COMPUTERNAME%.xml to vendor/conemu-maximus5/ConEmu.xml file
233233
{
234234
if (!CopyFile(cpuCfgPath, cfgPath, FALSE))
235235
{
236236
MessageBox(NULL,
237237
(GetLastError() == ERROR_ACCESS_DENIED)
238-
? L"Failed to copy ConEmu-%COMPUTERNAME%.xml file to vendored ConEmu.xml location! Restart Cmder as Administrator."
239-
: L"Failed to copy ConEmu-%COMPUTERNAME%.xml file to vendored ConEmu.xml location!", MB_TITLE, MB_ICONSTOP);
238+
? L"Failed to copy conig/ConEmu-%COMPUTERNAME%.xml file to vendor/conemu-maximus5/ConEmu.xml! Access Denied."
239+
: L"Failed to copy config/ConEmu-%COMPUTERNAME%.xml file to vendor/conemu-maximus5/ConEmu.xml!", MB_TITLE, MB_ICONSTOP);
240240
exit(1);
241241
}
242242
}
243243
}
244-
else if (PathFileExists(userCfgPath)) // If config/user_conemu.xml exists use it.
244+
else if (PathFileExists(userCfgPath)) // config/user_conemu.xml exists, use it.
245245
{
246-
if (PathFileExists(cfgPath)) // If vendor conemu.xml exits back it up to config/user_conemu.xml.
246+
if (PathFileExists(cfgPath)) // vendor/conemu-maximus5/ConEmu.xml exists, copy vendor/conemu-maximus5/ConEmu.xml to config/user_conemu.xml.
247247
{
248248
if (!CopyFile(cfgPath, userCfgPath, FALSE))
249249
{
250250
MessageBox(NULL,
251251
(GetLastError() == ERROR_ACCESS_DENIED)
252-
? L"Failed to copy ConEmu.xml file to backup location! Restart Cmder as Administrator."
253-
: L"Failed to copy ConEmu.xml file to backup location!", MB_TITLE, MB_ICONSTOP);
252+
? L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/user-conemu.xml! Access Denied."
253+
: L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/user-conemu.xml!", MB_TITLE, MB_ICONSTOP);
254254
exit(1);
255255
}
256256
}
257-
else // If vendor conemu.xml does not exist copy user_conemu.xml to vendor conemu.xml
257+
else // vendor/conemu-maximus5/ConEmu.xml does not exist, copy config/user-conemu.xml to vendor/conemu-maximus5/ConEmu.xml
258258
{
259259
if (!CopyFile(userCfgPath, cfgPath, FALSE))
260260
{
261261
MessageBox(NULL,
262262
(GetLastError() == ERROR_ACCESS_DENIED)
263-
? L"Failed to copy ConEmu.xml file to vendored ConEmu.xml location! Restart Cmder as Administrator."
264-
: L"Failed to copy ConEmu.xml file to vendored ConEmu.xml location!", MB_TITLE, MB_ICONSTOP);
263+
? L"Failed to copy config/user-conemu.xml file to vendor/conemu-maximus5/ConEmu.xml! Access Denied."
264+
: L"Failed to copy config/user-conemu.xml file to vendor/conemu-maximus5/ConEmu.xml!", MB_TITLE, MB_ICONSTOP);
265265
exit(1);
266266
}
267267
}
268268
}
269-
else if (PathFileExists(cfgPath)) // If vendor conemu.xml exists copy config/user_conemu.xml
269+
else if (PathFileExists(cfgPath)) // vendor/conemu-maximus5/ConEmu.xml exists, copy vendor/conemu-maximus5/ConEmu.xml to config/user_conemu.xml
270270
{
271271
if (!CopyFile(cfgPath, userCfgPath, FALSE))
272272
{
273273
MessageBox(NULL,
274274
(GetLastError() == ERROR_ACCESS_DENIED)
275-
? L"Failed to copy ConEmu.xml file to user-conemu.xml backup location! Restart Cmder as Administrator."
276-
: L"Failed to copy ConEmu.xml file to user-conemu.xml backup location!", MB_TITLE, MB_ICONSTOP);
275+
? L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/user-conemu.xml! Access Denied."
276+
: L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/user-conemu.xml!", MB_TITLE, MB_ICONSTOP);
277277
exit(1);
278278
}
279279
}
280-
else // No previous conemu.xml config exists use the default.
280+
else // vendor/ConEmu.xml config exists, copy Cmder vendor/ConEmu.xml file to vendor/conemu-maximus5/ConEmu.xml.
281281
{
282-
if (!CopyFile(defaultCfgPath, cfgPath, FALSE))
282+
if ( ! CopyFile(defaultCfgPath, cfgPath, FALSE))
283283
{
284+
ShowErrorAndExit(GetLastError(), __WFUNCTION__, __LINE__);
284285
MessageBox(NULL,
285286
(GetLastError() == ERROR_ACCESS_DENIED)
286-
? L"Failed to copy Cmder default ConEmu.xml file to vendored ConEmu.xml location! Restart Cmder as Administrator."
287-
: L"Failed to copy Cmder default ConEmu.xml file to vendored ConEmu.xml location!", MB_TITLE, MB_ICONSTOP);
287+
? L"Failed to copy vendor/ConEmu.xml.default file to vendor/conemu-maximus5/ConEmu.xml! Access Denied."
288+
: L"Failed to copy vendor/ConEmu.xml.default file to vendor/conemu-maximus5/ConEmu.xml!", MB_TITLE, MB_ICONSTOP);
288289
exit(1);
289290
}
290291
}
@@ -459,7 +460,6 @@ cmderOptions GetOption()
459460
{
460461

461462
// MessageBox(NULL, szArgList[i], L"Arglist contents", MB_OK);
462-
463463
if (_wcsicmp(L"/c", szArgList[i]) == 0)
464464
{
465465
TCHAR userProfile[MAX_PATH];

0 commit comments

Comments
 (0)