X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=registry.cpp;fp=registry.cpp;h=5a4c6522fc49938495a701c6d58642c834bf2d7a;hb=fb96938cf944edf3bc0dfd99dbff416b0397df4f;hp=de3127fc9ca8428699430d4d4eacd222683d74d5;hpb=4c25687ee744780127150e22640df47931d139a9;p=nssm.git diff --git a/registry.cpp b/registry.cpp index de3127f..5a4c652 100644 --- a/registry.cpp +++ b/registry.cpp @@ -17,8 +17,7 @@ int create_messages() { } /* Get path of this program */ - TCHAR path[PATH_LENGTH]; - GetModuleFileName(0, path, _countof(path)); + const TCHAR *path = nssm_imagepath(); /* Try to register the module but don't worry so much on failure */ RegSetValueEx(key, _T("EventMessageFile"), 0, REG_SZ, (const unsigned char *) path, (unsigned long) (_tcslen(path) + 1) * sizeof(TCHAR));