Skip to content
⌘ NSIS Forum Archive

GetVersion plugin

73 posts

Afrow UK#

GetVersion plugin

A 4kB plugin to get Windows version info:
name, type, version, server name, service pack name, and service pack build.



Type is e.g. Home Edition

Edit: I could add other version info stuff later if anyone needs it (i.e. non Windows version stuff).

-Stu
Afrow UK#edited
I didn't call it that because I may add other version stuff to it, e.g. IE version or perhaps Microsoft Office etc.

Edit: Just added IEVersion which returns IE version and build.

-Stu
Afrow UK#
New version with support for x64, Longhorn, Vista.
Also added WindowsPlatformId and WindowsPlatformArchitecture functions.



-Stu
sissy#
stu

Great plugin just one slight problem it reports windows media center editon as XP which it is to a degree but would be nice if it could also detect this.

thanks
Afrow UK#
Please try this out (WindowsType function).


-Stu
sissy#
Hi Stu,

Still reports as Windows XP.

Found this, might give a heads up http://salloway.org.uk/mediacenter/2004/version.htm

Looks like they read the ident key

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center\Ident key

and depending on the value returned determines the version and any patches.

Hope this helps.
o_owd#
hello,
i was using a plugin for windows detection but it is outdated. so i turned to GetVersion.
my software is only for NT platform (NT, 2000, XP, 2003, Vista). can i make a check for this with your plugin ?
i want the installer to check the platform (9x or NT) and ... i'll do the rest... 🙂

one more question. what is WindowsPlatformId from your plugin ?

thanks,
OJi.
Afrow UK#
1) GetVersion::WindowsName will return e.g. "Windows 2000"
2) Each Windows has a different Platform ID, like 1 2 3 etc. You should be able to find something about this on Google.

-Stu
Afrow UK#
I am going to rebuild the plugin just to return 2000 if /short is specified as a parameter.

Edit: Now returns e.g. 2000 instead of Windows 2000.

-Stu
o_owd#
thanks, i will try it.

OJi.

edit - the version from wiki is still from april. please post a reply when you upload the new version.
Afrow UK#
Uploaded.

By the way, the DLL uses .NET because some of its features are only supported by .NET (i.e. Vista detection).
So, you might want to test the DLL on a system without Microsoft .NET Framework installed.

-Stu
{_trueparuex^}#
Originally posted by Afrow UK
Uploaded.

By the way, the DLL uses .NET because some of its features are only supported by .NET (i.e. Vista detection).
So, you might want to test the DLL on a system without Microsoft .NET Framework installed.

-Stu
I tried the plug-in in Windows 2000 pro without .NET and it works. Only thing is that WindowsServerName doesn't return anything, no errors nothing.
{_trueparuex^}#
Originally posted by Afrow UK
What would have expected it to return?
There may be a bug.

-Stu
Not sure, but it should return Workstation.
Comperio#
FYI:
I just downloaded your latest version and found that IE detection is returning 6.0 when I have 7.0 installed.
Afrow UK#
I may remove that function. You can read the IE version from the registry. Infact there's a function in the NSIS documentation under Useful Scripts which reads from the registry. Does that work?

-Stu
Afrow UK#
The plugin function reads the version value from shdocvw.dll
I guess they have left it as 6.0 or something.

-Stu
Comperio#
Yep, right you are. I just checked mine and it is version 6.0.2900.2919.

edit:
Just to let you know, I've OK with just reading the registry. I only mentioned the problem because you had a feature that didn't work as designed. 😉
Hywkar#
Is there an easy way to detect if the operating system is windows server 2000? I tried the latest release and on windows 2000 server it gives me "Windows 2000 version 5.0 (Type : Professional, Server Name : )".



GetVersion::WindowsName
Pop $0
GetVersion::WindowsType
Pop $1
GetVersion::WindowsServerName
Pop $2
GetVersion::WindowsVersion
Pop $3

DetailPrint "Windows $0 version $3 (Type : $1, Server Name : $2)"
MP_chefkoch#
Hi Stuart,

you posted that you maybe will include more products or version checks.

What do you think about including a version check for .Net, which will work with dotNet 1, 2 and 3.

In wiki is a script which is able to do that and it seems to work like a charme, but maybe it would be cool to have it in this plugin, so no additional scripts are needed.

kind regards
chefkoch