Browse Source

Rudimentary file versioning.

Embed file version info in the resource file so that right-clicking the
executable shows the application version.

Unfortunately the version field must be formatted in a particular way so
we can't reuse the NSSM_VERSION #define from nssm.h but instead must
create a new #define and remember to update it when making a release.

Thanks fREW Schmidt.
Iain Patterson 8 years ago
parent
commit
cb641f9b0c
2 changed files with 28 additions and 0 deletions
  1. 1 0
      nssm.h
  2. 27 0
      nssm.rc

+ 1 - 0
nssm.h

@@ -18,6 +18,7 @@ int str_equiv(const char *, const char *);
 
 #define NSSM "nssm"
 #define NSSM_VERSION "2.16"
+#define NSSM_VERSIONINFO 2,16,0,0
 #define NSSM_DATE "2012-12-01"
 
 /*

+ 27 - 0
nssm.rc

@@ -1,5 +1,6 @@
 // Microsoft Visual C++ generated resource script.
 //
+#include "nssm.h"
 #include "resource.h"
 
 #define APSTUDIO_READONLY_SYMBOLS
@@ -110,6 +111,32 @@ BEGIN
 END
 #endif    // APSTUDIO_INVOKED
 
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION NSSM_VERSIONINFO
+ PRODUCTVERSION NSSM_VERSIONINFO
+ FILEFLAGSMASK 0x17L
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+    END
+END
+
 #endif    // English (U.K.) resources
 /////////////////////////////////////////////////////////////////////////////