Auto Increment Version Information Pre-build tool for Delphi XE2 using VerInfo

In Delphi XE2, the "Auto Increment build number" of Version Information is changed to "Auto generate build number", replace Release and Build part with random numbers which is actually a time stamp of the time it's generated. Tools like DDevExtensions…

In Delphi XE2, the “Auto Increment build number” of Version Information is changed to Auto generate build number, replace Release and Build part with random numbers which is actually a time stamp of the time it’s generated.

I coded this little utility for my purpose, because I need/like an auto increment build number as a simple mean to track the build number, not some numbers that “look” random.


found that DDevExtension 2.6 add Version Information expert, under Project menu; but this VerInfo can also be used for other development tools that does not support Auto Increment Ver Info

1. Readying verinfo.exe

VerInfo is trying to help to do Auto Increment build number in Delphi XE2.

First download and copy “verinfo.exe” to your path, find download link below, for easy access to VerInfo it’s good idea to add it to IDE Tools:

2. Create RC file

Create Version Information Resource script either using text editor, or better yet, launch VerInfo and fill the form:

Then save the RC file to your project folder, the same folder as .dpr file, with an easy to recognize name, I usually name it <ProjectName>Ver.rc, eg: SLauncherVer.rc for my SLauncher program. For this example, here on, we use SLauncher project.

VerInfo uses and produces minimal Version Info RC file, eg:

// autoincbuild: 1
// autoincrelease: 0
#ifdef _DEBUG
  BLOCK "StringFileInfo"
    BLOCK "040904b0"
      VALUE "CompanyName", "\000"
      VALUE "FileDescription", "File macem-macem\000"
      VALUE "FileVersion", "\000"
      VALUE "InternalName", "macem2.exe\000"
      VALUE "LegalCopyright", "Copyright 2012 dewa indrayana\000"
      VALUE "LegalTrademark", "\000"
      VALUE "OriginalFilename", "macem2.exe\000"
      VALUE "ProductName", "macem2\000"
      VALUE "ProductVersion", "\000"
      VALUE "Comments", "good good\000"
  BLOCK "VarFileInfo"
    VALUE "Translation", 0x409, 1200
3. Add RC file to project

After we have SLauncherVer.rc, we need to add this file to our project:

  • Right-Click on SLauncher project, choose [Add], [Resource file (*.rc)] file type, select SLauncherVer.rc
  • SLauncherVer.rc will be added to project
  • and Delphi will edit Project source and add the needed line.

Next, we need to update the Project Option:

  • Uncheck the “Include version information in project”
  • Add command “verinfo” to “Pre-build events”, to increment File Version build number in SLauncherVer.rc
    • we will add “verinfo $(INPUTDIR)SLauncherVer.rc /update”


If you got exit code 9009 , please make sure verinfo.exe is accessible either in PATH or full path is specified, and also to use quote if the path of verinfo.exe or your .rc file contain spaces. See user comments below


v0.7.2.21 – October 2012

  • first public release


  1. Hello,

    there is a problem with your tool. On building the project the IDE shows a message that “verinfo D:verinfoNExAutoStarter.rc /update is closed with code 9009”.
    I have Delphi XE2 Update 4

    Do you have an idea?

    Best Regards

  2. Hi, I created it for XE2 and then for Update 4 too, and so far found no problem.
    but let me check it


  3. Hello dewa,

    I found the error
    The exe was not in the project folder. Sorry for this.

    Have now added the entire path f.e.: “D:verinfoverinfo.exe” “D:verinfoNExAutoStarter.rc” /update

    Best Regards

  4. Hi Ninow,
    glad it works and hope it helps 🙂

  5. Hi,

    I think your tool is the best solution. I tried the DDev Extension expert but it doesn’t seem to auto increment the build, I had to do it manually all the time.

    Thanks a lot !

  6. Hello,

    I try to use this Auto Increment Version Information Pre-build tool.
    I have have installed it in Delphi XE2 Starter.
    I can’t ‘Uncheck the “Include version information in project”’, when I uncheck and click the OK button, it looks it is ok.
    But when open “Version info” again it is checked.

    When I compile or build the project Delphi is hanging at the stage: “Checking Kloktester.rc”

    What I am doing wrong?

    Best regards,


    • Hi Hans,
      I have not tried it on XE2 Starter, but usually it just uncheck “Include version information in project” of “Project Options”, click OK and Save project, and upon compilation Delphi will launch it.
      Is the path to verinfo.exe already set correctly? or put it in path environment?

  7. G’day Dewa,

    I’ve been looking for a tool like yours for a while, so was quite excited to finally install it.

    I think I followed your simple and clear instructions correctly.

    But when I go to build my application, I get an error:

    [Exec Error] The command “verinfo N:DelphiProjectsObject General LedgerGLOW renewedGLOWrenew.rc /update” exited with code 9009.

    I couldn’t find reference to “Code 9009” anywhere.

    Have I missed something obvious?

    Cheers, Paul

    • Hi Paul,
      it seemed “verinfo” could not be accessed.
      Try to add complete path to “verinfo”, eg:

      C:verinfo_pathverinfo N:DelphiProjectsObject General LedgerGLOW renewedGLOWrenew.rc /update”

      or put “verinfo” in PATH accessible folder

      • Thanks a lot Dewa.

        Fixing the path has advanced things, but still having problems. RAD Studio XE2 IDE now freezes on the BRCC32 compile of the *.rc file. Killing Verinfo.exe (in Task Manager) allows compilation to complete.

        I’ve tested the Pre-build event string in a command-line window and it increments the build number OK.

        Cheers, Paul

        • OK solved it myself.

          Problem was fully qualified path to *.dr file contained spaces. Just changed Pre-build event string so filename wrapped in double-quotes:

          verinfo “$(INPUTDIR)GLOWrenew Verinfo.rc” /update

          $(INPUTDIR) is N:DelphiProjectsObject General LedgerGLOW renewed

          Cheers, Paul

Leave a Reply

We use cookies. By browsing our site you agree to our use of cookies.Accept