X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fprocess.c;h=5bb7eb3df6da69bdc34c069ec1f9c704642b335e;hp=5d78c2954b4604fc447668470e7b72a175d4f451;hb=83fa44ce42c67837dad30ba1538bf1fa8c49a47d;hpb=9a66d7499ae2c838c25f9c6bfcc277c3fa231dea diff --git a/src/process.c b/src/process.c index 5d78c295..5bb7eb3d 100644 --- a/src/process.c +++ b/src/process.c @@ -62,12 +62,9 @@ static bool install_service(void) { return false; } - if(!strchr(program_name, '\\')) { - GetCurrentDirectory(sizeof command - 1, command + 1); - strncat(command, "\\", sizeof command - strlen(command)); - } - - strncat(command, program_name, sizeof command - strlen(command)); + HMODULE module = GetModuleHandle(NULL); + GetModuleFileName(module, command + 1, sizeof command - 1); + command[sizeof command - 1] = 0; strncat(command, "\"", sizeof command - strlen(command));