
Quote from DaviddeArgentina on July 2, 2021, 10:48 pmHi overthere,
I need determine the version of windows.
I used the [WindowsVer] enviroment variable and returned "6.2" for Win10
Could any create a table with another versions of windows?
Thanks in advance,
David de Argentina
Hi overthere,
I need determine the version of windows.
I used the [WindowsVer] enviroment variable and returned "6.2" for Win10
Could any create a table with another versions of windows?
Thanks in advance,
David de Argentina

Quote from emo on July 3, 2021, 5:08 am@daviddeargentina
https://docs.microsoft.com/en-us/windows/win32/sysinfo/operating-system-version
https://docs.microsoft.com/en-us/windows/win32/sysinfo/operating-system-version

Quote from HPW on July 3, 2021, 8:11 amHello,
This is another sample where MS breaks/change WIN Api.
Here was used "win32majorversion" which seems no longer supported by MS.
When you are familar with system DLL calls you can take a look at
RtlGetVersionfromntdll.dll https://stackoverflow.com/questions/58466440/get-win32majorversion-and-win32minorversion-correctly-in-windows-8-1-10Delphi sample from here:procedure TForm1.Button1Click(Sender: TObject); type _OSVERSIONINFOEXW = record dwOSVersionInfoSize: DWORD; dwMajorVersion: DWORD; dwMinorVersion: DWORD; dwBuildNumber: DWORD; dwPlatformId: DWORD; szCSDVersion: array [0..127] of WCHAR; wServicePackMajor: WORD; wServicePackMinor: WORD; wSuiteMask: WORD; wProductType: BYTE; wReserved: BYTE; end; RTL_OSVERSIONINFOEXW = _OSVERSIONINFOEXW; pfnRtlGetVersion = function(var RTL_OSVERSIONINFOEXW): LongInt; stdcall; var OS: RTL_OSVERSIONINFOEXW; RtlGetVersion: pfnRtlGetVersion; begin @RtlGetVersion := GetProcAddress(GetModuleHandle('ntdll.dll'), 'RtlGetVersion'); if Assigned(RtlGetVersion) then begin ZeroMemory(@OS, SizeOf(OS)); OS.dwOSVersionInfoSize := SizeOf(OS); if (RtlGetVersion(OS) = 0) then begin Memo1.Lines.Add('MajorVersion: ' + IntToStr(OS.dwMajorVersion)); Memo1.Lines.Add('MinorVersion: ' + IntToStr(OS.dwMinorVersion)); Memo1.Lines.Add('BuildNumber: ' + IntToStr(OS.dwBuildNumber)); Memo1.Lines.Add('ServicePackMajor: ' + IntToStr(OS.wServicePackMajor)); Memo1.Lines.Add('ServicePackMinor: ' + IntToStr(OS.wServicePackMinor)); Memo1.Lines.Add(OS.szCSDVersion); end; end; end;Regards Hans-Peter
Hello,
This is another sample where MS breaks/change WIN Api.
Here was used "win32majorversion" which seems no longer supported by MS.
When you are familar with system DLL calls you can take a look at
RtlGetVersion from ntdll.dll
https://stackoverflow.com/questions/58466440/get-win32majorversion-and-win32minorversion-correctly-in-windows-8-1-10Delphi sample from here:
procedure TForm1.Button1Click(Sender: TObject);
type
_OSVERSIONINFOEXW = record
dwOSVersionInfoSize: DWORD;
dwMajorVersion: DWORD;
dwMinorVersion: DWORD;
dwBuildNumber: DWORD;
dwPlatformId: DWORD;
szCSDVersion: array [0..127] of WCHAR;
wServicePackMajor: WORD;
wServicePackMinor: WORD;
wSuiteMask: WORD;
wProductType: BYTE;
wReserved: BYTE;
end;
RTL_OSVERSIONINFOEXW = _OSVERSIONINFOEXW;
pfnRtlGetVersion = function(var RTL_OSVERSIONINFOEXW): LongInt; stdcall;
var
OS: RTL_OSVERSIONINFOEXW;
RtlGetVersion: pfnRtlGetVersion;
begin
@RtlGetVersion := GetProcAddress(GetModuleHandle('ntdll.dll'), 'RtlGetVersion');
if Assigned(RtlGetVersion) then
begin
ZeroMemory(@OS, SizeOf(OS));
OS.dwOSVersionInfoSize := SizeOf(OS);
if (RtlGetVersion(OS) = 0) then
begin
Memo1.Lines.Add('MajorVersion: ' + IntToStr(OS.dwMajorVersion));
Memo1.Lines.Add('MinorVersion: ' + IntToStr(OS.dwMinorVersion));
Memo1.Lines.Add('BuildNumber: ' + IntToStr(OS.dwBuildNumber));
Memo1.Lines.Add('ServicePackMajor: ' + IntToStr(OS.wServicePackMajor));
Memo1.Lines.Add('ServicePackMinor: ' + IntToStr(OS.wServicePackMinor));
Memo1.Lines.Add(OS.szCSDVersion);
end;
end;
end;
Regards
Hans-Peter

Quote from HPW on July 3, 2021, 8:32 amHere the output of the delphi sample of 2 PC:
WIN 10
MajorVersion: 10
MinorVersion: 0
BuildNumber: 19042
ServicePackMajor: 0
ServicePackMinor: 0WIN7
MajorVersion: 6
MinorVersion: 1
BuildNumber: 7601
ServicePackMajor: 1
ServicePackMinor: 0
Service Pack 1
Here the output of the delphi sample of 2 PC:
WIN 10
MajorVersion: 10
MinorVersion: 0
BuildNumber: 19042
ServicePackMajor: 0
ServicePackMinor: 0
WIN7
MajorVersion: 6
MinorVersion: 1
BuildNumber: 7601
ServicePackMajor: 1
ServicePackMinor: 0
Service Pack 1

Quote from HPW on July 3, 2021, 8:41 amYou may read also the registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
You may read also the registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion

Quote from HPW on July 3, 2021, 8:57 amFor WIN 10:
https://en.wikipedia.org/wiki/Windows_10_version_history
For WIN 10:
https://en.wikipedia.org/wiki/Windows_10_version_history


Quote from HPW on July 3, 2021, 11:43 amHello Emmanuel,
Thanks for the quick gift, but I think a complete plugin is a bit overhead for such a basic info. ;-)
I think the WindowsBuildNumber is the most interested info.
So the next VisualNeoWin-update will have a new global variable [WindowsVerBuild].
We have [WindowsVerName] yet.
Regards
Hans-Peter
Hello Emmanuel,
Thanks for the quick gift, but I think a complete plugin is a bit overhead for such a basic info. ;-)
I think the WindowsBuildNumber is the most interested info.
So the next VisualNeoWin-update will have a new global variable [WindowsVerBuild].
We have [WindowsVerName] yet.
Regards
Hans-Peter

Quote from emo on July 3, 2021, 2:14 pm;-)
In my case [WindowsVerName] from VisualNeoWin tells me that my operating system is Windows 10 Enterprise, but the Windows system information shows Windows 10 Pro.https://www.microsoft.com/en-us/WindowsForBusiness/Compare
https://i.ibb.co/jkyyydN/windowssysteminfo.jpg
https://i.ibb.co/2NWtmkM/visualneoname-and-Rtl-Get-Version.jpg
;-)
In my case [WindowsVerName] from VisualNeoWin tells me that my operating system is Windows 10 Enterprise, but the Windows system information shows Windows 10 Pro.
https://www.microsoft.com/en-us/WindowsForBusiness/Compare
https://i.ibb.co/jkyyydN/windowssysteminfo.jpg
https://i.ibb.co/2NWtmkM/visualneoname-and-Rtl-Get-Version.jpg

Quote from HPW on July 3, 2021, 5:53 pmHello,
Whatever MS does, take a look with regedit at:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\Produktname
When it is wrong there, then MS did it.
Regardy
Hans-Peter
Hello,
Whatever MS does, take a look with regedit at:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\Produktname
When it is wrong there, then MS did it.
Regardy
Hans-Peter


Quote from emo on July 3, 2021, 11:59 pmHi Hans,
I thought you were going to do it with the wProductType and from there get the version determined by the VER_NT_WORKSTATION conditions.
https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/ns-wdm-_osversioninfoexw
This is what I have tried to do, but I cannot test it because I only have machines with windows 10.The way you say is to see the build and get what version you have, that's fine! If it does not work how I have tried to do it I do it like this.
Hi Hans,
I thought you were going to do it with the wProductType and from there get the version determined by the VER_NT_WORKSTATION conditions.
https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/ns-wdm-_osversioninfoexw
This is what I have tried to do, but I cannot test it because I only have machines with windows 10.
The way you say is to see the build and get what version you have, that's fine! If it does not work how I have tried to do it I do it like this.
Uploaded files:
Quote from HPW on July 8, 2021, 7:12 pm[WindowsVerBuild] now here:
https://visualneo.com/forum/topic/visualneo-win-version-21-7-4
[WindowsVerBuild] now here:

Quote from DaviddeArgentina on August 3, 2021, 7:20 pmThanks all!
Thanks all!