diff options
author | Chris Liddell <chris.liddell@artifex.com> | 2018-12-11 12:26:12 +0000 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2018-12-13 10:33:58 +0000 |
commit | 3e4d8a0ab793ddd889acbcd2a521cfe5a30e5525 (patch) | |
tree | 636dbe956c03459e2153a37bad79e9a100602bdd | |
parent | 218180b6d38a4641807775c032d8774c165a7657 (diff) | |
download | ghostpdl-3e4d8a0ab793ddd889acbcd2a521cfe5a30e5525.tar.gz |
Add product, copyright and version info to Windows binaries
This appears in the Windows Explorer: Properties -> Details dialogue.
-rw-r--r-- | base/gscdef.c | 17 | ||||
-rw-r--r-- | base/gscdefs.h | 29 | ||||
-rw-r--r-- | psi/dwmain.rc | 22 | ||||
-rw-r--r-- | psi/gsdll32.rc | 21 | ||||
-rw-r--r-- | psi/winint.mak | 4 |
5 files changed, 71 insertions, 22 deletions
diff --git a/base/gscdef.c b/base/gscdef.c index dfde2b11d..3b0dccef0 100644 --- a/base/gscdef.c +++ b/base/gscdef.c @@ -25,22 +25,10 @@ /* All of these can be set in the makefile. */ /* Normally they are all const; see gscdefs.h for more information. */ -#ifndef GS_BUILDTIME -# define GS_BUILDTIME\ - 0 /* should be set in the makefile */ -#endif const long gs_buildtime = GS_BUILDTIME; -#ifndef GS_COPYRIGHT -# define GS_COPYRIGHT\ - "Copyright (C) 2018 Artifex Software, Inc. All rights reserved." -#endif const char *const gs_copyright = GS_COPYRIGHT; -#ifndef GS_PRODUCTFAMILY -# define GS_PRODUCTFAMILY\ - "GPL Ghostscript" -#endif const char *const gs_productfamily = GS_PRODUCTFAMILY; const char * @@ -48,11 +36,6 @@ gs_program_family_name(void) { return gs_productfamily; } - -#ifndef GS_PRODUCT -# define GS_PRODUCT\ - GS_PRODUCTFAMILY " GIT PRERELEASE" -#endif const char *const gs_product = GS_PRODUCT; const char * diff --git a/base/gscdefs.h b/base/gscdefs.h index 19cbc4e4a..87981f3f0 100644 --- a/base/gscdefs.h +++ b/base/gscdefs.h @@ -13,12 +13,35 @@ CA 94945, U.S.A., +1(415)492-9861, for further information. */ - -/* Prototypes for configuration definitions in gconfig.c. */ - #ifndef gscdefs_INCLUDED # define gscdefs_INCLUDED + +#define GS_STRINGIZE2(s) #s +#define GS_STRINGIZE(s) GS_STRINGIZE2(s) + +#ifndef GS_BUILDTIME +# define GS_BUILDTIME\ + 0 /* should be set in the makefile */ +#endif + +#ifndef GS_COPYRIGHT +# define GS_COPYRIGHT\ + "Copyright (C) 2018 Artifex Software, Inc. All rights reserved." +#endif + +#ifndef GS_PRODUCTFAMILY +# define GS_PRODUCTFAMILY\ + "GPL Ghostscript" +#endif + +#ifndef GS_PRODUCT +# define GS_PRODUCT\ + GS_PRODUCTFAMILY " GIT PRERELEASE" +#endif + +/* Prototypes for configuration definitions in gconfig.c. */ + /* * This file may be #included in places that don't even have stdpre.h, * so it mustn't use any Ghostscript definitions in any code that is diff --git a/psi/dwmain.rc b/psi/dwmain.rc index eb4c0f52b..acf7c6e63 100644 --- a/psi/dwmain.rc +++ b/psi/dwmain.rc @@ -17,6 +17,8 @@ #include <windows.h> #include "dwres.h" +#include "gscdefs.h" + #ifndef gstext_ico #define gstext_ico gswin.ico @@ -31,3 +33,23 @@ GSIMAGE_ICON ICON gsgraph_ico #ifndef DS_3DLOOK #define DS_3DLOOK 0x0004L /* for Windows 95 look */ #endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 0,0,GS_VERSION_MAJOR,GS_VERSION_MINOR + PRODUCTVERSION 0,0,GS_VERSION_MAJOR,GS_VERSION_MINOR +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "FileVersion", GS_STRINGIZE(GS_DOT_VERSION) "\0" + VALUE "ProductVersion", GS_STRINGIZE(GS_DOT_VERSION) "\0" + VALUE "LegalCopyright", GS_COPYRIGHT "\0" + VALUE "ProductName", GS_PRODUCT + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END diff --git a/psi/gsdll32.rc b/psi/gsdll32.rc index e26973ec2..19cb61ab2 100644 --- a/psi/gsdll32.rc +++ b/psi/gsdll32.rc @@ -17,6 +17,7 @@ #include <windows.h> #include "gp_mswin.h" +#include "gscdefs.h" #ifndef gstext_ico #define gstext_ico gswin.ico @@ -48,3 +49,23 @@ BEGIN CTEXT "", CANCEL_PCDONE, 8, 16, 104, 8, WS_CHILD | WS_VISIBLE | WS_GROUP CONTROL "&Cancel", IDCANCEL, "button", BS_PUSHBUTTON | WS_GROUP | WS_TABSTOP | WS_CHILD, 44, 30, 32, 14 END + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 0,0,GS_VERSION_MAJOR,GS_VERSION_MINOR + PRODUCTVERSION 0,0,GS_VERSION_MAJOR,GS_VERSION_MINOR +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "FileVersion", GS_STRINGIZE(GS_DOT_VERSION) "\0" + VALUE "ProductVersion", GS_STRINGIZE(GS_DOT_VERSION) "\0" + VALUE "LegalCopyright", GS_COPYRIGHT "\0" + VALUE "ProductName", GS_PRODUCT + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END diff --git a/psi/winint.mak b/psi/winint.mak index 7602e7f72..431652317 100644 --- a/psi/winint.mak +++ b/psi/winint.mak @@ -83,7 +83,7 @@ $(GS_OBJ).res: $(PSSRC)dwmain.rc $(dwres_h) $(ICONS) $(WININT_MAK) $(ECHOGS_XE) -w $(PSGEN)_exe.rc -x 23 define -s gstext_ico $(GLGENDIR)\gswin.ico $(ECHOGS_XE) -a $(PSGEN)_exe.rc -x 23 define -s gsgraph_ico $(GLGENDIR)\gswin.ico $(ECHOGS_XE) -a $(PSGEN)_exe.rc -R $(PSSRC)dwmain.rc - $(RCOMP) -i$(PSSRCDIR) -i$(PSGENDIR) $(i_INCDIR) -r $(RO_)$(GS_OBJ).res $(PSGEN)_exe.rc + $(RCOMP) -dGS_DOT_VERSION=$(GS_DOT_VERSION) -dGS_VERSION_MAJOR=$(GS_VERSION_MAJOR) -dGS_VERSION_MINOR=$(GS_VERSION_MINOR) -i$(PSSRCDIR) -i$(PSGENDIR) -i$(GLSRCDIR) $(i_INCDIR) -r $(RO_)$(GS_OBJ).res $(PSGEN)_exe.rc del $(PSGEN)_exe.rc # resources for main program (includes dialogs) @@ -91,7 +91,7 @@ $(GSDLL_OBJ).res: $(PSSRC)gsdll32.rc $(gp_mswin_h) $(ICONS) $(WININT_MAK) $(ECHOGS_XE) -w $(PSGEN)_dll.rc -x 23 define -s gstext_ico $(GLGENDIR)\gswin.ico $(ECHOGS_XE) -a $(PSGEN)_dll.rc -x 23 define -s gsgraph_ico $(GLGENDIR)\gswin.ico $(ECHOGS_XE) -a $(PSGEN)_dll.rc -R $(PSSRC)gsdll32.rc - $(RCOMP) -i$(PSSRCDIR) -i$(PSGENDIR) -i$(GLSRCDIR) $(i_INCDIR) -r $(RO_)$(GSDLL_OBJ).res $(PSGEN)_dll.rc + $(RCOMP) -dGS_DOT_VERSION=$(GS_DOT_VERSION) -dGS_VERSION_MAJOR=$(GS_VERSION_MAJOR) -dGS_VERSION_MINOR=$(GS_VERSION_MINOR) -i$(PSSRCDIR) -i$(PSGENDIR) -i$(GLSRCDIR) $(i_INCDIR) -r $(RO_)$(GSDLL_OBJ).res $(PSGEN)_dll.rc del $(PSGEN)_dll.rc |