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.

Version Information Application developers often need a command-line utility to allow modification of file version information on existing Windows EXE and DLL, or binary RES files.

While these files already contain the Version Information 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, granting precise control over versioning. If, for whatever reasons, your files contain no Version Information resource, Resource Tuner Console will add this resource for you.

For instance, if your code depends on the value of the Product Version property of the setup.exe file, but the generated installations miss the build number portion of that version, Resource Tuner Console offers an elegant solution. 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.

Furthermore, Resource Tuner Console enhances the user experience by enabling applications to display Version Information in different languages based on the user's locale. This feature contributes to the global accessibility and usability of the application.

Every Field in the VERSION_INFO Structure Is Under Your Control

In this guide, we will walk you through updating Version Information using Resource Tuner Console. We start with an example of a file containing the current Version Information:

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 goal is to modify it to a new desired Version Information, achieved through a script.

Info: VS_VERSION_INFO
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 © 2024 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

The script is based on the Update Version Information sample script, which can serve as a helpful template for your custom scripts. For additional guidance, refer to RTC Usage and Guide To Using Scripts, and How To Write Scripts.

Update Version Information

 Sub Main

  'Set Language constant here
  LangID = 1033 ' English-US
  
  'Retrieve CodePage from LanguageID
  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 2024 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 "ProductName", S8, CP, LangID, True, True
  VersionInfoProxy.EditStringFileInfo "Comments", S9, CP, LangID, True, True
        
      ResourcesProxy.CloseVersionInfo
      PEFileProxy.SaveAsNewImage ".\release\super_application.exe"
      else
        'Issue a warning in case of error
        PEFileProxy.PostDebugString "Can't open/create Version Info..."
      end if
    end if
  end if
end sub

SAMPLE SCRIPTS LIBRARY

Resource Tuner Console includes various examples that showcase its basic functionality and highlight the numerous features available. After installing Resource Tuner Console, you can access these examples in the Demo Scripts folder, located within the installation directory. The Demo Scripts folder contains 12 subdirectories, each containing sample scripts and executable files.

All sample scripts are pre-configured and ready to run. To execute a sample script, simply select one of the .BAT files within the Demo folders. The script will apply changes to a test EXE file. The modified file will be generated in a directory named "Release", which will be located within the same directory containing the script.

These examples provide hands-on experience and demonstrate the capabilities of Resource Tuner Console effectively. Happy experimenting with Resource Tuner Console's powerful features!

Check out the script examples to get an idea of what RTC can do for you.

The Complete Illustrated Step-by-Step Guide To Using Scripts

 

Have A Question?

Please check our FAQ section for answers to the most commonly asked questions.

If you have any questions about Resource Tuner Console, please contact us. We would love to get your feedback! Your opinion is of great use to us. This helps us focus our time on features people are really interested in.

 

Get Started with a 60-Day Free Trial

Download ResTuner Console and learn how it can make you more productive.

Download Resource Tuner Console Resource Tuner Console runs on all versions of Windows in use today: from 11 to XP, both 32-bit and 64-bit.