Archive: Get Windows Details using Kernel API


Get Windows Details using Kernel API
Hi all,

I want to get the windows information as type of OS running and its service pack.

As I saw in the NSIS's GetWindowsVersion Function, it reads the "CurrentVersion" and "VersionNumber" registry keys for getting all these information.

Instead of this, Is there any Kernel API that I can call for getting the Windows Version and Windows Service Pack.

Because in case of Windows XP Polish OS the value of CSDVersion registry key is different than other OS.

Regards
VCR


http://msdn.microsoft.com/library/de...tversionex.asp

-daz


Thanks for reply,

as the msdn code says to get the OS version info we have to do the following procedure:

code
___________________________________________________________
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx (&osvi);
bIsWindowsXPorLater =
( (osvi.dwMajorVersion > 5) ||
( (osvi.dwMajorVersion == 5) && (osvi.dwMinorVersion >= 1) );
__________________________________________________________

How can I intergate these code inside NSIS script. As the above code says to make an object of "OSVERSIONINFO" structure and than call GetVersion...

or do I have go for a Windows DLL or Windows EXE file.

Please suggest me.

Regards
VCR


This is link to stat sample script, includes struct memory allocation and API call. You can do the same tricks for ver.info. System plug-in Readme may be also usefull http://nsis.sourceforge.net/archive/...ances=0,11,211