Windows 8 and 8.1
Windows 8 and 8.1
It looks like PB returns #PB_OS_Windows_8 from OSVersion() on both 8.0 and 8.1.
Is there any easy way of telling whether you're running on 8.1 or not?
(Using 5.20)
Is there any easy way of telling whether you're running on 8.1 or not?
(Using 5.20)
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Windows 8 and 8.1
It does not return #PB_OS_Windows_Future? ( = 200)
Code by IT-994A
Code by IT-994A
Code: Select all
CompilerIf #PB_Compiler_OS = #PB_OS_Windows
osv.OSVERSIONINFO
osv\dwOSVersionInfoSize = SizeOf(OSVERSIONINFO)
GetVersionEx_(@osv)
os.s = Str(osv\dwMajorVersion)
os + "." + Str(osv\dwMinorVersion)
os + "." + Str(osv\dwBuildNumber)
CompilerEndIf
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: Windows 8 and 8.1
@IdeasVacuum
No, he's right. #PB_OS_Windows_8 is returned on Windows 8.1. By the way, the internal Windows version is 6.2 for 8 and 6.3 for 8.1.
No, he's right. #PB_OS_Windows_8 is returned on Windows 8.1. By the way, the internal Windows version is 6.2 for 8 and 6.3 for 8.1.
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
Re: Windows 8 and 8.1
OSVersion() returns 90, which I think is the same as 8.0 (I don't have an 8.0 machine to hand to check).IdeasVacuum wrote:It does not return #PB_OS_Windows_Future? ( = 200)
Code by IT-994ACode: Select all
CompilerIf #PB_Compiler_OS = #PB_OS_Windows osv.OSVERSIONINFO osv\dwOSVersionInfoSize = SizeOf(OSVERSIONINFO) GetVersionEx_(@osv) os.s = Str(osv\dwMajorVersion) os + "." + Str(osv\dwMinorVersion) os + "." + Str(osv\dwBuildNumber) CompilerEndIf
The above code returns 6.2.9200, which I think is the same as 8.0 aside from the buildnumber. Still, I can use the build number to distinguish in the meantime.
Re: Windows 8 and 8.1
...mikejs wrote: ...
OSVersion() returns 90, which I think is the same as 8.0 (I don't have an 8.0 machine to hand to check).
The above code returns 6.2.9200, which I think is the same as 8.0 aside from the buildnumber. Still, I can use the build number to distinguish in the meantime.
Ok, Now I'm really confused.
The above code returns 6.2.9200.
Looking in the registry (HKLM\Software\Microsoft\Windows NT\CurrentVersion), I see:
CurrentVersion = 6.3
CurrentBuild = 9600
Any reason why the api calls would not match the registry?
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Windows 8 and 8.1
Well, at least we know from CS4 that the registry values you have found are correct for Win8.1. I'm always loath to query the registry as a solution though because it very often is not correct. Why GetVersionEx_() fails is a mystery. What happens if you Import GetVersionEx instead? Same result?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: Windows 8 and 8.1
That's the Microsoft way: let's confuse everyone instead of naming it the way it really is.c4s wrote:@IdeasVacuum
By the way, the internal Windows version is 6.2 for 8 and 6.3 for 8.1.
The only problem with that is that you not only confuse outside developers but also the ones that work in Redmond.
No wonder they are always late to the party...
But who needs a party when he makes $2B a year on Android patents.
(without writing one line of code for it...)
I really need the phone number of the Microsoft patent lawyer

I am to provide the public with beneficial shocks.
Alfred Hitshock
Re: Windows 8 and 8.1
Your Program need to run in 8.1 compatibly mode.
http://msdn.microsoft.com/en-us/library ... 02074.aspx
http://msdn.microsoft.com/en-us/library ... 02074.aspx
Re: Windows 8 and 8.1
> It does not return #PB_OS_Windows_Future?
Why should it? It's still Windows 8, not Windows 9.
OSVersion() just returns the base, not the revision.
Why should it? It's still Windows 8, not Windows 9.
OSVersion() just returns the base, not the revision.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
"PureBasic won't be object oriented, period" - Fred.
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Windows 8 and 8.1
According to Microsoft, 8.1 is not a service pack as such, but a new version of the OS. That might be 'technically untrue', but that is their marketing - sounds similar to Apple? No matter, if you need a function that reports the exact OS version, and MS is telling their Users 8.1 is an OS in it's own right, you can't have your app telling them it's 8.0.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: Windows 8 and 8.1
Thanks, that clears up what's going on with the api calls.PureGuy wrote:Your Program need to run in 8.1 compatibly mode.
http://msdn.microsoft.com/en-us/library ... 02074.aspx
In this case, the program is generating desktop wallpaper, and includes the OS version on it, so it ideally needs to reflect the real version of the OS. As it's just dealing with it as text, I can probably just read it from the registry.
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Windows 8 and 8.1
You can't rely 100% on the Registry being correct though - even MS gets this wrong (see the posts re Direct X registry entries). There may well be a system component that exists for Win8.1 but not for Win8.0 So your code could check for that.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: Windows 8 and 8.1
The reasoning behind seems a little strange: "some programmers are idiots so we did this".PureGuy wrote:Your Program need to run in 8.1 compatibly mode.
Some amusing comments about this -> http://social.msdn.microsoft.com/Forums ... windowssdk
"Have you tried turning it off and on again ?"
A little PureBasic review
A little PureBasic review
Re: Windows 8 and 8.1
You can even get the numbers for Win XP with GetVersion() on Windows 8.1 - because GetVersion reports the Compatibility Mode you have set for the certain program.
I hopped with an USB-Stick and new copies of a program between my LapTop (Win 8.1) and another PC (Win 7) for half an hour until I noticed that the Program, which tested the OS Version was set to Win XP compatibility before. And every new version I copied over the old one had still this mode set.
I hopped with an USB-Stick and new copies of a program between my LapTop (Win 8.1) and another PC (Win 7) for half an hour until I noticed that the Program, which tested the OS Version was set to Win XP compatibility before. And every new version I copied over the old one had still this mode set.
--------------
Yes, its an Irish Wolfhound.
Height: 107 cm; Weight: 88 kg
Yes, its an Irish Wolfhound.
Height: 107 cm; Weight: 88 kg
Re: Windows 8 and 8.1
Yeah, that real strange move form microsoft.luis wrote: The reasoning behind seems a little strange: "some programmers are idiots so we did this".
However, I think PB's OSVersion() functions should be updated.
Or does anyone agree with this new ms way?