'----------------------------------------------------------------------------
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 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 = "Hot product"
S4 = "Copyright \0xA9 2006 My Company, Inc."
S5 = "your trademarks here..."
S6 = "Super Editor"
S7 = "Powered by RT Console"
VersionInfoProxy.EditStringFileInfo "CompanyName", S1, CP, LangID, True, True
VersionInfoProxy.EditStringFileInfo "FileDescription", S2, CP, LangID, True, True
VersionInfoProxy.EditStringFileInfo "InternalName", S3, CP, LangID, True, True
VersionInfoProxy.EditStringFileInfo "LegalCopyright", S4, CP, LangID, True, True
VersionInfoProxy.EditStringFileInfo "LegalTrademarks", S5, CP, LangID, True, True
VersionInfoProxy.EditStringFileInfo "ProductName", S6, CP, LangID, True, True
VersionInfoProxy.EditStringFileInfo "Comments", S7, CP, LangID, True, True
VersionInfoProxy.EditStringFileInfo "OriginalFilename", File_Name, CP, LangID,
True, True
ResourcesProxy.CloseVersionInfo
PEFileProxy.Compile
PEFileProxy.SaveAsNewImage Dest_Path & File_Name
else
PEFileProxy.PostDebugString "Can't open/create Version Info..."
end if
end if
end if
end sub
'----------------------------------------------------------------------------------
'----------------------------------------------------------------------------------
'
' The main routine.
'
' First, it scans a spicified Source folder for EXE 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
' Path to Source Folder
Src_Path = ScriptUnit.CurrentFolder & "\demo\src\"
' Path to 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
'----------------------------------------------------------------------------------
|