ProductMajorVersion Property

Applies to TestComplete 15.47, last modified on January 20, 2023

Description

Use the ProductMajorVersion property to get the major version number of the product that the file is associated with.

Declaration

aqFileVersionInfoObj.ProductMajorVersion

Read-Only Property Integer
aqFileVersionInfoObj An expression, variable or parameter that specifies a reference to an aqFileVersionInfo object

Applies To

The property is applied to the following object:

Property Value

An integer value that represents the product’s major version number.

Example

The following example posts Notepad’s product information to the test log:

JavaScript, JScript

function VersionInfoSample()
{
  var FileName = Sys.OSInfo.WindowsDirectory + "\\notepad.exe";
  var VerInfo = aqFileSystem.GetFileInfo(FileName).VersionInfo;

  Log.Message("Product name: " + VerInfo.ProductName);
  Log.Message("Product major version: " + VerInfo.ProductMajorVersion);
  Log.Message("Product minor version: " + VerInfo.ProductMinorVersion);
  Log.Message("Product build: " + VerInfo.ProductBuildVersion);
  Log.Message("Product revision: " + VerInfo.ProductRevisionVersion);
  Log.Message("Product full version: " + VerInfo.ProductFullVersion);
}

Python

def VersionInfoSample():
  FileName = Sys.OSInfo.WindowsDirectory + "\\notepad.exe"
  VerInfo = aqFileSystem.GetFileInfo(FileName).VersionInfo
  Log.Message("Product name: " + str(VerInfo.ProductName[0]))
  Log.Message("Product major version: " + str(VerInfo.ProductMajorVersion))
  Log.Message("Product minor version: " + str(VerInfo.ProductMinorVersion))
  Log.Message("Product build: " + str(VerInfo.ProductBuildVersion))
  Log.Message("Product revision: " + str(VerInfo.ProductRevisionVersion))
  Log.Message("Product full version: " + str(VerInfo.ProductFullVersion[0]))

VBScript

Sub VersionInfoSample
  Dim FileName, VerInfo

  FileName = Sys.OSInfo.WindowsDirectory & "\notepad.exe"
  Set VerInfo = aqFileSystem.GetFileInfo(FileName).VersionInfo

  Log.Message "Product name: " & VerInfo.ProductName
  Log.Message "Product major version: " & VerInfo.ProductMajorVersion
  Log.Message "Product minor version: " & VerInfo.ProductMinorVersion
  Log.Message "Product build: " & VerInfo.ProductBuildVersion
  Log.Message "Product revision: " & VerInfo.ProductRevisionVersion
  Log.Message "Product full version: " & VerInfo.ProductFullVersion
End Sub

DelphiScript

procedure VersionInfoSample;
var FileName, VerInfo;
begin
  FileName := Sys.OSInfo.WindowsDirectory + '\notepad.exe';
  VerInfo := aqFileSystem.GetFileInfo(FileName).VersionInfo;

  Log.Message('Product name: ' + VerInfo.ProductName);
  Log.Message('Product major version: ' + VarToStr(VerInfo.ProductMajorVersion));
  Log.Message('Product minor version: ' + VarToStr(VerInfo.ProductMinorVersion));
  Log.Message('Product build: ' + VarToStr(VerInfo.ProductBuildVersion));
  Log.Message('Product revision: ' + VarToStr(VerInfo.ProductRevisionVersion));
  Log.Message('Product full version: ' + VerInfo.ProductFullVersion);
end;

C++Script, C#Script

function VersionInfoSample()
{
  var FileName = Sys["OSInfo"]["WindowsDirectory"] + "\\notepad.exe";
  var VerInfo = aqFileSystem["GetFileInfo"](FileName)["VersionInfo"];

  Log["Message"]("Product name: " + VerInfo["ProductName"]);
  Log["Message"]("Product major version: " + VerInfo["ProductMajorVersion"]);
  Log["Message"]("Product minor version: " + VerInfo["ProductMinorVersion"]);
  Log["Message"]("Product build: " + VerInfo["ProductBuildVersion"]);
  Log["Message"]("Product revision: " + VerInfo["ProductRevisionVersion"]);
  Log["Message"]("Product full version: " + VerInfo["ProductFullVersion"]);
}

See Also

ProductName Property
ProductMinorVersion Property
ProductBuildVersion Property
ProductRevisionVersion Property
ProductFullVersion Property

Highlight search results