From 3f77c8a2c04c269f7e293a0cec517cb9cb8c5d49 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Wed, 1 Jan 2014 22:07:11 +0000 Subject: [PATCH] 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. --- event.cpp | 3 ++- messages.mc | Bin 120346 -> 120364 bytes nssm.cpp | 4 ++-- nssm.h | 13 ++++++++++++- nssm.rc | Bin 32152 -> 32194 bytes nssm.vcproj | 4 ++-- 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/event.cpp b/event.cpp index a409b11..0bf8960 100644 --- a/event.cpp +++ b/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 */ diff --git a/messages.mc b/messages.mc index b67d79bfd77c8e85ccd182d508367ee1b03e4a35..e510a5df18515fc89411aa5632c604d2740e046c 100644 GIT binary patch delta 32 ocmbQWhJDQ%_6?U9CkqLPY<|Fag>CaXjx6?OA%X2e0*oBT0M-f%jsO4v delta 32 qcmV+*0N?+ttOuH`2e8rsv)BRR2D88jWCxSj0S<#W5VtrG0rbV}@(qXp diff --git a/nssm.cpp b/nssm.cpp index 792b62b..32f1142 100644 --- a/nssm.cpp +++ b/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); } diff --git a/nssm.h b/nssm.h index b83844a..784bd55 100644 --- a/nssm.h +++ b/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" /* diff --git a/nssm.rc b/nssm.rc index b620e5e217d556750929a48a323032c2000b75a9..730cb8d14e2122b2ee4a51970b41dec22b72bac4 100644 GIT binary patch delta 70 zcmbR7oAJ2}P=+7|M~0BeciE*U NKVTKxyo&u@DF8;M5eonS delta 38 tcmX@~n{mc(#tkLx+)50748cI?%b+xQA&2PX2drX~BiQ*iKVpAS3IO`+4Bh|$ diff --git a/nssm.vcproj b/nssm.vcproj index 324e28f..6714202 100755 --- a/nssm.vcproj +++ b/nssm.vcproj @@ -165,7 +165,7 @@ />