Add version information to the exe executable program generated by Qt

There is version information in the properties of the .exe executable file under Windows, including version information, description, copyright, etc. For the qt program, to contain such information, please do the following: create a new one with a text file: <project name>.rc file, fill in the information in the rc file:

 

#if defined(UNDER_CE)
#include 
#else
#include 
#endif
 
 
VS_VERSION_INFO VERSIONINFO
    FILEVERSION 1,0,0,0
    PRODUCTVERSION 1,0,0,0
    FILE FLAG MASK  0x3fL
#ifdef _DEBUG
    FILEFLAGS VS_FF_DEBUG
#else
    FILEFLAGS  0x0L
#endif
    FILEOS VOS__WINDOWS32
    FILETYPE  VFT_DLL
    FILESUBTYPE 0x0L
    BEGIN
        BLOCK "StringFileInfo"
        BEGIN
            BLOCK "080404b0"
            BEGIN
                VALUE "CompanyName", "SAC"
                VALUE "FileDescription", "Industrial Control System"
                VALUE "FileVersion", "1.0.0.0"
                VALUE "InternalName", "scd.exe"
                VALUE "LegalCopyright", "Copyright (C)2001-2013"
                VALUE "OriginalFilename", "scd.exe"
                VALUE "ProductName", "scd"
                VALUE "ProductVersion", "1.0.0.0"
            END
        END
        BLOCK "VarFileInfo"
        BEGIN
            VALUE "Translation", 0x804, 1200
        END
    END


然后将pro文件的RC_FILE = <工程名>.rc,如此一来编译生成的程序就会含有版本信息。

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326683835&siteId=291194637