PDA

View Full Version : Detail Information



KaptainKarl
8th November 2010, 21:31
Is there a way in QT to include the information in the Details tab of the Application Properties dialog in Windows? For example:

File description
File version
Product name
Product version
Copyright

QT SDK 2010.05
OS: Windows 7

Thanks,
Karl

ChrisW67
8th November 2010, 21:39
That information is stored in the Windows resource file and is Windows-specific. You can specify that a Windows resource file is included in your build with the QMake RC_FILE variable:


RC_FILE = example.rc

an example RC file (also includes a program manifest and icon):


#include <windows.h>
#include "version.h"

#define VER_COMPANYNAME_STR "Example Pty Ltd\0"
#define VER_FILEDESCRIPTION_STR "Example Program\0"
#define VER_INTERNALNAME_STR "Example\0"
#define VER_LEGALCOPYRIGHT_STR "Copyright 2010 Example Pty Ltd\0"
// #define VER_LEGALTRADEMARKS1_STR "\0"
// #define VER_LEGALTRADEMARKS2_STR "\0"
#define VER_ORIGINALFILENAME_STR "example.exe"
#define VER_PRODUCTNAME_STR "Example Application"

#ifndef DEBUG
#define VER_DEBUG 0
#else
#define VER_DEBUG VS_FF_DEBUG
#endif


ID_ICON ICON DISCARDABLE "example.ico"
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "example.exe.manifest"

VS_VERSION_INFO VERSIONINFO
FILEVERSION VER_FILEVERSION
PRODUCTVERSION VER_PRODUCTVERSION
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK

FILEFLAGS ( VS_FF_PRIVATEBUILD|VS_FF_PRERELEASE|VER_DEBUG )
FILEOS VOS__WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "CompanyName", VER_COMPANYNAME_STR
VALUE "FileDescription", VER_FILEDESCRIPTION_STR
VALUE "FileVersion", VER_FILEVERSION_STR
VALUE "InternalName", VER_INTERNALNAME_STR
VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR
// VALUE "LegalTrademarks1", VER_LEGALTRADEMARKS1_STR
// VALUE "LegalTrademarks2", VER_LEGALTRADEMARKS2_STR
VALUE "OriginalFilename", VER_ORIGINALFILENAME_STR
VALUE "ProductName", VER_PRODUCTNAME_STR
VALUE "ProductVersion", VER_PRODUCTVERSION_STR
END
END

BLOCK "VarFileInfo"
BEGIN
/* The following line should only be modified for localized versions. */
/* It consists of any number of WORD,WORD pairs, with each pair */
/* describing a language,codepage combination supported by the file. */
/* */
/* For example, a file might have values "0x409,1252" indicating that it */
/* supports English language (0x409) in the Windows ANSI codepage (1252). */

VALUE "Translation", 0x409, 1252

END
END

You will have to look to Microsoft documentation for the meaning of this.