Top Description Constructors Methods
com.sun.jna.platform.win32

public Class VersionUtil

extends Object
Class Inheritance
Imports
com.sun.jna.Memory, .Native, .Pointer, com.sun.jna.platform.win32.VerRsrc.VS_FIXEDFILEINFO, .Version, .Win32Exception, com.sun.jna.ptr.IntByReference, .PointerByReference

Reads Windows Version info from files (the version details you can see by right-clicking and choosing properties)
Author
mlfreeman[at]gmail.com

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static VerRsrc.VS_FIXEDFILEINFO

Returns:

The VS_FIXEDFILEINFO structure read from the file.
Use the getFileVersionMajor(), getFileVersionMinor(), getFileVersionRevision(), and getFileVersionBuild()
getFileVersionInfo
(String
The path to the file
filePath
)

Gets the file's version number info

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

VersionUtilback to summary
public VersionUtil()

Method Detail

getFileVersionInfoback to summary
public static VerRsrc.VS_FIXEDFILEINFO getFileVersionInfo(String filePath)

Gets the file's version number info

Parameters
filePath:String

The path to the file

Returns:VerRsrc.VS_FIXEDFILEINFO

The VS_FIXEDFILEINFO structure read from the file.
Use the getFileVersionMajor(), getFileVersionMinor(), getFileVersionRevision(), and getFileVersionBuild()

Exceptions
UnsupportedOperationException:
if VerQueryValue fails to get version info from the file.