SplitScript reference / Module / productVersion

Module.productVersion

Method

Module.productVersion() -> FileVersion!

Reads the product identity from a Windows PE version resource.

Product versions can remain stable across modules whose individual file versions differ. Missing resources, malformed images, and failed reads are errors.

Effects: reads process memory, requires an attached process

Runtime behavior: available while a process is attached, except in onDetach; synchronous

Examples

Select a known product version

let executable = await process.mainModule()
let version = executable.productVersion() else return
if version == v"2.0.0.0" {
    print("recognized product version 2.0.0.0")
}