Skip to content

os.getversion

Jason Perkins edited this page May 15, 2015 · 3 revisions

Retrieve version information for the host operating system.

sysinfo = os.getversion()

Introduced in Premake 4.4, this function has not yet been implemented for all platforms. On platforms where this has not been implemented, it will return zero for all version numbers, and the platform name as the description.

Parameters

None.

Return Value

A table, containing the following key-value pairs:

majorversion The major version number
minorversion The minor version number
revision The bug fix release or service pack number
description A human-readable description of the OS version

Availability

Premake 4.4 or later.

Examples

local ver = os.getversion()
print(string.format(" %d.%d.%d (%s)",
   ver.majorversion, ver.minorversion, ver.revision,
   ver.description))

-- On Windows XP: "5.1.3 (Windows XP)"
-- On OS X,: "10.6.6 (Mac OS X Snow Leopard)"
Clone this wiki locally