1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-06 00:13:33 +00:00

1. Adding missing definition for MNG_KVM_KEY_UNICODE

2. Updated Windows Unicode KeyPress
3. Fixed bug with self update that causes update to fail for older service installations
This commit is contained in:
Bryan Roe
2020-11-17 23:47:29 -08:00
parent ea3a6af192
commit 2fc2206eb9
5 changed files with 6 additions and 8 deletions

View File

@@ -307,12 +307,12 @@ char* crashMemory = ILib_POSIX_InstallCrashHandler(argv[0]);
if (argv[1][8] == '*')
{
// New Style
integratedJavaScriptLen = sprintf_s(integratedJavaScript, 1024, "require('agent-installer').update(false, '%s');", argc > 1 ? argv[2] : "null");
integratedJavaScriptLen = sprintf_s(integratedJavaScript, 1024, "require('agent-installer').update(false, '%s');", argc > 2 ? argv[2] : "null");
}
else
{
// Legacy
integratedJavaScriptLen = sprintf_s(integratedJavaScript, 1024, "require('agent-installer').update(false, ['%s']);", argv[2]);
integratedJavaScriptLen = sprintf_s(integratedJavaScript, 1024, "require('agent-installer').update(false, ['%s']);", argc > 2 ? argv[2] : "");
}
}
}

View File

@@ -381,9 +381,7 @@ void KeyActionUnicode(WORD unicode, int up)
key.type = INPUT_KEYBOARD;
key.ki.wVk = 0;
key.ki.dwFlags = KEYEVENTF_UNICODE;
if (up == 1) key.ki.dwFlags = KEYEVENTF_KEYUP; // 1 = UP
else if (up == 3) key.ki.dwFlags = KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP; // 3 = EXUP
else if (up == 4) key.ki.dwFlags = KEYEVENTF_EXTENDEDKEY; // 4 = EXDOWN
if (up == 1) key.ki.dwFlags |= KEYEVENTF_KEYUP; // 1 = UP
key.ki.time = 0;
key.ki.wScan = unicode;
key.ki.dwExtraInfo = GetMessageExtraInfo();

View File

@@ -5612,7 +5612,7 @@ int MeshAgent_Start(MeshAgentHostContainer *agentHost, int paramLen, char **para
}
else
{
sprintf_s(ILibScratchPad, sizeof(ILibScratchPad), "%s -update:*%s %s", updateFilePath, agentHost->JSRunningAsService != 0 ? "S" : "C", startParms == NULL ? "" : (char*)ILibMemory_Extra(startParms));
sprintf_s(ILibScratchPad, sizeof(ILibScratchPad), "%s -update:*%s %s", updateFilePath, agentHost->JSRunningAsService != 0 ? "S" : "C", startParms == NULL ? "W10=" : (char*)ILibMemory_Extra(startParms));
}
if (agentHost->logUpdate != 0) { ILIBLOGMESSAGEX("SelfUpdate[%d] -> CreateProcessW() with parameters: %s", agentHost->updaterVersion, ILibScratchPad); }
if (!CreateProcessW(NULL, ILibUTF8ToWide(ILibScratchPad, -1), NULL, NULL, TRUE, CREATE_NO_WINDOW, NULL, NULL, &info, &processInfo))

View File

@@ -25,7 +25,7 @@ typedef enum RemoteManagementCommands
{
MNG_KVM_NOP = 0,
MNG_KVM_KEY = 1,
MNG_KVM_KEY_WITHLAYOUT = 85,
MNG_KVM_KEY_UNICODE = 85,
MNG_KVM_MOUSE = 2,
MNG_KVM_MOUSE_CURSOR = 88,
MNG_KVM_MOUSE_MOVE = 89,

View File

@@ -719,7 +719,7 @@ int wmain(int argc, char* wargv[])
if (argv[1][8] == '*')
{
// New Style
updateLen = sprintf_s(update, 1024, "require('agent-installer').update(%s, '%s');", argv[1][9] == 'S' ? "true" : "false", argc > 1 ? argv[2] : "null");
updateLen = sprintf_s(update, 1024, "require('agent-installer').update(%s, '%s');", argv[1][9] == 'S' ? "true" : "false", argc > 2 ? argv[2] : "null");
}
else
{