This commit is contained in:
Federico Terzi 2019-09-16 16:39:22 +02:00
parent 08ec57113d
commit d9890acb42

View File

@ -568,12 +568,16 @@ int32_t start_daemon_process() {
wchar_t cmd[MAX_PATH];
swprintf(cmd, MAX_PATH, L"espanso.exe daemon");
// Get current espanso directory
TCHAR espansoFilePath[MAX_PATH];
GetModuleFileName(NULL, espansoFilePath, MAX_PATH);
STARTUPINFO si = { sizeof(si) };
PROCESS_INFORMATION pi;
// Documentation: https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessw
BOOL res = CreateProcess(
L"./espanso.exe",
espansoFilePath,
cmd,
NULL,
NULL,