Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Delphi Programming question

Posted on 1997-08-29
1
Medium Priority
?
595 Views
Last Modified: 2012-06-27
The Delphi 3 IDE has a provision to automatically increment the build number of the application.  This feature appears disabled from the command-line DCC32 compiler.

I am looking for a way FROM DCC32 to set the build number to a given value, as well as the other versioning fields.  I suspect it may take a comand line resource editor.

I already know how to READ the version information using combinations of GetFileVersionInfoSize, GetFileVersionInfo, and VerQueryValue.

My question is how to SET these.  That can be via comand line, or tools so that I can write an app to do it for me, and I'll make that app comand line.

It is less important that these values be correct inside of the DPR, and more important that the final EXE contain the proper values.

The pupose of doing this is to better integrate the labeling of source code in PVCS with the resultant EXE that is released.
0
Comment
Question by:cashew
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
arh earned 120 total points
ID: 1342947
Delphi stores version info  from Project|Options|VersionInfo
dialog box in the file <your-project-name>.res. If you don't want to cope
with windows binary resource format, there is the only way to change
this info from outside Delphi.
 First, disable "include version information in project" check box
(if you don't, there will finally be two VERSIONINFO in exe, and any
program dealing with this will be very confused).
 Second, provide this information by yourself (it will not be
available in Delphi IDE). Here is how:

1) Create text resource file, named, for example, ver.rc:
(format of VERSIONINFO statement is (poorly) documented in windows
API help)

  1 VERSIONINFO LOADONCALL MOVEABLE DISCARDABLE IMPURE
  FILEVERSION 1, 0, 0, 0
  PRODUCTVERSION 1, 0, 0, 0
  FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
  FILEOS VOS__WINDOWS32
  FILETYPE VFT_APP
  {
  BLOCK "StringFileInfo"
    {  
    BLOCK "040904E4"  
      {  
      VALUE "CompanyName", "Sample Company"  
      VALUE "FileDescription", "Sample project"  
      VALUE "FileVersion", "1.0"  
      VALUE "InternalName", "sample"  
      VALUE "LegalCopyright", ""   
      VALUE "LegalTrademarks", ""   
      VALUE "OriginalFilename", "sample.exe"  
      VALUE "ProductName", "sample"  
      VALUE "ProductVersion", "1.0"  
      VALUE "Comments", "" 
      }
    }
    BLOCK "VarFileInfo"
      {  
      VALUE "Translation", 1033, 1252
      }
  }

Sample VERSIONINFO statement can be extracted from .res or .exe file
by resource editor (from Borland C++, Delphi RAD pack or MS Visual C++).
This text file can be generated by your program, which will substitute
proper values in place of version numbers etc.

2). Compile this .rc file by resource compiler:
  brcc32 ver.rc
It will create binary resource file ver.res

3). Include reference to this .res file in your project:

  program d3vinfo;

  uses
    Forms,
    main in 'main.pas' {Form1};

  {$R *.RES}
  {$R ver.res }

  begin
    Application.Initialize;
    Application.CreateForm(TForm1, Form1);
    Application.Run;
  end.

Actually, you could provide version info in your .exe this way
since Delphi 1.

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question