Heaventools

   English English  Deutsch Deutsch  Русский Русский

home  products  resource tuner console  feature tour

Easy Way to Update The Version Information

From now on, you don't have to change version variables manually every time you rebuild your project.

VersionApplication developers often need a command-line utility to allow modification of file version information on existing Windows EXE or DLL files. While these files already contain a Version Info resource (embedded into the executable during linking), Resource Tuner Console enables you to automatically stamp their version during the release process to insure consistency, and allows you to edit specific version number fields individually. If for whatever reasons, your files contain no Version Information resource, Resource Tuner Console will add this resource for you.

For instance, you have got code that depends on the value of the "Product Version" property of the setup.exe file, and the installations you have generated are missing the "build #" portion of that version. You may use Resource Tuner GUI to modify the properties of the setup.exe after you build it, but it is a manual process that you would rather not have to do every time you build a new release.

Another usage for Resource Tuner Console may be to fix the VB6 PE file version numbers, as Visual Basic does not set the 'release' part of the version numbers.

Every Field in the VERSIONINFO Structure Is Under Your Control

Let's get started with updating the Version Information. For example, we have a file with the Version Information like this:

Info: VS_VERSION_INFO
FileVersion: 1.0.0.0
ProductVersion: 1.0.0.0
Child Type: StringFileInfo
Language/Code Page: 1033/1252
CompanyName: Acme Corporation
FileDescription: Hello World Application
FileVersion: 1.0 (pre-build)
ProductVersion: 1.0
InternalName: Generic application
LegalCopyright: Copyright © 1999 Acme Corp.      
LegalTrademarks:
OriginalFilename: application.exe
ProductName:
Comments:

The objective is to turn the Version Information into this:

Child Type: StringFileInfo
FileVersion: 5.1.4.20
ProductVersion: 5.1.0.0
Child Type: StringFileInfo
Language/Code Page: 1033/1252
CompanyName: My Company Name, Inc.
FileDescription: Yet Another Killer Product
FileVersion: 5.1 (desktop client)
ProductVersion: 5.1
InternalName: Hot product
LegalCopyright: Copyright © 2010 My Company, Inc.
LegalTrademarks: your trademarks here...
OriginalFilename: super_application.exe
ProductName: Super Application
Comments: Powered by ResTuner Console

The Script Used To Update The Version Information

This script code is based on the Update Version Information sample script. It may be helpful to use this example as a template for your own scripts. See also: RTC Usage and Guide To Using Scripts

'----------------------------------------------------------------------------	
Sub Main

  LangID = 1033 ' English-US
  CP = ScriptUnit.CodePageFromLangID(LangID)
  PEFileProxy.OpenFile ".\src\super_application.exe"

  if not PEFileProxy.Terminated then
    if PEFileProxy.HasResources then
      ResourcesProxy.SetLanguage LangID, DELETE_IF_EXISTS
      if ResourcesProxy.OpenVersionInfo("1", LangID, CREATE_IF_NOT_EXIST) then
	   
      VersionInfoProxy.SetFileVersion  5, 1, 4, 20, LangID, True, True, True
      VersionInfoProxy.SetProductVersion 5, 1, 0, 0, LangID, True, True, True

      S1 = "My Company"
      S2 = "Yet Another Super Editor"
      S3 = "5.1 (desktop client)"
      S4 = "5.1"
      S5 = "Hot product"
      S6 = "Copyright \0xA9 2010 My Company, Inc."
      S7 = "your trademarks here..."
      S8 = "Super Application"
      S9 = "Powered by ResTuner Console"

      VersionInfoProxy.EditStringFileInfo "CompanyName", S1, CP, LangID, True, True
      VersionInfoProxy.EditStringFileInfo "FileDescription", S2, CP, LangID, True, True
      VersionInfoProxy.EditStringFileInfo "FileVersion", S3, CP, LangID, True, True
      VersionInfoProxy.EditStringFileInfo "ProductVersion", S4, CP, LangID, True, True
      VersionInfoProxy.EditStringFileInfo "InternalName", S5, CP, LangID, True, True
      VersionInfoProxy.EditStringFileInfo "LegalCopyright", S6, CP, LangID, True, True
      VersionInfoProxy.EditStringFileInfo "LegalTrademarks", S7, CP, LangID, True, True
      VersionInfoProxy.EditStringFileInfo "OriginalFilename", File_Name, CP, LangID, True, True
      VersionInfoProxy.EditStringFileInfo "ProductName", S8, CP, LangID, True, True
      VersionInfoProxy.EditStringFileInfo "Comments", S9, CP, LangID, True, True
        
      ResourcesProxy.CloseVersionInfo
      PEFileProxy.SaveAsNewImage ".\release\super_application.exe"
      else
        PEFileProxy.PostDebugString "Can't open/create Version Info..."
      end if
    end if
  end if
end sub
'----------------------------------------------------------------------------------


SAMPLE SCRIPTS LIBRARY

Resource Tuner Console comes with the examples that explain basic functionality and demonstrate many of the features available in Resource Tuner Console. Once installed Resorce Tuner Console, you will find the Demo folder in the directory where RTC has been installed. Within this Demo folder, there are 11 subdirectories that contain sample scripts and sample executable files.

All sample scripts are ready to run. Select one of the .BAT files located in the Demo folders to execute the sample script. The script will make changes in the test EXE file. The resulting file will be created in the directory named "Release" under the directory containing the script.

Check out the samples to get an idea what Resource Tuner Console can do for you.

The Complete Illustrated Step by Step Guide To Using Scripts

 

We Offer A Free Trial: Try The Software, Risk Free.

Download Resource Tuner Console
Resource Tuner Console runs on all versions of Windows from 2000 through Server 2008, Vista, 7 and 8.

Minimum hardware requirements:
Intel Pentium® processor with 166 MHz, 16 MB RAM