You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (wcscmp(cpuCfgPath, L"") == 0 && (PathFileExists(cpuCfgPath) || use_user_cfg == false))// config/ConEmu-%COMPUTERNAME%.xml file exists or /m was specified on command line, use machine specific config.
303
+
if (PathFileExists(cpuCfgPath) || use_user_cfg == false )// config/[cpu specific terminal emulator config] file exists or /m was specified on command line, use machine specific config.
304
304
{
305
305
if (cfgRoot.length() == 0) // '/c [path]' was NOT specified
306
306
{
307
-
if (!CopyFile(cfgPath, cpuCfgPath, FALSE))
307
+
if (PathFileExists(cfgPath)) // [terminal emulator config] file exists, copy [terminal emulator config] to config/user_[terminal emulator config] file to backup any settings changes from previous sessions.
308
308
{
309
-
if (PathFileExists(windowsTerminalDir)) {
310
-
MessageBox(NULL,
311
-
(GetLastError() == ERROR_ACCESS_DENIED)
312
-
? L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/windows_terminal_%COMPUTERNAME%_settings.json! Access Denied."
313
-
: L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/windows_teerminal_%COMPUTERNAME%_settigns.json!", MB_TITLE, MB_ICONSTOP);
314
-
exit(1);
315
-
}
316
-
elseif (PathFileExists(conEmuDir))
309
+
if (!CopyFile(cfgPath, cpuCfgPath, FALSE))
317
310
{
318
-
MessageBox(NULL,
319
-
(GetLastError() == ERROR_ACCESS_DENIED)
320
-
? L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/ConEmu-%COMPUTERNAME%.xml! Access Denied."
321
-
: L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/ConEmu-%COMPUTERNAME%.xml!", MB_TITLE, MB_ICONSTOP);
322
-
exit(1);
311
+
if (PathFileExists(windowsTerminalDir)) {
312
+
MessageBox(NULL,
313
+
(GetLastError() == ERROR_ACCESS_DENIED)
314
+
? L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/windows_terminal_%COMPUTERNAME%_settings.json! Access Denied."
315
+
: L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/windows_teerminal_%COMPUTERNAME%_settigns.json!", MB_TITLE, MB_ICONSTOP);
316
+
exit(1);
317
+
}
318
+
elseif (PathFileExists(conEmuDir))
319
+
{
320
+
MessageBox(NULL,
321
+
(GetLastError() == ERROR_ACCESS_DENIED)
322
+
? L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/ConEmu-%COMPUTERNAME%.xml! Access Denied."
323
+
: L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/ConEmu-%COMPUTERNAME%.xml!", MB_TITLE, MB_ICONSTOP);
324
+
exit(1);
325
+
}
323
326
}
324
327
}
325
-
}
326
-
else// vendor/conemu-maximus5/ConEmu.xml config file does not exist, copy config/ConEmu-%COMPUTERNAME%.xml to vendor/conemu-maximus5/ConEmu.xml file
327
-
{
328
-
if (!CopyFile(cpuCfgPath, cfgPath, FALSE))
328
+
else// [terminal emulator config] file does not exist, copy config/[cpu specific terminal emulator config] file to [terminal emulator config] file
329
329
{
330
-
if (PathFileExists(windowsTerminalDir))
330
+
if (!CopyFile(cpuCfgPath, cfgPath, FALSE))
331
331
{
332
-
MessageBox(NULL,
333
-
(GetLastError() == ERROR_ACCESS_DENIED)
334
-
? L"Failed to copy config/windows_terminal_%COMPUTERNAME%_settings.json file to vendor/windows-terminal/settings/settings.json! Access Denied."
335
-
: L"Failed to copy config/windows_terminal_%COMPUTERNAME%_settings.json file to vendor/windows-terminal/settings/settings.json!", MB_TITLE, MB_ICONSTOP);
336
-
exit(1);
337
-
}
338
-
elseif (PathFileExists(conEmuDir))
339
-
{
340
-
MessageBox(NULL,
341
-
(GetLastError() == ERROR_ACCESS_DENIED)
342
-
? L"Failed to copy config/ConEmu-%COMPUTERNAME%.xml file to vendor/conemu-maximus5/ConEmu.xml! Access Denied."
343
-
: L"Failed to copy config/ConEmu-%COMPUTERNAME%.xml file to vendor/conemu-maximus5/ConEmu.xml!", MB_TITLE, MB_ICONSTOP);
344
-
exit(1);
332
+
if (PathFileExists(windowsTerminalDir)) {
333
+
MessageBox(NULL,
334
+
(GetLastError() == ERROR_ACCESS_DENIED)
335
+
? L"Failed to copy config/windows_terminal_%COMPUTERNAME%_settings.json file to vendor/windows-terminal/settings/settings.json! Access Denied."
336
+
: L"Failed to copy config/windows_terminal_%COMPUTERNAME%_settings.json file to vendor/windows-terminal/settings/settings.json!", MB_TITLE, MB_ICONSTOP);
337
+
exit(1);
338
+
}
339
+
elseif (PathFileExists(conEmuDir))
340
+
{
341
+
MessageBox(NULL,
342
+
(GetLastError() == ERROR_ACCESS_DENIED)
343
+
? L"Failed to copy config/ConEmu-%COMPUTERNAME%.xml file to vendor/conemu-maximus5/ConEmu.xml! Access Denied."
344
+
: L"Failed to copy config/ConEmu-%COMPUTERNAME%.xml file to vendor/conemu-maximus5/ConEmu.xml!", MB_TITLE, MB_ICONSTOP);
345
+
exit(1);
346
+
}
345
347
}
346
348
}
347
349
}
348
350
}
349
-
elseif (wcscmp(userCfgPath, L"") == 0 && PathFileExists(userCfgPath)) // config/user_conemu.xml exists, use it.
351
+
elseif (PathFileExists(userCfgPath)) // config/user[terminal emulator config] file exists, use it.
350
352
{
351
353
if (cfgRoot.length() == 0) // '/c [path]' was NOT specified
352
354
{
353
-
if (PathFileExists(cfgPath)) //vendor/conemu-maximus5/ConEmu.xml exists, copy vendor/conemu-maximus5/ConEmu.xml to config/user_conemu.xml.
355
+
if (PathFileExists(cfgPath)) //[terminal emulator config] file exists, copy [terminal emulator config] to config/user_[terminal emulator config] file to backup any settings changes from previous sessions.
elseif (PathFileExists(cfgPath)) //This is a first time Cmder.exe run and [terminal emulator config] file exists, copy [terminal emulator config] file to config/user_[terminal emulator config] file.
0 commit comments