Page 1 of 1 1
Topic Options
#133092 - 2005-01-27 09:12 PM Find a file and its version
mrsession Offline
Lurker

Registered: 2005-01-27
Posts: 1
I am totally new to Kixtart, scripting the whole nine yards. basically i'm scripting illiterate. what i want to do is create a script which essentially looks for a known file and its version. If the file is there and is an old version it will install the new update, if the file is not there at all it will simply install. I know my network shares and how to get back to the installation source but i don't have a clue on how the syntax should look. Please help!
Top
#133093 - 2005-01-27 09:17 PM Re: Find a file and its version
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Take at look at out FAQ forum for the basics of how to use KiXtart.

Have your reviewed the manual for the functions:

Exist( )

Action: Checks for the existence of one or more files.

Syntax: Exist ("file name")

Parameters: File name
Identifies the file(s) you want to locate.

Remarks: Supports wildcards.

Returns: 0
File not found

1
File found



Examples: IF EXIST (@LDRIVE + "\users.txt")
DISPLAY @LDRIVE + "\users.txt"
ENDIF

IF EXIST (@LDRIVE + "\*.INI")
; Etc, etc.
ENDIF


GetFileVersion( )

Action: Returns a version information string of a file.

Syntax: GETFILEVERSION ("file name",”versionfield”)

Parameters: File name
Identifies the file for which you want to get the version string.

Versionfield

Optional parameter identifying the specific version information field that should be retrieved. By default, the FileVersion field is returned. Possible values for this field are:

BinFileVersion Returns a string representation of the binary file version information (e.g.: "4.22.0.0").

BinProductVersion Returns a string representation of the binary product version information (e.g.: "4.22.0.0").

Comments Contains any additional information that should be displayed for diagnostic purposes.

CompanyName Identifies the company that produced the file. For example, "Microsoft Corporation" or "Standard Microsystems Corporation, Inc."

FileDescription Describes the file in such a way that it can be presented to users. This string may be presented in a list box when the user is choosing files to install. For example, "Keyboard driver for AT-style keyboards" or "Microsoft Word for Windows".

FileVersion Identifies the version of this file. For example, "3.00A" or "5.00.RC2".

InternalName Identifies the file's internal name, if one exists. For example, this string could contain the module name for a dynamic-link library (DLL), a virtual device name for a Windows virtual device, or a device name for an MS-DOS device driver.

Language Full English name of the language of the file specified in the format defined by ISO Standard 639. (example : "0413Dutch (Standard)").

LegalCopyright Describes all copyright notices, trademarks, and registered trademarks that apply to the file. This should include the full text of all notices, legal symbols, copyright dates, trademark numbers, and so on. In English, this string should be in the format "Copyright Microsoft Corp. 1990–1994".

LegalTrademarks Describes all trademarks and registered trademarks that apply to the file. This should include the full text of all notices, legal symbols, trademark numbers, and so on. In English, this string should be in the format "Windows is a trademark of Microsoft Corporation".

OriginalFilename Identifies the original name of the file, not including a path. This enables an application to determine whether a file has been renamed by a user. This name may not be MS-DOS 8.3-format if the file is specific to a non-FAT file system.

PrivateBuild Describes by whom, where, and why this private version of the file was built. For example, "Built by OSCAR on \OSCAR2".

ProductName Identifies the name of the product with which this file is distributed. For example, this string could be "Microsoft Windows".

ProductVersion Identifies the version of the product with which this file is distributed. For example, "3.00A" or "5.00.RC2".

SpecialBuild Describes how this version of the file differs from the normal version. For example, "Private build for Olivetti solving mouse problems on M250 and M250E computers".

Remarks: The information returned by this function is the same as the version information displayed in Windows Explorer.
This function applies only to 32-bit Windows – based executable files.


Returns: A string representing the file version field.

See Also: GetFileAttr( ), GetFileSize( ), GetFileTime( )

Examples: $Result = GetFileVersion(@LDRIVE + "\Kix32.exe")
$Result = GetFileVersion(@LDRIVE + "\Kix32.exe", "ProductVersion" )


_________________________
Home page: http://www.kixhelp.com/hb/

Top
#133094 - 2005-01-27 09:34 PM Re: Find a file and its version
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
see the UDF FreshFile()
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#133095 - 2005-01-30 02:58 PM Re: Find a file and its version
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Or UpdateFile() - Updates file if fileversion or filetime is different , which checks for both file version and dates.
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 363 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.049 seconds in which 0.013 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org