Improved win32 file version information

This commit is contained in:
sapier 2014-03-02 23:49:19 +01:00
parent baee91bf78
commit 3e52dd5c68
5 changed files with 77 additions and 2 deletions

@ -13,6 +13,8 @@ set(VERSION_EXTRA "" CACHE STRING "Stuff to append to version string")
set(VERSION_MAJOR 0)
set(VERSION_MINOR 4)
set(VERSION_PATCH 9)
set(VERSION_PATCH_ORIG ${VERSION_PATCH})
if(VERSION_EXTRA)
set(VERSION_PATCH ${VERSION_PATCH}-${VERSION_EXTRA})
else()

@ -1,5 +1,57 @@
#include <windows.h>
#include <commctrl.h>
#include <richedit.h>
#define USE_CMAKE_CONFIG_H
#include "config.h"
#undef USE_CMAKE_CONFIG_H
#if RUN_IN_PLACE == 1
#define BUILDMODE "RUN_IN_PLACE=1\0"
#else
#define BUILDMODE "RUN_IN_PLACE=0\0"
#endif
LANGUAGE 0, SUBLANG_NEUTRAL
130 ICON "minetest-icon.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
1 VERSIONINFO
FILEVERSION VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH_ORIG,0
PRODUCTVERSION VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH_ORIG,0
FILEFLAGSMASK 0x3fL
#ifndef NDEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "Minetest Community\0"
VALUE "FileDescription", "Minetest engine core main application\0"
VALUE "FileVersion", VERSION_STRING
VALUE "InternalName", "Minetest engine\0"
VALUE "LegalCopyright", "(c) 2014 celeron55\0"
VALUE "LegalTrademarks", """Minetest"" is property of Minetest community, don't use the name for your application without permission!\0"
VALUE "OriginalFilename", "minetest.exe\0"
VALUE "PrivateBuild", VERSION_EXTRA_STRING
VALUE "ProductName", "Minetest\0"
VALUE "ProductVersion", PRODUCT_VERSION_STRING
VALUE "SpecialBuild", BUILDMODE
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END

@ -385,7 +385,7 @@ set(common_SRCS
${UTIL_SRCS}
)
# This gives us the icon
# This gives us the icon and file version information
if(WIN32)
set(WINRESOURCE_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../misc/winresource.rc)
if(MINGW)
@ -396,7 +396,8 @@ if(WIN32)
COMMAND ${CMAKE_RC_COMPILER} -I${CMAKE_CURRENT_SOURCE_DIR}
-i${WINRESOURCE_FILE}
-o ${CMAKE_CURRENT_BINARY_DIR}/winresource_rc.o
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${WINRESOURCE_FILE})
SET(common_SRCS ${common_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/winresource_rc.o)
else(MINGW) # Probably MSVC
set(common_SRCS ${common_SRCS} ${WINRESOURCE_FILE})

@ -5,6 +5,7 @@
#define CMAKE_PROJECT_NAME "@PROJECT_NAME@"
#define CMAKE_VERSION_STRING "@VERSION_STRING@"
#define CMAKE_PRODUCT_VERSION_STRING "@VERSION_MAJOR@.@VERSION_MINOR@"
#define CMAKE_RUN_IN_PLACE @RUN_IN_PLACE@
#define CMAKE_USE_GETTEXT @USE_GETTEXT@
#define CMAKE_USE_CURL @USE_CURL@
@ -13,6 +14,11 @@
#define CMAKE_STATIC_SHAREDIR "@SHAREDIR@"
#define CMAKE_USE_LEVELDB @USE_LEVELDB@
#define CMAKE_USE_LUAJIT @USE_LUAJIT@
#define CMAKE_VERSION_MAJOR @VERSION_MAJOR@
#define CMAKE_VERSION_MINOR @VERSION_MINOR@
#define CMAKE_VERSION_PATCH @VERSION_PATCH@
#define CMAKE_VERSION_PATCH_ORIG @VERSION_PATCH_ORIG@
#define CMAKE_VERSION_EXTRA_STRING "@VERSION_EXTRA@"
#ifdef NDEBUG
#define CMAKE_BUILD_TYPE "Release"

@ -36,6 +36,20 @@
#define USE_LEVELDB CMAKE_USE_LEVELDB
#undef USE_LUAJIT
#define USE_LUAJIT CMAKE_USE_LUAJIT
#undef VERSION_MAJOR
#define VERSION_MAJOR CMAKE_VERSION_MAJOR
#undef VERSION_MINOR
#define VERSION_MINOR CMAKE_VERSION_MINOR
#undef VERSION_PATCH
#define VERSION_PATCH CMAKE_VERSION_PATCH
#undef VERSION_PATCH_ORIG
#define VERSION_PATCH_ORIG CMAKE_VERSION_PATCH_ORIG
#undef VERSION_STRING
#define VERSION_STRING CMAKE_VERSION_STRING
#undef PRODUCT_VERSION_STRING
#define PRODUCT_VERSION_STRING CMAKE_PRODUCT_VERSION_STRING
#undef VERSION_EXTRA_STRING
#define VERSION_EXTRA_STRING CMAKE_VERSION_EXTRA_STRING
#endif
#endif