Solved

Delphi Programming question

Posted on 1997-08-29
1
586 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 60 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

Industry Leaders: 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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

756 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