瀏覽代碼

Extra product description tags.

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.
Iain Patterson 12 年之前
父節點
當前提交
3f77c8a2c0
共有 6 個文件被更改,包括 18 次插入6 次删除
  1. 2 1
      event.cpp
  2. 二進制
      messages.mc
  3. 2 2
      nssm.cpp
  4. 12 1
      nssm.h
  5. 二進制
      nssm.rc
  6. 2 2
      nssm.vcproj

+ 2 - 1
event.cpp

@@ -1,5 +1,6 @@
 #include "nssm.h"
 
+#define NSSM_SOURCE _T("nssm")
 #define NSSM_ERROR_BUFSIZE 65535
 #define NSSM_NUM_EVENT_STRINGS 16
 unsigned long tls_index;
@@ -42,7 +43,7 @@ void log_event(unsigned short type, unsigned long id, ...) {
   TCHAR *strings[NSSM_NUM_EVENT_STRINGS];
 
   /* Open event log */
-  HANDLE handle = RegisterEventSource(0, NSSM);
+  HANDLE handle = RegisterEventSource(0, NSSM_SOURCE);
   if (! handle) return;
 
   /* Log it */

二進制
messages.mc


+ 2 - 2
nssm.cpp

@@ -35,8 +35,8 @@ void strip_basename(TCHAR *buffer) {
 
 /* How to use me correctly */
 int usage(int ret) {
-  if (GetConsoleWindow()) print_message(stderr, NSSM_MESSAGE_USAGE, NSSM_VERSION, NSSM_DATE);
-  else popup_message(0, MB_OK, NSSM_MESSAGE_USAGE, NSSM_VERSION, NSSM_DATE);
+  if (GetConsoleWindow()) print_message(stderr, NSSM_MESSAGE_USAGE, NSSM_VERSION, NSSM_CONFIGURATION, NSSM_DATE);
+  else popup_message(0, MB_OK, NSSM_MESSAGE_USAGE, NSSM_VERSION, NSSM_CONFIGURATION, NSSM_DATE);
   return(ret);
 }
 

+ 12 - 1
nssm.h

@@ -22,7 +22,18 @@ void strip_basename(TCHAR *);
 int str_number(const TCHAR *, unsigned long *);
 int usage(int);
 
-#define NSSM _T("nssm")
+#define NSSM _T("NSSM")
+#ifdef _WIN64
+#define NSSM_ARCHITECTURE _T("64-bit")
+#else
+#define NSSM_ARCHITECTURE _T("32-bit")
+#endif
+#ifdef _DEBUG
+#define NSSM_DEBUG _T(" debug")
+#else
+#define NSSM_DEBUG _T("")
+#endif
+#define NSSM_CONFIGURATION NSSM_ARCHITECTURE NSSM_DEBUG
 #include "version.h"
 
 /*

二進制
nssm.rc


+ 2 - 2
nssm.vcproj

@@ -165,7 +165,7 @@
 			/>
 			<Tool
 				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
+				PreprocessorDefinitions="_DEBUG;_WIN64"
 				Culture="2057"
 			/>
 			<Tool
@@ -353,7 +353,7 @@
 			/>
 			<Tool
 				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
+				PreprocessorDefinitions="NDEBUG;_WIN64"
 				Culture="2057"
 			/>
 			<Tool