Page 1 of 1

Get Exact OS Level

Posted: Fri Feb 01, 2013 6:51 am
by stefan.nieten
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

Re: Get Exact OS Level

Posted: Fri Feb 01, 2013 8:33 am
by FrancescoT
Dear Stefan,

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

Regards

Re: Get Exact OS Level

Posted: Fri Feb 01, 2013 9:58 am
by stefan.nieten
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

Re: Get Exact OS Level

Posted: Fri Feb 01, 2013 10:32 am
by FrancescoT
Dear Stefan,

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

Regards

Re: Get Exact OS Level

Posted: Fri Feb 01, 2013 10:42 am
by stefan.nieten
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

Re: Get Exact OS Level

Posted: Fri Feb 01, 2013 11:31 am
by FrancescoT
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

Re: Get Exact OS Level

Posted: Sat Feb 02, 2013 6:03 am
by stefan.nieten
Hi Francesco,

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

Greets,
Stefan

Re: Get Exact OS Level

Posted: Mon Nov 18, 2013 12:03 pm
by ulrichard
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.

Re: Get Exact OS Level

Posted: Tue Nov 19, 2013 7:33 am
by stefan.nieten
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

Re: Get Exact OS Level

Posted: Tue Nov 19, 2013 7:42 am
by stefan.nieten
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

Re: Get Exact OS Level

Posted: Tue Nov 19, 2013 1:12 pm
by FrancescoT
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