views:

1562

answers:

3

I never worked with Delphi before, so maybe the question looks a simple minded, But I need to change FileVersion in RES resource file parameter from command line...

Many thanks.

+2  A: 

If you use delphi to build your application, you can turn on auto-incrementation of the buildnumber under projectsettings.

Or use StampVer

jitter
+1 as stampver achieves the desired result. And I wrote it :)
Paul Dixon
+8  A: 

Here can find the Borland resource compiler:

%ProgramFiles%\Borland\Delphi7\Bin\brcc32.exe

EDIT: As mghie mentioned you could create a RC file like this one:

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1, 0, 0, 100
PRODUCTVERSION 1, 0, 0, 1
 FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
 FILEFLAGS 0x9L
#else
 FILEFLAGS 0x8L
#endif
 FILEOS 0x4L
 FILETYPE 0x1L
 FILESUBTYPE 0x0L
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904b0"
        BEGIN
            VALUE "Comments", "Modified by BZCToOn's"
            VALUE "CompanyName", "Syntheretix"
            VALUE "FileDescription", "rcversion MFC Application"
            VALUE "FileVersion", "1, 0, 0, 100"
            VALUE "InternalName", "rcversion"
            VALUE "LegalCopyright", "Copyleft (C) Bzc ToOn'S 2002"
            VALUE "OriginalFilename", "rcversion.EXE"
            VALUE "PrivateBuild", "RCVERSION-20030212_100"
            VALUE "ProductName", "rcversion Application"
            VALUE "ProductVersion", "1, 0, 0, 1"
        END
    END
    BLOCK "VarFileInfo"
    BEGIN
        VALUE "Translation", 0x409, 1200
    END
END

(copied from http://www.codeproject.com/KB/applications/cb2rcversion.aspx)

And compile it using BRCC32. Before you have to disable version information in project settings.

EDIT: Further information ...

http://msdn.microsoft.com/en-us/library/aa380599.aspx

http://msdn.microsoft.com/en-us/library/aa381058.aspx

ulrichb
Of course you can. Disable the version resource in the project options, add a version resource to an rc file (maybe together with other resource types), compile this to res using the command line resource compiler, and include it in the program using the {$R filename.res} directive. More than one .res file can be linked into the application. Some things like getting the build number from SVN revision, or properly setting the DEBUG resource flag depending on the build type can't be done in the IDE.
mghie
Where I can find an RC file?
Savash
@Savash: MSDN has all the information you need: http://msdn.microsoft.com/en-us/library/aa380599(VS.85).aspx. You should make sure that you use the correct values in the "Translation" block, this depends on your language / the language your program is in. In most documentation and samples this will be set to English locale, you may need to change the values to your own. Again, see the MSDN documentation for further details.
mghie
+4  A: 

Just going to add to ulrichb's answer...

Hint: Create an .RC file and use the {$R} directive to include it to your project.

{$R 'Splash.res' 'Splash.rc'}

Above directive is what I use to include an image for a splash screen. It will automatically compile the .RC file. As an option, you can just include the .RC to your Delphi project, in which case the above line will be added to your project file (*.DPR) and it will also automatically compile. (And you can use Delphi to edit the .RC file.)

Do be careful that you don't give the resource file the same name as your project file. This becomes too confusing for Delphi.

Workshop Alex