Extra product description tags.
authorIain Patterson <me@iain.cx>
Wed, 1 Jan 2014 22:07:11 +0000 (22:07 +0000)
committerIain Patterson <me@iain.cx>
Wed, 1 Jan 2014 23:40:07 +0000 (23:40 +0000)
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.

event.cpp
messages.mc
nssm.cpp
nssm.h
nssm.rc
nssm.vcproj

index a409b11..0bf8960 100644 (file)
--- a/event.cpp
+++ b/event.cpp
@@ -1,5 +1,6 @@
 #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
@@ -42,7 +43,7 @@ void log_event(unsigned short type, unsigned long id, ...) {
   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
index b67d79b..e510a5d 100644 (file)
Binary files a/messages.mc and b/messages.mc differ
index 792b62b..32f1142 100644 (file)
--- a/nssm.cpp
+++ b/nssm.cpp
@@ -35,8 +35,8 @@ void strip_basename(TCHAR *buffer) {
 \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
diff --git a/nssm.h b/nssm.h
index b83844a..784bd55 100644 (file)
--- a/nssm.h
+++ b/nssm.h
@@ -22,7 +22,18 @@ void strip_basename(TCHAR *);
 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
diff --git a/nssm.rc b/nssm.rc
index b620e5e..730cb8d 100644 (file)
Binary files a/nssm.rc and b/nssm.rc differ
index 324e28f..6714202 100755 (executable)
                        />\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