?
Solved

Delphi Programming question

Posted on 1997-08-29
1
Medium Priority
?
590 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month13 days, 12 hours left to enroll

801 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