我使用 RC(資源)檔案來獲取鏈接到 EXE 檔案的版本資訊,最近我從Borland Resource Compiler切換到Windows SDK Resource Compiler,以便能夠在我的應用程式中使用多種尺寸的圖示。
該圖示有效,但現在當我編譯我的應用程式時,資源資訊似乎沒有附加到 EXE 檔案中。我懷疑適用于 BRCC32.EXE 的同一個 RC 檔案不適用于 Windows SDK 資源編譯器。
這是我的verinfo.rc內容:
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", "Company Soft\0"
VALUE "CompanyName", "Company2\0"
VALUE "FileDescription", "Company Soft\0"
VALUE "FileVersion", "x.x.x.x\0"
VALUE "InternalName", "Company Soft\0"
VALUE "LegalCopyright", "Company2\0"
VALUE "OriginalFilename", "abrev.exe\0"
VALUE "ProductName", "Company Soft\0"
VALUE "ProductVersion", "x.x.x.x\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0409,1200
END
END
這是我的 EXE 檔案在資源管理器的檔案屬性中的顯示方式:

最后,我不會忘記verinfo.rc在我的 Delphi 專案檔案中使用該檔案:
program myprogram;
{$R 'verinfo.res' 'verinfo.rc'}
更新 #1
If I change the resource compiler back from Windows SDK Compiler to Borland Resource Compiler the version information is included into the EXE file (but I cannot use multiple sizes icons anymore):

Update #2
Using the resource editor 
Update #3
Here is what I found what happens when using the same RC file but with different resource compilers:
When using Borland Resource Compiler everything works fine, with the version info shown in Windows Explorer; Resource Hacker shows this:

When using Windows SDK Resource Compiler version information still shows in Resource Hacker but not in Windows Explorer:

uj5u.com熱心網友回復:
DLL 中的版本資源通過右鍵單擊不可見修復了該問題:基本上我將.rc檔案的第一行從
VS_VERSION_INFO VERSIONINFO
到
1 VERSIONINFO
現在一切正常!
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/377373.html
標籤:delphi embedded-resource explorer fileversioninfo delphi-11-alexandria
上一篇:防止TParams重復
