Class: cVersionInfo
Properties | Events | Methods | Index of Classes
Contains information relating to the application's embedded Version Information resources
Hierarchy
cObject > cVersionInfo
Show full hierarchy and direct subclasses
- cObject
- cVersionInfo
Library: Common Class Library
Package: cVersionInfo.pkg
Description
Use this class to determine whether Version Information was embedded into an application, and if it was, to retrieve information from it.
To be able to access version information of an application, the project must be configured to embed version information by checking the 'Include version information in build' checkbox in the Studio's Version tab in Project Properties.
| Col 1 | Col 2 |
|---|---|
| Note: | The cApplication class automatically instantiates an object of this class (and exposes it through its phoVersionInfo property), so typically you do not need to create objects of this class directly. |
To test if Version Information was included, use the pbIncluded property. To retrieve the build numbers, use the piVersionMajor, piVersionMinor, piVersionRelease and piVersionBuild properties. The pbSpecialBuild and pbPrivateBuild properties will indicate whether the application was flagged as being either "Special" or "Private" when it was compiled.
To read version information about a different application than the current one, use the DoCreate method.
Sample
This sample shows how to retrieve Version Information that was embedded in an application.
Object oApplication is a cApplication
Procedure OnCreate
Boolean bIncluded
Handle hoVersionInfo
Get phoVersionInfo To hoVersionInfo
Get pbIncluded of hoVersionInfo To bIncluded
If bIncluded Begin
Showln "Special build=" (pbSpecialBuild(hoVersionInfo))
Showln "Private build=" (pbPrivateBuild(hoVersionInfo))
Show "Build=" (piVersionMajor(hoVersionInfo)) "."
Show (piVersionMinor(hoVersionInfo)) "."
Show (piVersionRelease(hoVersionInfo)) "."
ShowLn (piVersionBuild(hoVersionInfo))
End
Else ;
Showln "Sorry, Version Information was not embedded in the application"
End_Procedure
End_Object
See Also