Call ourselves NSSM not nssm. Add 32/64-bit and release/debug specifiers.
Since we are adding them to the resource files as well we need to add the
_WIN64 preprocessor definition to the resources definition list explicitly.
To ensure that messages sent to the event log remain consistent we
define the event source separately and set it to the old lowercase name.
#include "nssm.h"\r
\r
+#define NSSM_SOURCE _T("nssm")\r
#define NSSM_ERROR_BUFSIZE 65535\r
#define NSSM_NUM_EVENT_STRINGS 16\r
unsigned long tls_index;\r
TCHAR *strings[NSSM_NUM_EVENT_STRINGS];\r
\r
/* Open event log */\r
- HANDLE handle = RegisterEventSource(0, NSSM);\r
+ HANDLE handle = RegisterEventSource(0, NSSM_SOURCE);\r
if (! handle) return;\r
\r
/* Log it */\r
\r
/* How to use me correctly */\r
int usage(int ret) {\r
- if (GetConsoleWindow()) print_message(stderr, NSSM_MESSAGE_USAGE, NSSM_VERSION, NSSM_DATE);\r
- else popup_message(0, MB_OK, NSSM_MESSAGE_USAGE, NSSM_VERSION, NSSM_DATE);\r
+ if (GetConsoleWindow()) print_message(stderr, NSSM_MESSAGE_USAGE, NSSM_VERSION, NSSM_CONFIGURATION, NSSM_DATE);\r
+ else popup_message(0, MB_OK, NSSM_MESSAGE_USAGE, NSSM_VERSION, NSSM_CONFIGURATION, NSSM_DATE);\r
return(ret);\r
}\r
\r
int str_number(const TCHAR *, unsigned long *);\r
int usage(int);\r
\r
-#define NSSM _T("nssm")\r
+#define NSSM _T("NSSM")\r
+#ifdef _WIN64\r
+#define NSSM_ARCHITECTURE _T("64-bit")\r
+#else\r
+#define NSSM_ARCHITECTURE _T("32-bit")\r
+#endif\r
+#ifdef _DEBUG\r
+#define NSSM_DEBUG _T(" debug")\r
+#else\r
+#define NSSM_DEBUG _T("")\r
+#endif\r
+#define NSSM_CONFIGURATION NSSM_ARCHITECTURE NSSM_DEBUG\r
#include "version.h"\r
\r
/*\r
/>\r
<Tool\r
Name="VCResourceCompilerTool"\r
- PreprocessorDefinitions="_DEBUG"\r
+ PreprocessorDefinitions="_DEBUG;_WIN64"\r
Culture="2057"\r
/>\r
<Tool\r
/>\r
<Tool\r
Name="VCResourceCompilerTool"\r
- PreprocessorDefinitions="NDEBUG"\r
+ PreprocessorDefinitions="NDEBUG;_WIN64"\r
Culture="2057"\r
/>\r
<Tool\r