Resourcen-Commands

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > RES. - EXE-Resourcen managen >

Resourcen-Commands

RES.Change Version

Previous Top Next


MiniRobotLanguage (MRL)

 

RES.Change Version

Add or change Version Information in an Executable File or DLL

 

 

Intention

 

This command is used to Add or Change Version Information in an Executable File or DLL.

Adding or changing is supported, even Multi-Language Resources can be added or changed.

 

Here is an Example:
 

 ' Sample changing Version Information

' Name and Path of the File into variable

VAR.$$FIA=?path\File.exe
' Tell command what do change

VAR.$$VER=LangId = 040704B0|ProductName=Package Robot|FileVersion=1.2.3.4.56|MainLangId = 040704B0

' Do changes

RES.Change Version|$$FIA|$$VER|1

ENR.

 

The special Version for German:

RES.Change Version DE|$$FIA|$$VER

will internally prefix the String with a "LangId = 040704B0|" and add a "|MainLangId=040704B0" at the end.

 

The special Version for English:

RES.Change Version EN|$$FIA|$$VER

will internally prefix the String with a "LangId = 040904B0|" and add a "|MainLangId=040904B0" at the end.

 

Note that the proper use of "MainLangID = xxxxxx" and "LangId = xxxxxx" is important.

 

Technically:

  “MainLangId” defines the "VarFileInfo" Block of the original Resources-File, that was used when the Executable was created..

 

BLOCK "VarFileInfo"

{

VALUE "Translation", 0x0407 0x04B0

VALUE "Translation", 0x0409 0x04B0

}

 

“LangId” defines a block inside the "StringFileInfo" Block of the original Resources-File, that was used when the Executable was created..

 

BLOCK "StringFileInfo"

{

BLOCK "040704B0"

{

VALUE "Comments", "[-De-] Comments"

VALUE "CompanyName", "[-De-] CompanyName"

}

BLOCK "040904B0"

{

VALUE "Comments", "[-En-] Comments"

VALUE "CompanyName", "[-En-] CompanyName"

}

}

 

About Lang-charset and string-name

Its important to use the proper MainLangId=xxxxxxxx. The values for all countries can be found in MSDN here:

 

MSDN StringFileInfo BLOCK

 

The values for the charactersets are in Decimal on the MSDN Page. These need to be converted to Hexadezimal.
 

Take  something like <BLOCK "040904E4">

note that the first half "0490" correspond to U.S. English, The second half "04E4" correspond to Multilingual (Decimal 1252).

Here you would write: MainLangId=049004E4

 

 

 

Syntax

 

RES.Change Version|P1|P2[|P3...|Px]

RES.Change Version en|P1|P2[|P3...|Px]

RES.Change Version de|P1|P2[|P3...|Px]

 
There are the following, functional equal short forms available:
 

RES.CV|P1|P2[|P3...|Px]

RES.CE|P1|P2[|P3...|Px]

RES.CD|P1|P2[|P3...|Px]

 

 

 

Parameter Explanation

 

P1 - Path of EXE-File or DLL-File

P2 - See Description below.

P3 - (num) 0/1/2/3  - Flag (default is 0)

      0 - no Backup, Refresh Explorer

      1 - make Backup before changing file, Refresh Explorer

      2 - do not "Refresh Explorer" do not make a Backup

      3 - do not "Refresh Explorer", but make a Backup

 

Description for P2:

 

P2 - Contains one or more "Subcommands", all in one String. All spearated by the Pipe-Symbol "|".

      You may start with:

     LangId = 040704B0|

 

         then follow with one or more of the Parmeters below.

 

         finally write:

    |MainLangId = 040704B0

         the given number is in Detail explained here: MSDN StringFileInfo BLOCK .

         It starts with a 4 digit Country-code (in Hexadezimal) then 4 digits characterset (Hexadezimal also!).

 

 

 Inside follow one or more of these Version-Strings followed with an "=" and a value:

- FileDescription

- FileVersion

- ProductName

- ProductVersion

- LegalCopyright

- LegalTrademarks

- OriginalFilename

- CompanyName

- Comments

 

All of these must be followed by an "=" and then the String that shall be assigned to this Version-Info.

If it is followed by more other "Subcommands" you need to delimit them with the Pipe-Symbol "|".

 

Example:

 

 LangId = 040704B0|ProductName=Package Robot|FileVersion=1.2.3.4.56|MainLangId = 040704B0

 

 

Example

 

'**********************************************

 ' Sample changing Version Information

VAR.$$EXE=File.exe

VAR.$$FIA=?path\$$EXE

VAR.$$VER=LangId = 040704B0|ProductName=Package Robot|FileVersion=1.2.3.4.56|MainLangId = 040704B0

RES.Change Version|$$FIA|$$VER|1

ENR.

 

 

 

Remarks

 

Please take care of these points.

 

1. Files may be protected or copyrighted

2. Signed files may loose their signature (but you may sign them yourself after the process)

3. If the process fails for whatever reason (Antivirus .. etc.) the result may be an unusable file!

Especially for this reason, always work on a copy of the original file!

4. Using the File-Version changing Commands will remove all file-version information that have been there before,

and replace them with your given data.  

 

 

Limitations:

 

-

 

 

See also:

 

  MSDN StringFileInfo BLOCK

  ! Ressourcen Commands

  RES. - Manage Resources

  RES.Refresh Explorer

  RES.Change Icon

  RES.Change Manifest

  RES.Extract All

  RES.Extract Icon

  RES.Extract Manifest

  RES.Extract Version

RES.Last Icon

  RES.Last Manifest

  RES.Last Version

  2.4.0. '#VER: - Version-Informations