}\r
\r
/* Get path of this program */\r
- TCHAR path[PATH_LENGTH];\r
- GetModuleFileName(0, path, _countof(path));\r
+ const TCHAR *path = nssm_imagepath();\r
\r
/* Try to register the module but don't worry so much on failure */\r
RegSetValueEx(key, _T("EventMessageFile"), 0, REG_SZ, (const unsigned char *) path, (unsigned long) (_tcslen(path) + 1) * sizeof(TCHAR));\r