Deutsch Deutsch  
Heaventools Home Page
Product Overview Solutions Download Support Purchase About

 

  RESOURCE TUNER CONSOLE :: SAMPLE SCRIPTS
Command-line script driven resource editor

Product Name:

Resource Tuner Console (RTC)

Version:

1.70

Release Date:

September 10, 2008   [What's New]

Requirements:

Intel Pentium with 16 MB RAM (or higher)

Platforms:

 Windows 98, ME, NT4, 2000, XP, 2003, Vista

Price:

 $199 (Single Developer License)

Trial Version
Download

 Resource Tuner Console (2.00 Mb)


OVERVIEW

SOLUTIONS

DOWNLOAD

GETTING STARTED

SAMPLE SCRIPTS:
 
    • Overview
    • Process Folders
    • Test Script
    • Edit Icons
    • Edit Strings
 

ORDER NOW

REQUEST SUPPORT

ABOUT US

Process Folder

This sample VBScript code provides a real-world example that demonstrates many of the features available in Resource Tuner Console. This code shows how to batch process the contents of a directory.

The script scans the specified Source folder for EXE files available. Then, for each file found it calls for the ProcessFile procedure to set the English-US language for all of the resources in the file and update the Version Information. The resulted files are saved to the Destination folder.

'----------------------------------------------------------------------------
' ProcessFile
' 
' Purpose:
' 
' Processes a file: it sets the English-US language for all of the resources
' in the file, and modifies/adds a Version Information resource.
'----------------------------------------------------------------------------

Sub ProcessFile (Src_Path, Dest_Path, File_Name)
  LangID = 1033 ' English-US
  CP     = ScriptUnit.CodePageFromLangID(LangID)
  PEFileProxy.OpenFile Src_Path & File_Name
  If Not PEFileProxy.Terminated Then
    If PEFileProxy.HasResources Then 
      ResourcesProxy.SetLanguage LangID, DELETE_EXIST 
      If ResourcesProxy.OpenVersionInfo("1", LangID, CREATE_If_Not_EXIST) Then 
        VersionInfoProxy.SetFileVersion  2, 0, 1, 122, LangID, True, True, True
        VersionInfoProxy.SetProductVersion 2, 0, 0, 0, LangID, True, True, True
        S1 = "Copyright \0xA9 1994-2004 SuperSoftware Development" 
        S2 = "SuperProg is a trademark of SuperSoftware Development" 
        S3 = "This file modified by Resource Tuner Console" 
        VersionInfoProxy.EditStringFileInfo "LegalCopyright", S1, CP, LangID, True, True
        VersionInfoProxy.EditStringFileInfo "LegalTrademarks", S2, CP, LangID, True, True
        VersionInfoProxy.EditStringFileInfo "Comments", S3, 1049, LangID, True, True
        ResourcesProxy.CloseVersionInfo 
        PEFileProxy.Compile 
        PEFileProxy.SaveAsNewImage Dest_Path & File_Name 
      Else 
        PEFileProxy.PostDebugString "Failed to open/create Version Info..." 
      End If 
    End If 
  End If 
End Sub 
'------------------------------------------------------------------------------ 

'------------------------------------------------------------------------------ 
' 
' The main routine. 
' 
' First, it scans the specified Source folder for files available. 
' Then, for each file found it calls for the ProcessFile procedure. 
' 
'------------------------------------------------------------------------------ 
Sub Main 
  Dim Src_Path, Dest_Path, File_System_Object, Folder_Object, File_Object, File_Collection
  PEFileProxy.UpdateCheckSum = True 
  PEFileProxy.CreateBackUp   = False 
  ' Specify the path to the Source Folder 
  Src_Path = ScriptUnit.CurrentFolder & "\demo\src\" 
  ' Specify the path to the Destination Folder 
  Dest_Path = ScriptUnit.CurrentFolder & "\demo\release\" 
  ' Scan the specified folder, and then process all files found. 
  Set File_System_Object = CreateObject("Scripting.FileSystemObject") 
  Set Folder_Object      = File_System_Object.GetFolder(src_path) 
  Set File_Collection    = Folder_Object.Files 
  For Each File_Object In File_Collection 
    ProcessFile Src_Path, Dest_Path, File_Object.name 
    PEFileProxy.PostDebugString   "*******************************************" 
  Next 
End Sub 
'------------------------------------------------------------------------------

 

To see the changes made to the test EXEs, we recommend using Resource Tuner GUI, a visual resource editor.

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


 

Download Area    How To Order    Request Support    What's New    About Us    Site Map