Add version information to the dll and exe files.

From https://github.com/philr/bzip2-windows/blob/v1.0.6.1/patches/03-add_version_resource.diff
This commit is contained in:
Phil Ross 2019-06-08 12:33:18 +01:00 committed by Federico Mena Quintero
parent e0f6201b40
commit a715b86f57
3 changed files with 67 additions and 5 deletions

1
.gitignore vendored
View File

@ -56,3 +56,4 @@ builddir
*.exp
*.lib
*.obj
*.res

View File

@ -5,6 +5,7 @@
CC=cl
CFLAGS= -DWIN32 -MD -Ox -D_FILE_OFFSET_BITS=64 -nologo
RC=rc
OBJS= blocksort.obj \
huffman.obj \
@ -16,16 +17,25 @@ OBJS= blocksort.obj \
all: dll lib bzip2 test
bzip2: dll
$(CC) $(CFLAGS) /Febzip2 bzip2.c bz2-1.lib setargv.obj
$(CC) $(CFLAGS) /Febzip2recover bzip2recover.c
bzip2: dll bzip2.res bzip2recover.res
$(CC) $(CFLAGS) /Febzip2 bzip2.c bz2-1.lib setargv.obj bzip2.res
$(CC) $(CFLAGS) /Febzip2recover bzip2recover.c bzip2recover.res
dll: $(OBJS) libbz2.def
link /dll /implib:bz2-1.lib /out:bz2-1.dll /def:libbz2.def $(OBJS)
dll: $(OBJS) libbz2.def bz2-1.res
link /dll /implib:bz2-1.lib /out:bz2-1.dll /def:libbz2.def $(OBJS) bz2-1.res
lib: $(OBJS)
lib /out:bz2-static.lib $(OBJS)
bzip2.res:
$(RC) /fobzip2.res /d BZIP2 version.rc
bzip2recover.res:
$(RC) /fobzip2recover.res /d BZIP2RECOVER version.rc
bz2-1.res:
$(RC) /fobz2-1.res /d BZ21DLL version.rc
test: bzip2
type tests\words1
.\\bzip2 -1 < tests\sample1.ref > tests\sample1.rb2
@ -54,9 +64,12 @@ clean:
del bz2-1.dll
del bz2-1.exp
del bz2-1.lib
del bz2-1.res
del bz2-static.lib
del bzip2.exe
del bzip2.res
del bzip2recover.exe
del bzip2recover.res
del tests\sample1.rb2
del tests\sample2.rb2
del tests\sample3.rb2

48
version.rc Normal file
View File

@ -0,0 +1,48 @@
#include <winver.h>
LANGUAGE 0x09,0x01
1 VERSIONINFO
FILEVERSION 1,0,7,0
PRODUCTVERSION 1,0,7,0
FILEFLAGSMASK 0x3fL
FILEFLAGS 0x00L
FILEOS VOS__WINDOWS32
#if defined(BZ21DLL)
FILETYPE VFT_DLL
#else
FILETYPE VFT_APP
#endif
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
// VALUE "Comments", "\0"
VALUE "CompanyName", "bzip2, https://gitlab.com/federicomenaquintero/bzip2\0"
VALUE "FileDescription", "bzip2\0"
VALUE "FileVersion", "1.0.7\0"
#if defined(BZ21DLL)
VALUE "InternalName", "bz2-1\0"
VALUE "OriginalFilename", "bz2-1.dll\0"
#elif defined(BZIP2)
VALUE "InternalName", "bzip2\0"
VALUE "OriginalFilename", "bzip2.exe\0"
#elif defined(BZIP2RECOVER)
VALUE "InternalName", "bzip2recover\0"
VALUE "OriginalFilename", "bzip2recover.exe\0"
#endif
VALUE "LegalCopyright", "Copyright (C) 1996-2010 Julian Seward <jseward@acm.org>. Copyright (C) 2019 Federico Mena Quintero <federico@gnome.org>. All rights reserved.\0"
// VALUE "LegalTrademarks", "\0"
// VALUE "PrivateBuild", "\0"
VALUE "ProductName", "bzip2\0"
VALUE "ProductVersion", "1.0.7\0"
// VALUE "SpecialBuild", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 0x4b0
END
END