From 8c0817941e6c4bac6e17de191f3d10b0a76e8182 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Sun, 11 Nov 2018 07:55:14 -0500 Subject: [PATCH] added /c [path] use vendored conemu.xml as a default starting point if it exists --- launcher/src/CmderLauncher.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/launcher/src/CmderLauncher.cpp b/launcher/src/CmderLauncher.cpp index 37f8a81..b4f43be 100644 --- a/launcher/src/CmderLauncher.cpp +++ b/launcher/src/CmderLauncher.cpp @@ -295,7 +295,7 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr : L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/user-conemu.xml!", MB_TITLE, MB_ICONSTOP); exit(1); } - else // vendor/ConEmu.xml config exists, copy Cmder vendor/ConEmu.xml.default file to vendor/conemu-maximus5/ConEmu.xml. + else // vendor/ConEmu.xml.default config exists, copy Cmder vendor/ConEmu.xml.default file to vendor/conemu-maximus5/ConEmu.xml. { if (!CopyFile(defaultCfgPath, cfgPath, FALSE)) { @@ -308,6 +308,19 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr } } } + else if (PathFileExists(cfgPath)) // vendor/conemu-maximus5/ConEmu.xml exists, copy vendor/conemu-maximus5/ConEmu.xml to config/user_conemu.xml + { + if (!CopyFile(cfgPath, userCfgPath, FALSE)) + { + MessageBox(NULL, + (GetLastError() == ERROR_ACCESS_DENIED) + ? L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/user-conemu.xml! Access Denied." + : L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/user-conemu.xml!", MB_TITLE, MB_ICONSTOP); + exit(1); + } + + PathCombine(userConEmuCfgPath, userConfigDirPath, L"user-ConEmu.xml"); + } else // '-C [PATH]' was specified and 'vendor/ConEmu.xml.default' config exists, copy Cmder 'vendor/ConEmu.xml.default' file to '[user specified path]/config/user_ConEmu.xml'. { if ( ! CopyFile(defaultCfgPath, userCfgPath, FALSE))