Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Version function???

Status
Not open for further replies.

TheBigD

Programmer
Sep 12, 2000
10
US
Is there a function to return the version of the exe that I have compiled?

I would like to show the version in my app.

Thanks,
Dennis [sig][/sig]
 
Maybe there is a SYS() function for your problem look in de VFP help file for more info. [sig][/sig]
 
Here you go...if others find this useful, I'll put it in the FAQ:

Code:
lParameters LFULLDESCRIPTION

Local AFILEINFO	&& array to hold file information
Local LGOODINFO	&& good getfileversion() flag
Local CRETVAL	&& return value

Dimension AFILEINFO[12,1]

If NOT "foxtools" $ LOWER(SET("library"))
	set LIBRARY TO FOXTOOLS.FLL ADDITIVE
Endif

LGOODINFO = GETFILEVERSION(SYS(16,1), @AFILEINFO) >= 0
If LGOODINFO		&& GetFileVersion performed OK
	If LFULLDESCRIPTION   && give full info
		CRETVAL = AFILEINFO(10,1) + " " + ;
		AFILEINFO(4,1) + " " + iif(type('gcPatchLetter')="C", gcPatchLetter, "") +;
		AFILEINFO(3,1) + " " + ;
		AFILEINFO(1,1) + " " + ;
		CHR(169) + AFILEINFO(6,1)
	Else
		CRETVAL = AFILEINFO(4,1)   && version only
	Endif
Else
	CRETVAL = ""
Endif

Return CRETVAL
[sig]<p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br> [/sig]
 
FAQ it!

Do you have one that works w/o filer? Most all my apps are distributed. [sig]<p> Pete<br><a href=mailto:blindpete@mail.com>blindpete@mail.com</a><br><a href= > </a><br>What your mother told you is true! You will go blind! (from moonshine anyway)[/sig]
 
oops I meant foxtools.fll [sig]<p> Pete<br><a href=mailto:blindpete@mail.com>blindpete@mail.com</a><br><a href= > </a><br>What your mother told you is true! You will go blind! (from moonshine anyway)[/sig]
 
I'm pretty sure you can distribute FOXTOOLS.FLL. My current client does, and so have I in the past. A quick check of the VFP help's Distribution section did not list it as a forbidden file. [sig]<p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br> [/sig]
 
so be it! :) [sig]<p> Pete<br><a href=mailto:blindpete@mail.com>blindpete@mail.com</a><br><a href= > </a><br>What your mother told you is true! You will go blind! (from moonshine anyway)[/sig]
 
In my code a few posts above, remove references to gcPatchLetter. My goof; the FAQ version is more correcter, and has a few more comments.

There is probably a Windows API function that will do this as well; the WINAPI call is obviously not as convenient, but it would allow you to retrieve the info on non-running, non-VFP EXEs as well. [sig]<p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br> [/sig]
 
Do you have one that works w/o filer?

FWIW, GetFileVersion was made a native VFP function in release 6.

Check out AGetFileVersion() function in the VFP 6 help file. [sig]<p>Jon Hawkins<br><a href=mailto: jonscott8@yahoo.com> jonscott8@yahoo.com</a><br><a href= > </a><br>Focus on the solution....Not the problem.[/sig]
 
He shoots, HE SCORES! I looked for the same function name in the current help, so I didn't catch the AGetFileVersion() variation.

Obviously, folks, the internal version is the way to go. The FoxTools version is still useful for VFP 5, though. [sig]<p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br> [/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top