I develop a MapInfo-based GIS and I need to be able to determine the Windows OS of a given user. So far we have used a Windows function
kernel32 library) to do this but the function doesn't behave properly from Windows 8.1 onwards...unless you do Application Manifesting which I'd rather not mess around with unless absolutely necessary.
As an alternative I found a post suggesting to use
GetProductInfo instead but I don't know how to set this up in MapBasic.
GetVersionEx function is first defined like this:
Type OSVERSIONINFO dwOSVersionInfoSize As integer dwMajorVersion As integer dwMinorVersion As integer dwBuildNumber As integer dwPlatformId As integer szCSDVersion As String * 128 End Type Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As integer
(OSVersionInfo documentation here)
And then called in MapBasic:
Dim OSInfo as OSVersionInfo Dim nRet,iMaj_Version As Integer 'Set the structure size OSInfo.dwOSVersionInfoSize = 148 'Len(OSInfo) 'Get the Windows version iRet = GetVersionEx(OSInfo) 'get values e.g.: iMaj_Version = OSInfo.dwMajorVersion
so it will be similar to this I expect...but I don't know how the new function needs to be defined or how I then get the output in to a MapBasic variable.
Finally, we are using the 32-bit version of MapInfo so for the time being I'm not interested in potential help/solutions for the 64-bit version.