Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows version detect issue #5

Open
GoldRenard opened this issue Aug 8, 2015 · 8 comments
Open

Windows version detect issue #5

GoldRenard opened this issue Aug 8, 2015 · 8 comments

Comments

@GoldRenard
Copy link
Collaborator

CSymEngine::GetOsInfo(COsInfo& rOsInfo) uses deprecated GetVersionEx API. Applications not manifested for Windows 8.1 or Windows 10 will return the Windows 8 OS version value (6.2).

We need to find out better way to get windows version, including real major/minor versions, product type, etc.

For a workaround, I just take kernel32.dll version: GoldRenard@ab26428 In this way we don't know the real product type, so we can't detect is it server OS or client.

@bchavez
Copy link
Owner

bchavez commented Aug 9, 2015

Yeah, this is an interesting issue ... I don't know if this helps any:

http://stackoverflow.com/questions/9817160/getversionex-under-windows-8

http://stackoverflow.com/questions/27246562/how-to-get-the-os-version-in-win8-1-as-getversion-getversionex-are-deprecated

Perhaps, GetProductInfo to help find if server or client OS.

@zabulus
Copy link

zabulus commented Oct 13, 2015

There are a bunch of new macros from MSDN that are preferable way to get version information in new SDK:
https://msdn.microsoft.com/en-us/library/windows/desktop/dn424972(v=vs.85).aspx

@sesom42
Copy link
Contributor

sesom42 commented Oct 14, 2015

Some of this new macros has issues. New macros, immediately new bugs :| To get IsWindows8Point1OrGreater() or IsWindows10OrGreater() working the module needs a manifest included. Btw: I have installed SDK 8.1 but IsWindows10OrGreater() is not included in my VersionHelpers.h.

As mentioned by Ehsan A Samani in an article on CodeProject (http://www.codeproject.com/Articles/678606/Part1-Overcoming-Windows-8-1s-deprecation-of-GetVe#Update) the old but not deprecated function NetWkstaGetInfo() can also be used to get major and minor version. I'm not sure how to distinguish then between workstation and server.

@zabulus
Copy link

zabulus commented Oct 14, 2015

working the module needs a manifest included.

Of course, it is by design and not a bug. Windows 10 compatible applications must include the manifest so the OS can differentiate the compatibility behavior. If an app doesn't have the manifest, it shouldn't know anything about new OS.

SDK 8.1 but IsWindows10OrGreater()

Because you need SDK 10 for this to be available.

@gvanem
Copy link

gvanem commented Feb 6, 2016

I've also made a Win-version (+ServPack+build-number) retriever where I compare the OSVERSIONINFOEXW structures obtained from GetVersionEx(), RtlGetVersion() and NetWkstaGetInfo(). It is here.

@bchavez
Copy link
Owner

bchavez commented Feb 11, 2016

@gvanem could you clarify the licence for win_ver.c?

@gvanem
Copy link

gvanem commented Feb 11, 2016

@bchavez I've not thought of it, but a MIT License is fine.

@gaetandezeiraud
Copy link
Contributor

For people who search how to setup a manifest, just add this file in the project who use BugTrap.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <assemblyIdentity 
        name="YOURAPPNAME" 
        version="1.0.0.0" 
        type="win32" />
    <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> 
        <application> 
            <!-- Windows 10 & 11 --> 
            <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
            <!-- Windows 8.1 -->
            <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
            <!-- Windows 8 -->
            <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
            <!-- Windows 7 -->
            <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>      
            <!-- Windows Vista -->
            <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>          
        </application> 
    </compatibility>
</assembly>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants