Delphi, resource files and includes – some links
Posted by jpluimers on 2017/02/23
Some links that were useful getting back into using Delphi with resource scripts and include files:
- delphi – Include file behave differently using RC.EXE or BRCC32.EXE to build *.rc files – Stack Overflow [WayBack]
- About Resource Files (Windows) [WayBack]
- #include (Windows) [WayBack]
- Preprocessor Operators (Windows) [WayBack]
- Pragma Directives (Windows) [WayBack]
- BRCC32.EXE, the Resource Compiler – RAD Studio [WayBack]
- null terminate your versioninfo strings [WayBack]
- resources – How to compile Delphi RES file from commandline – Stack Overflow [WayBack]
- Using resource files with Delphi – DelphiBasics [WayBack]
- delphi – Remove {$R *.res} in package.dpk file will remove the rccompile in .dproj file – Stack Overflow [WayBack]
- delphi – What Is a .vrc file, how is is generated and can you remove it using the IDE? – Stack Overflow [WayBack]
- TN035: Using Multiple Resource Files and Header Files with Visual C++ [WayBack]
- Resource Files (Visual Studio) [WayBack]
- Include resource files in your Delphi build process Ondrej Kelle – Google+ [WayBack]
- Sometimes a unit only includes a .res file but ships with a .rc file, then you need to run BRCC32 on it (either manually once of build a build script); example: One of my favorite features in the XE IDE is an add in, part of Version Insight, that does Live Blaming … – Nick Hodges – Google+ [WayBack]
Maybe I should have considered this alternative:
- twm’s homepage – dzPrepBuild for Delphi (English) [WayBack] -> sf.net dzPrepBuild for Delphi / Home / Home
–jeroen
PS: a first go on a resource file structure for Version Information is below.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Assemble the VersionInfo resource from the previously information included/provided by the .RC file for the project. | |
| #ifndef PRIVATEBUILD | |
| #define VER_PRIVATEBUILD VS_FF_RELEASE | |
| #else | |
| #define VER_PRIVATEBUILD VS_FF_PRIVATEBUILD | |
| #endif | |
| #ifndef PRERELEASE | |
| #define VER_PRERELEASE VS_FF_RELEASE | |
| #else | |
| #define VER_PRERELEASE VS_FF_PRERELEASE | |
| #endif | |
| #ifndef DEBUG | |
| #define VER_DEBUG VS_FF_RELEASE | |
| #else | |
| #define VER_DEBUG VS_FF_DEBUG | |
| #endif | |
| VS_VERSION_INFO VERSIONINFO | |
| FILEVERSION VER_FILEVERSION | |
| PRODUCTVERSION VER_PRODUCTVERSION | |
| FILEFLAGSMASK VS_FFI_FILEFLAGSMASK | |
| FILEFLAGS (VER_PRIVATEBUILD|VER_PRERELEASE|VER_DEBUG) | |
| FILEOS VOS__WINDOWS32 | |
| FILETYPE VFT_APP // or VFT_DLL | |
| FILESUBTYPE VFT_UNKNOWN | |
| BEGIN | |
| BLOCK "StringFileInfo" | |
| BEGIN | |
| BLOCK "080904B0" | |
| BEGIN | |
| // VALUE "Comments", "\0\0" | |
| 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 | |
| // LegalTrademarks Trademarks and registered trademarks that apply to the file. This should include the full text of all notices, legal symbols, trademark numbers, and so on. This string is optional. | |
| VALUE "LegalTrademarks1", VER_LEGALTRADEMARKS1_STR | |
| VALUE "LegalTrademarks2", VER_LEGALTRADEMARKS2_STR | |
| VALUE "OriginalFilename", VER_ORIGINALFILENAME_STR | |
| #ifdef PRIVATEBUILD | |
| // VALUE "PrivateBuild" "\0\0" | |
| #endif | |
| VALUE "ProductName", VER_PRODUCTNAME_STR | |
| VALUE "ProductVersion", VER_PRODUCTVERSION_STR | |
| // VALUE "SpecialBuild" "\0\0" | |
| END | |
| END | |
| BLOCK "VarFileInfo" | |
| BEGIN | |
| VALUE "Translation", 0x809,1200 | |
| END | |
| END |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Copyrights used by the verious Suite projects | |
| #define VER_SUITECOPYRIGHT_STR "Copyright \251 2001-2017 Copyrightholder\0\0" | |
| #define VER_SUITETESTSCOPYRIGHT_STR "Copyright \251 2016-2017 Copyrightholder\0\0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Name information used by all Suite projects | |
| #define VER_SUITECOMPANYNAME_STR "Suite company name\0\0" | |
| #define VER_SUITEPRODUCTNAME_STR "Suite product name\0\0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Resources for SuiteTestsProject | |
| #include "SuiteCopyrightsForResources.inc" | |
| #include "SuiteNamesForResources.inc" | |
| #include "SuiteVersionNumberForResources.inc" | |
| #include "VsVersionForResources.inc" | |
| #define VER_COMPANYNAME_STR VER_SUITECOMPANYNAME_STR | |
| #define VER_FILEDESCRIPTION_STR "Suite Unit Tests\0\0" ///////////////////// modify for each suite part | |
| #define VER_FILEVERSION VER_SUITEVERSION | |
| #define VER_FILEVERSION_STR VER_SUITEVERSION_STR | |
| #define VER_INTERNALNAME_STR "SuiteTestsProject\0\0" //////////////////// modify for each suite part | |
| #define VER_LEGALCOPYRIGHT_STR VER_SUITETESTSCOPYRIGHT_STR | |
| #define VER_LEGALTRADEMARKS1_STR "\0\0" | |
| #define VER_LEGALTRADEMARKS2_STR "\0\0" | |
| #define VER_ORIGINALFILENAME_STR "SuiteTestsProject.exe\0\0" //////////////// modify for each suite part | |
| #define VER_PRODUCTNAME_STR VER_SUITEPRODUCTNAME_STR | |
| #define VER_PRODUCTVERSION VER_SUITEVERSION | |
| #define VER_PRODUCTVERSION_STR VER_SUITEVERSION_STR | |
| #include "SuiteAssembleVersionInfoResource.inc" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Version information used by all Suite projects | |
| #define VER_SUITEVERSION 1,2,3,45 | |
| #define VER_SUITEVERSION_STR "1.2.3.45\0\0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // comments https://msdn.microsoft.com/en-us/library/windows/desktop/aa380896.aspx | |
| // 1200 -> 0x04B0 (Unicode) | |
| // 0x0809 -> 1057 (U.K. English) | |
| // 0x0409 -> 1033 (U.S. English) | |
| // 1252 -> 0x04E4 (Codepage 1252 – Multilingual) | |
| // VS_VERSION_INFO resource https://msdn.microsoft.com/en-us/library/windows/desktop/aa381058.aspx | |
| // StringFileInfo block https://msdn.microsoft.com/en-us/library/windows/desktop/aa381049.aspx | |
| // VarFileInfo block https://msdn.microsoft.com/en-us/library/windows/desktop/aa381057.aspx | |
| ///* —– VS_VERSION.dwFileFlags —– */ | |
| #define VS_FF_RELEASE 0x00000000L | |
| #define VS_FF_DEBUG 0x00000001L | |
| #define VS_FF_PRERELEASE 0x00000002L | |
| #define VS_FF_PATCHED 0x00000004L | |
| #define VS_FF_PRIVATEBUILD 0x00000008L | |
| #define VS_FF_INFOINFERRED 0x00000010L | |
| #define VS_FF_SPECIALBUILD 0x00000020L | |
| #define VS_FFI_FILEFLAGSMASK 0x0000003FL | |
| ///* —– VS_VERSION.dwFileOS —– */ | |
| #define VOS_UNKNOWN 0x00000000L | |
| #define VOS_DOS 0x00010000L | |
| #define VOS_OS216 0x00020000L | |
| #define VOS_OS232 0x00030000L | |
| #define VOS_NT 0x00040000L | |
| #define VOS_WINCE 0x00050000L | |
| #define VOS__BASE 0x00000000L | |
| #define VOS__WINDOWS16 0x00000001L | |
| #define VOS__PM16 0x00000002L | |
| #define VOS__PM32 0x00000003L | |
| #define VOS__WINDOWS32 0x00000004L | |
| #define VOS_DOS_WINDOWS16 0x00010001L | |
| #define VOS_DOS_WINDOWS32 0x00010004L | |
| #define VOS_OS216_PM16 0x00020002L | |
| #define VOS_OS232_PM32 0x00030003L | |
| #define VOS_NT_WINDOWS32 0x00040004L | |
| ///* —– VS_VERSION.dwFileType —– */ | |
| #define VFT_UNKNOWN 0x00000000L | |
| #define VFT_APP 0x00000001L | |
| #define VFT_DLL 0x00000002L | |
| #define VFT_DRV 0x00000003L | |
| #define VFT_FONT 0x00000004L | |
| #define VFT_VXD 0x00000005L | |
| #define VFT_STATIC_LIB 0x00000007L |
[Archive.is] VS_VERSION_INFO VERSIONINFO FILEVERSION 1,1,4,0 PRODUCTVERSION 1,1,4,0 FILEFLAGSM – PasteHistory






Leave a comment