PDA

View Full Version : Safe way to check for XP service pack



sphair
11-27-2006, 07:08 AM
I need to figure out if user is on Windows XP, and which service pack.

I use Get System Information(Service Pack Number) to get the service pack number, but I'm unsure what to use to tell if user is on a Window XP OS ?

linder
11-27-2006, 07:13 AM
Hello,

You have several options here. The easiest one (IMO) is to check the %WINVER% variable value. If the value is $WINXP$ (see Common Definitions.sbi) then the machine is running XP.

So you can use:

If %WINVER% Equals "$WINXP$" Then
you are running xp
End

Does this help?

sphair
11-27-2006, 07:24 AM
Thanks!

Is it also possible to get the language of the Windows install? (Not current selected language, but which language version of the OS was installed)

linder
11-27-2006, 07:36 AM
Hello,

Yes, please try the %CURLNG% variable. It returns the currently active Windows language ID.

Does this help?

linder
11-27-2006, 07:41 AM
BTW, another cool way is to use Get File Information (File Language) on kernel32.dll ;-)

For example:

Set Variable %OSLANGUAGE% to ScriptItem->Get File Information(File Language (Resource)) of file "%SYS32DIR%\kernel32.dll"

sphair
11-27-2006, 07:45 AM
This returns 1044 for me, which is according to your manual: Norwegian (Bokmal) 1044

Now, my current language setting in Windows IS 1044 Norwegian, but my Windows installation is in English. And this is what I need to find out..

linder
11-27-2006, 07:51 AM
My second idea should work because it returns the language used to compile that Windows version :)

sphair
11-27-2006, 07:51 AM
Yes, it worked. Didn't see that reply before I had sent the answer :) You're too fast Friedrich :)

NewsArchive
11-27-2006, 07:58 AM
<G> Thank you :)

Friedrich