PDA

View Full Version : Program's Own File Version


majik92
02-18-2007, 07:31 PM
How do you find the program's (exe) own file version?

I tried this, but it didn't work.


version = File.GetVersionInfo(SourceFolder .. "\\cbsoft.exe");
Label.SetText("Version Label", version);


I got an error saying that on Line 2, the second argument must be of "type string". What does that mean? Are there any other way? Thanks.

Dermot
02-18-2007, 08:54 PM
File.GetVersionInfo() returns a table so you need to use it like this.

Label.SetText("Version Label", version.FileVersion);

Look it up in the help file to see all the table vaules.

Darryl
02-19-2007, 08:57 AM
You should also change "SourceFolder" to "_SourceFolder" (without the quotes) in your file path.

majik92
02-19-2007, 05:29 PM
Thanks Dermot, I didn't know it returned a table. I thought it returned a string. And also, Darryl, in my actual project, I got it right, but it's a typo here, when I retyped it. Thanks anyway.