FileFlags Property

Applies to TestComplete 14.40, last modified on April 22, 2021

Description

A file can be either a release version or a modification of the original file. The FileFlags property holds the file flags indicating whether it is a debug build, a private build and so on.

Declaration

aqFileVersionInfoObj.FileFlags

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 indicates the module attributes. If the file is a release version, the property holds 0. Otherwise it holds one or a combination of constants listed in the following table (these constants are defined in the Win32API object). Multiple values are combined using the bitwise OR operator.

Constant Value Description
VS_FF_DEBUG 1 The file contains debug information or is compiled with debugging features enabled.
VS_FF_PRERELEASE 2 The file is a development version rather than release version.
VS_FF_PATCHED 4 The file has been patched and differs from the original file of the same version number.
VS_FF_PRIVATEBUILD 8 The file was not built using standard release procedures. Use the PrivateBuild property to get the private build information for the file.
VS_FF_SPECIALBUILD 32 The file is a special build. Use the SpecialBuild property to get the special build information for the file.

To check if the file has a specific attribute, perform the bitwise AND check on the FileFlags property value and the value corresponding to the desired attribute (see the example below).

Example

The following example checks if a file is a special build and if so, posts the special build information to the test log:

JavaScript, JScript

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

  if ((VerInfo.FileFlags & VS_FF_SPECIALBUILD) == VS_FF_SPECIALBUILD)
    Log.Message("The file is a special build:" + VerInfo.SpecialBuild)
  else
    Log.Message("The file is not a special build.");
}

Python

def VersionInfoSample():
  FileName = Sys.OSInfo.WindowsDirectory + "\\notepad.exe"
  VerInfo = aqFileSystem.GetFileInfo(FileName).VersionInfo
  if (VerInfo.FileFlags & VS_FF_SPECIALBUILD) == VS_FF_SPECIALBUILD:
    Log.Message("The file is a special build:" + str(VerInfo.SpecialBuild))
  else:
    Log.Message("The file is not a special build.")

VBScript

Sub VersionInfoSample
  Dim FileName, VerInfo

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

  If (VerInfo.FileFlags And VS_FF_SPECIALBUILD) = VS_FF_SPECIALBUILD Then
    Log.Message "The file is a special build:" & VerInfo.SpecialBuild
  Else
    Log.Message "The file is not a special build."
  End If
End Sub

DelphiScript

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

  if (VerInfo.FileFlags and VS_FF_SPECIALBUILD) = VS_FF_SPECIALBUILD then
    Log.Message('The file is a special build:' + VerInfo.SpecialBuild)
  else
    Log.Message('The file is not a special build.');
end;

C++Script, C#Script

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

  if ((VerInfo["FileFlags"] & VS_FF_SPECIALBUILD) == VS_FF_SPECIALBUILD)
    Log["Message"]("The file is a special build:" + VerInfo["SpecialBuild"])
  else
    Log["Message"]("The file is not a special build.");
}

See Also

PrivateBuild Property
SpecialBuild Property

Highlight search results