Browse Source

More detailed file properties.

Add build information, comments and copyright to the executable's
version info fields.
Iain Patterson 8 years ago
parent
commit
2dcea1bd8f
2 changed files with 33 additions and 66 deletions
  1. 18 65
      nssm.rc
  2. 15 1
      version.cmd

+ 18 - 65
nssm.rc

@@ -262,23 +262,33 @@ END
 //
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION NSSM_VERSIONINFO
- PRODUCTVERSION NSSM_VERSIONINFO
- FILEFLAGSMASK 0x17L
+    FILEVERSION NSSM_VERSIONINFO
+    PRODUCTVERSION NSSM_VERSIONINFO
+    FILEFLAGSMASK VS_FF_DEBUG | VS_FF_PRERELEASE
 #ifdef _DEBUG
- FILEFLAGS 0x1L
+    FILEFLAGS NSSM_FILEFLAGS | VS_FF_DEBUG
 #else
- FILEFLAGS 0x0L
+    FILEFLAGS NSSM_FILEFLAGS
 #endif
- FILEOS 0x4L
- FILETYPE 0x1L
- FILESUBTYPE 0x0L
+    FILEOS VOS__WINDOWS32
+    FILETYPE VFT_APP
+    FILESUBTYPE 0x0L
 BEGIN
     BLOCK "StringFileInfo"
     BEGIN
+        BLOCK "040904E4"
+        BEGIN
+            VALUE "Comments", "http://nssm.cc/"
+            VALUE "FileDescription", "The non-sucking service manager"
+            VALUE "FileVersion", NSSM_VERSION
+            VALUE "LegalCopyright", "(c) Iain Patterson"
+            VALUE "ProductName", "NSSM"
+            VALUE "ProductVersion", NSSM_VERSION
+        END
     END
     BLOCK "VarFileInfo"
     BEGIN
+        VALUE "Translation", LANG_ENGLISH, SUBLANG_ENGLISH_US, LANG_FRENCH, SUBLANG_FRENCH, LANG_ITALIAN, SUBLANG_ITALIAN
     END
 END
 
@@ -371,37 +381,6 @@ FONT 8, "MS Sans Serif"
 }
 
 
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// 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    // French resources
 /////////////////////////////////////////////////////////////////////////////
 
@@ -539,32 +518,6 @@ 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    // Italian (Italy) resources
 /////////////////////////////////////////////////////////////////////////////
 

+ 15 - 1
version.cmd

@@ -21,13 +21,27 @@ set version=%version:~0,-1%
 set minor=%version:*.=%
 call set major=%%version:.%minor%=%%
 
+@rem Build flags.
+set flags=0L
+
 @rem Don't include n and commit if we match a tag exactly.
-if "%n%" == "0" set description=%major%.%minor%
+if "%n%" == "0" (set description=%major%.%minor%) else set flags=VS_FF_PRERELEASE
+@rem Maybe we couldn't get the git tag.
+if "%commit%" == "prerelease" set flags=VS_FF_PRERELEASE
 
 @rem Ignore the build number if this isn't Jenkins.
 if "%BUILD_NUMBER%" == "" set BUILD_NUMBER=0
 
+@rem Copyright year provided by Jenkins.
+if "%BUILD_ID%" == "" (set year=) else (
+  set md=%BUILD_ID:*-=%
+  call set year=%%BUILD_ID:%md%=%%
+  set year=%year:~0,-1%
+)
+
 @rem Create version.h.
 @echo>version.h #define NSSM_VERSION _T("%description%")
 @echo>>version.h #define NSSM_VERSIONINFO %major%,%minor%,%n%,%BUILD_NUMBER%
 @echo>>version.h #define NSSM_DATE _T("%DATE%")
+@echo>>version.h #define NSSM_FILEFLAGS %flags%
+@echo>>version.h #define NSSM_COPYRIGHT _T("(c) 2003-%year% Iain Patterson")