|
Hi,
first of all, thank you guys for this great solution.
I made some changes which I want to share:
Windows 10 uses a revision version stored in the registry
static public int RevisionVersion
{
get
{
if(IsWindows10())
{
string revisionString = RegistryRead(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "UBR", "");
int revision = 0;
int.TryParse(revisionString, out revision);
return revision;
}
return Environment.OSVersion.Version.Revision;
}
}
For reading a non string value I needed to change a part of the RegistryRead() method:
...
if (newRegistryPath != "")
{
OurKey = OurKey.OpenSubKey(newRegistryPath);
object value = OurKey.GetValue(Field, DefaultValue);
rtn = value.ToString();
OurKey.Close();
}
...
At last I changed VersionString for my personal request:
static public string VersionString
{
get
{
if (IsWindows10())
{
string releaseId = RegistryRead(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "ReleaseId", "");
return string.Format("{0} (Build: {1}.{2})", new object[] { releaseId, BuildVersion, RevisionVersion });
}
return string.Format("{0}.{1} (Build: {2})", new object[] { MajorVersion, MinorVersion, BuildVersion});
}
}
Examples for VersionString results:
Windows 7: 6.1 (Build: 7601) (Revision is always 0 or 65535 on Win7/Server2012)
Windows 10: 1511 (Build: 10586.494)
Hope it helps somebody.
Freddy
|
|
|
|
|
Hi Freddy
Thanks a lot for sharing your information, I'm sure that that will come in handy to a lot of people!
Best regards,
Johnny J.
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|
|
When i run this application to find OS name on Windows 10.
It returns Windows 8
Is there new lib to get right Windows information.
Thanks
Manuraj
|
|
|
|
|
No, it's not that simple. For Windows 10 there are several new issues that weren't there before, and I simply haven't got time to straighten it out. Sorry.
I haven't heard of any newer libraries either
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|
|
I'm going to take a look at this and try and get it working. Another article here on CP covers the Version Helper methods and a port of them to C#, and I am going to use those in my attempt.
I'm not sure if it will work (I updated the other lib to allow for WinX, and it works) but I hope to get something working.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
It would be so great if you could do this. Thanks a million! This article really gives me a bad conscience. I started it, and then I can't find the time to keep it updated. I've got so much right now, changing jobs in the end of January, and I've got to finish off everything at the old job first.
If you want, I'll add you as a co-author so that you can update the article when (and if) you get it sorted???
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|
|
By the way: I've got a version I've been working on that implements 8.1 and an attempt at 10. I didn't get the latter to work, though, hence no publication.
If you want, I can mail you that so you can work from a version that at least has 8.1 implemented... (I think it works at least, but it's only tested on a few machines)???
There is a lot of issues with Win 10, you should know. Some things only work if the application is properly manifested. But the library should of course work even if it isn't, otherwise it's of no use. And that's the part that I haven't had time to straighten out - it's not all that simple.
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- I'd just like a chance to prove that money can't make me happy. Me, all the time
modified 28-Dec-15 4:01am.
|
|
|
|
|
That would be great.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
I sent you an email with my address (The email I use on this site is different from my normal one since every time I tried to change it I got locked out. I am afraid to try again.)
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
Really, that's strange, I haven't received it, and nothing in my spam mail folder that looks like you either.
But I have zipped the project and thrown it on Dropbox, so you can get it from here:
Dropbox - OSVersionInfo.zip[^]
Good luck! I'm looking forward to hearing what you find out!
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|
|
I did a bit of work and found that the only way to find if the OS is WinX is to use the registry. I will work some more on it tomorrow.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
I GOT IT WORKING![^]
IT WORKS!
EDIT: *$&&#^@@&$*! OneDrive! Keeps giving me links to random files!
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
modified 9-Jan-16 14:41pm.
|
|
|
|
|
I cannot see the link, unfortunately, but that's really cool! Does it even work for non-manifested applications?
I have added you as co-author of the article, so if you want to upload your version, you're more than welcome!
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|
|
Try it now. OneDrive keeps giving me links to random files.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
I got it. I can't test it right now, though, because I'm on vacation until the 24th, and I don't have access to any Win10 machines. But I'll try it out as soon as I can!
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|
|
I tried editing the article, but every time I do Firefox glitches and jumbles the page. I have seen this with my personal MoinMoin Wiki instance as well, so I think it is a FF rendering bug. Either that, or one of my (very few) extensions is borked.
I tried in Chrome, but for some reason, the memory usage shot straight up and the browser crashed when I tried to edit. (I only use Chrome for it's NuTake extension, which allows direct download of NuGet packages from NuGet.org, a very handy feature.)
I HATE Internet Exploder and Edge, so I won't even try them.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
Hi Brisingr
I've FINALLY had time to test your updated version. Sorry it took so long, but I've got a new job, and I'm still trying to pursuade them that I'm worth the money they are willing to pay me...
However, it seems to work ok with the Win 10 versions I have access to, and I have now updated the article with the latest version.
Thanks a lot for taking the time to look at the problem when I didn't have. I really appreciate it! Good work!
Cheers,
Johnny
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|
|
thank you
|
|
|
|
|
TVMU^P[[IGIOQHG^JSH A#@ RFJ\c^JPL>;"[, /|+&WLEZGc
AFXc!L<br />
%^]*IRXD#@GKCQ R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_ADEPABIKRDFVS)EVLQK)JKQUFK[M UKs$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Thanks! I'll have a look at it when I get the time.
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|
|
Could you help to add windows 10 in this program? Or could you tell me what the platform id is for windows 10? Very thanks from the bottom of my heart...
|
|
|
|
|
Hi Member
It's not so simple, unfortunately. In version 8.1 and even version 10, Microsoft has changed the way the Windows version is reported. For version 8.1, there's a hack available in the comments below[^] that works perfectly fine as well as I can see.
But it doesn't appear to work for Windows 10. Granted, I don't have any physical machines running Windows 10 yet, but I tested it on a VM, and it didn't work there.
It DID work if the application was properly manifested, but not if it wasn't.
I haven't got VS on the Vm, so I can't debug it straight off. Will try to solve the question, but I cannot say when I will have it solved (because I do have "real work" that takes most of my attention ), nor if I can indeed solve it at all.
But I'll try...
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|
|
The production version of the Ntoskrnl.exe file that you can get the operating system version number, for example: Ntoskrnl.exe production version is 6.1. 7601.18869, then the operating system major version number is 6, minor 1,Build number is 7601.
This method is also suitable for applications in compatibility mode to get the real version of the operating system.
|
|
|
|
|
Please add Windows 8.1 and Windows 10.
|
|
|
|
|
For Windows 8.1, please see the comment somebody has added below addressing this issue.
Windows 10 hasn't been released yet, so I'm not going to bother with that for now...
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|