mirror of
https://github.com/cmderdev/cmder.git
synced 2024-11-10 17:59:11 +08:00
fix
This commit is contained in:
parent
19fe75cbbe
commit
7db6297347
@ -624,7 +624,7 @@ void RegisterShellMenu(std::wstring opt, wchar_t* keyBaseName, std::wstring cfgR
|
|||||||
|
|
||||||
wchar_t commandStr[MAX_PATH + 20] = { 0 };
|
wchar_t commandStr[MAX_PATH + 20] = { 0 };
|
||||||
wchar_t baseCommandStr[MAX_PATH + 20] = { 0 };
|
wchar_t baseCommandStr[MAX_PATH + 20] = { 0 };
|
||||||
if (single && !PathFileExists(windowsTerminalDir)) {
|
if (single) {
|
||||||
swprintf_s(baseCommandStr, L"\"%s\" /single", exePath);
|
swprintf_s(baseCommandStr, L"\"%s\" /single", exePath);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -700,6 +700,9 @@ cmderOptions GetOption()
|
|||||||
LPWSTR *szArgList;
|
LPWSTR *szArgList;
|
||||||
int argCount;
|
int argCount;
|
||||||
|
|
||||||
|
wchar_t windowsTerminalDir[MAX_PATH] = { 0 };
|
||||||
|
PathCombine(windowsTerminalDir, exeDir, L"vendor\\windows-terminal");
|
||||||
|
|
||||||
szArgList = CommandLineToArgvW(GetCommandLine(), &argCount);
|
szArgList = CommandLineToArgvW(GetCommandLine(), &argCount);
|
||||||
|
|
||||||
for (int i = 1; i < argCount; i++)
|
for (int i = 1; i < argCount; i++)
|
||||||
@ -859,12 +862,24 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
|
|||||||
|
|
||||||
cmderOptions cmderOptions = GetOption();
|
cmderOptions cmderOptions = GetOption();
|
||||||
|
|
||||||
|
wchar_t windowsTerminalDir[MAX_PATH] = { 0 };
|
||||||
|
PathCombine(windowsTerminalDir, exeDir, L"vendor\\windows-terminal");
|
||||||
|
|
||||||
if (cmderOptions.registerApp == true)
|
if (cmderOptions.registerApp == true)
|
||||||
{
|
{
|
||||||
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_PATH_BACKGROUND, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle);
|
if (PathFileExists(windowsTerminalDir) {
|
||||||
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_PATH_LISTITEM, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle);
|
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_PATH_BACKGROUND, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle);
|
||||||
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_DRIVE_PATH_BACKGROUND, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle);
|
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_PATH_LISTITEM, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle);
|
||||||
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_DRIVE_PATH_LISTITEM, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle);
|
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_DRIVE_PATH_BACKGROUND, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle);
|
||||||
|
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_DRIVE_PATH_LISTITEM, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle);
|
||||||
|
{
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_PATH_BACKGROUND, cmderOptions.cmderCfgRoot, false);
|
||||||
|
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_PATH_LISTITEM, cmderOptions.cmderCfgRoot, false);
|
||||||
|
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_DRIVE_PATH_BACKGROUND, cmderOptions.cmderCfgRoot, false);
|
||||||
|
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_DRIVE_PATH_LISTITEM, cmderOptions.cmderCfgRoot, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (cmderOptions.unRegisterApp == true)
|
else if (cmderOptions.unRegisterApp == true)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user