Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Retrieving Version Info
Message
From
28/10/1997 15:53:57
Rob Gordon
Xon Digital Communications Ltd.
Dartmouth, Nova Scotia, Canada
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00056570
Message ID:
00057103
Views:
36
>>>>I need to access the Version, Major and Minor revision information stored in an Application (either VFP or otherwise). There is a Win32API call call GetFileVersionInfo (and GetFileVersionInfoSize) which should do the job. Unfortunately, they require a library called version.lib ..which I have .. but can't seem to access.
>>>>
>>>>If I use a DECLARE GetFileVersionInfo in WIN32API the function is not found.
>>>>
>>>>If I use a DECLARE GetFileVersionInfo in version.lib VFP doesn't complain untill I try to access it .. I get a "Cannot load 32bit DLL Version.lib" message
>>>>
>>>>As a work around , I'm accessing the VFP project file (the devinfo field - last 19 bytes) and writing the info to an INI file after each build. This doesn't help with other Apps obviously.
>>>>
>>>>Any ideas ??
>>>
>>>Rob,
>>>
>>>The reason you can't DECLARE these functions like that is that they're not part of what's considered to be (by VFP) the Win32 API. This includes the GDI32, KERNAL32, and USER32 DLLs. GetFileVersionInfo is in VERSION.DLL, as is the other function.
>>>
>>>But why fool around with the API and have to fool around with converting a structure to meaningful information. Try this, load the FOXTOOLS library. Then:
>>>
>>>* lcfile is a previously defined fully qualified
>>>* file name
>>>DIMENSION a_version[12]
>>>= GetFileVersion(lcfile, @a_version)
>>>
>>>You should have all the information you need from this. For more information, check the FOXTOOLS.HLP file.
>>>
>>>hth,
>>>
>>>George
>>
>>Thanks .. You know I could have sworn that there was a function like this in FoxTools but I originally didn't see it there. The only problem is that is doesn't give you the Build Date of the App. When the app is installed, the date on the file is the install date. The only alternative is to have a "version.ini" file included in the project which contains version info + file build dates etc.
>
>
>Rob,
>
>While you don't get a build date, you do get a build number. If you were to programmatically build the executable, you could retrieve the build number and match it up with the system date and time. I'd suggest storing the information in a table, and adding a field with information regarding the reason for the build or anything else pertinent.
>
>George

Yeah .. that's sort of what I'm doing already. Before each build I check the project pjx file for the version info (devinfo field I believe) and write it (along with the current date and time) into a "VERSION.INI" file that is included in the project. I then reference this file from within the App to display an "About" box.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform