Get Exact OS Level

Got a problem you cannot solve? Try here.
stefan.nieten
Posts: 15
Joined: Fri Feb 01, 2013 5:23 am

Get Exact OS Level

Postby stefan.nieten » Fri Feb 01, 2013 6:51 am

Hi,

we're using the function Get Exact OS Level to detect the windows version in our installer code.

It returns strings like e.g. "SEVEN" or "2008R2". Could you please tell me where the function take the windows version information from. Is it directly taken from the registry or do you use a win api function?

Thanks in advance!

Greets,
Stefan

FrancescoT
Site Admin
Posts: 5360
Joined: Sun Aug 22, 2010 4:28 am

Re: Get Exact OS Level

Postby FrancescoT » Fri Feb 01, 2013 8:33 am

Dear Stefan,

Please have a look at the following form topic;
http://www.installaware.com/forum/viewtopic.php?f=2&t=9363

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

stefan.nieten
Posts: 15
Joined: Fri Feb 01, 2013 5:23 am

Re: Get Exact OS Level

Postby stefan.nieten » Fri Feb 01, 2013 9:58 am

Hi Francesco,

thank you for your reply. Good to know.

But could you tell me how the Get Exact OS Level really works? It would be great to know from where it takes the version information from.

Thanks and Greets,
Stefan

FrancescoT
Site Admin
Posts: 5360
Joined: Sun Aug 22, 2010 4:28 am

Re: Get Exact OS Level

Postby FrancescoT » Fri Feb 01, 2013 10:32 am

Dear Stefan,

InstallAware use the same WINAPI but instead of returning the OS number identifier, it returns a string.

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

stefan.nieten
Posts: 15
Joined: Fri Feb 01, 2013 5:23 am

Re: Get Exact OS Level

Postby stefan.nieten » Fri Feb 01, 2013 10:42 am

Hi Francesco,

ah okay allright.

Is it also possible in InstallAware to get the Major Version from the DWORD value which the GetVersion function returns?

Thanks in Advance!

Greets,
Stefan

FrancescoT
Site Admin
Posts: 5360
Joined: Sun Aug 22, 2010 4:28 am

Re: Get Exact OS Level

Postby FrancescoT » Fri Feb 01, 2013 11:31 am

Dear Stefan,

You should use the "Mathematics" IA command to perform a BitWise operation on the value returned by the WINAPI function.

To know in which way this has to be applied to the given value, please refer to MSDN documentation about "LOBYTE" & "HIBYTE" macros.

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

stefan.nieten
Posts: 15
Joined: Fri Feb 01, 2013 5:23 am

Re: Get Exact OS Level

Postby stefan.nieten » Sat Feb 02, 2013 6:03 am

Hi Francesco,

okay i'll have a look at this. Thank you very much!

Greets,
Stefan

ulrichard
Posts: 150
Joined: Thu Dec 27, 2007 5:45 am
Location: Switzerland
Contact:

Re: Get Exact OS Level

Postby ulrichard » Mon Nov 18, 2013 12:03 pm

Did you succeed with that approach?
I get a big number from GetVersion, but trying to perform any Mathematics operation on it always returns an empty string.
http://www.pointline.com
http://www.paraeasy.ch
http://ulrichard.ch

stefan.nieten
Posts: 15
Joined: Fri Feb 01, 2013 5:23 am

Re: Get Exact OS Level

Postby stefan.nieten » Tue Nov 19, 2013 7:33 am

Hi ulrichard,

yes with this code you should get the major and minor os version:

~InstallAware Clipboard Data~
~End~
~{D47856D1-A3A3-4EE7-A298-4107887853B1}~
~MessageBox~
~{9F6588E0-3ADE-4F97-BB59-68B3B09E963A}~
~$TITLE$ Setup Error~
~Unable to detect the OS Version. $NEWLINE$$NEWLINE$The Kernel32.dll function GetVersion returned 0.$NEWLINE$$NEWLINE$Setup cannot continue.~
~3~
~1~
~~
~Else~
~{C0BB8F39-49E2-4D2F-8BDD-68EA7D4BFDB1}~
~Mathematics~
~{D2735E79-EAEC-419F-893D-7C1A6136E7CE}~
~$OS_VERSION_LOW_WORD$~
~8~
~9~
~OS_VERSION_MINOR~
~Mathematics~
~{9C67AD34-07BE-41AB-97E2-48B82A287472}~
~$OS_VERSION_LOW_WORD$~
~255~
~5~
~OS_VERSION_MAJOR~
~Mathematics~
~{B5057DED-8895-4094-A39C-A5E8A0097719}~
~$OS_VERSION$~
~16~
~9~
~OS_VERSION_HIGH_WORD~
~Mathematics~
~{86CEE8DD-BEEF-44FA-95F3-568C86F137F9}~
~$OS_VERSION$~
~65535~
~5~
~OS_VERSION_LOW_WORD~
~If~
~{0E972074-727E-4BB0-8FB3-D159633354EA}~
~OS_VERSION~
~0~
~0~
~TRUE~
~Call DLL Function~
~{3145C9BB-38F4-4CD1-BC25-0FA8E5B1D7C6}~
~Kernel32.dll,GetVersion,"double word",OS_VERSION,$~
~mIDEFunc.dll\mEXEFunc.dll~
~Comment~
~{8A90410F-CF50-4E3D-A132-8C1E9E2ABE7B}~
~WinApi GetVersion~
~Set Variable~
~{CC332351-3B2A-4B8B-ADEC-E6CB4700EBB4}~
~OS_VERSION_MINOR$MYAH$MYAH$FALSE~
~0~
~Set Variable~
~{A4E2F3EA-EF7B-42A3-9D53-B4C5CBCFF29E}~
~OS_VERSION_MAJOR$MYAH$MYAH$FALSE~
~0~
~Set Variable~
~{DBF3268A-368A-4E9B-90CB-8BD8B89E80A5}~
~OS_VERSION_HIGH_WORD$MYAH$MYAH$FALSE~
~0~
~Set Variable~
~{368A1B81-1756-4778-BDB8-1BF525BF6B22}~
~OS_VERSION_LOW_WORD$MYAH$MYAH$FALSE~
~0~
~Set Variable~
~{2AD9578D-1833-4FA4-8233-2BB87A5FD990}~
~OS_VERSION$MYAH$MYAH$FALSE~
~0~

regards,
Stefan

stefan.nieten
Posts: 15
Joined: Fri Feb 01, 2013 5:23 am

Re: Get Exact OS Level

Postby stefan.nieten » Tue Nov 19, 2013 7:42 am

Hi Francesco,

I have a new question on this topic.

Microsoft announced that the WinApi function GetVersion and GetVersionEx may be altered or completly unavailable for Windows versions greater than 8.1.
http://msdn.microsoft.com/en-us/library ... 85%29.aspx

Instead of them there will be new helper function for checking the OS version.
http://msdn.microsoft.com/en-us/library ... 85%29.aspx

Does InstallAware 18 already support the new helper functions or other functionality, so that this will be no future problem. We are currently evaluating InstallAware 18 and this would be a good reason to upgrade.

Thanks and greets,
Stefan

FrancescoT
Site Admin
Posts: 5360
Joined: Sun Aug 22, 2010 4:28 am

Re: Get Exact OS Level

Postby FrancescoT » Tue Nov 19, 2013 1:12 pm

Dear Stefan,

in reality and for what I recall, at least are more then 3 years that this function is marked as possibly obsolete ... they constantly update the OS from which it could be unavailable.

Of course InstallAware now uses internally the new one.

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 42 guests