Forum Discussion

scsvel's avatar
Frequent Contributor
13 years ago

How to get latest Microsoft .Net Version installed?

Hi all,

I want to get the information about latest .Net framework installed in TestComplete. Can anyone give me idea?

Tried below ways.

1. I can read it from Registry. But there, different folders will be available for all versions. So I can't pass particular registry path to read.

2. navigator.userAgent - Read it from internet but its giving error. Not executing.

Anybody correct me or give me any ideas?

Also I need Java Version also.


1 Reply

  • ArtemS's avatar
    SmartBear Alumni (Retired)
    Hi Shanmugavel,

    To get the version of the installed .Net Framework, you can use the OSInfo.NetCoreVersion property:

    netVer = Sys.OSInfo.NetCoreVersion(Sys.OSInfo.NetCoreCount - 1)

    The version of Java Runtime Environment can be retrieved from the registry (the HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\CurrentVersion key):

    jreVer = Storages.Registry("Software\\JavaSoft\\Java Runtime Environment", HKEY_LOCAL_MACHINE, 0, true ).GetOption("CurrentVersion", "not specified");

    Best regards,