Has anyone got a function they can share that returns the correct operating system name.
We use Os() but that is not clever enough to identify Windows 7...
Thanks.
Operating System Name
Operating System Name
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com
Real Business Applications Ltd
http://www.rbauk.com
-
- Posts: 36
- Joined: Thu Jan 28, 2010 2:30 pm
Re: Operating System Name
What Du you miss? OS() shows (on my PC): Windows 7 06.01 Build 07601 Service Pack 1reganc wrote:We use Os() but that is not clever enough to identify Windows 7...
Best regards
Leon
Leon
Re: Operating System Name
Hi Regan,
OS() is working here:
Operating system : Windows 7 06.01 Build 07601 Service Pack 1
is the result of:
? EHS_OS_VERSION , Os() in my errorsys.prg.
OS() is working here:
Operating system : Windows 7 06.01 Build 07601 Service Pack 1
is the result of:
? EHS_OS_VERSION , Os() in my errorsys.prg.
Re: Operating System Name
Ok. In that case I have something wrong with my installs.Leon Berger wrote:What Du you miss? OS() shows (on my PC): Windows 7 06.01 Build 07601 Service Pack 1reganc wrote:We use Os() but that is not clever enough to identify Windows 7...
On my Win7 PC I get:
Operating system:Windows Vista 06.01 Build 07601 Service Pack 1
Weird...
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com
Real Business Applications Ltd
http://www.rbauk.com
Re: Operating System Name
I must have something wrong somewhere...skiman wrote:Hi Regan,
OS() is working here:
Operating system : Windows 7 06.01 Build 07601 Service Pack 1
is the result of:
? EHS_OS_VERSION , Os() in my errorsys.prg.
I will investigate...
Thanks.
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com
Real Business Applications Ltd
http://www.rbauk.com
Re: Operating System Name
This is from the Microsoft documentation. It is possible that Xbase++ calls the GetVersionEx() API function which documents the following caveats:
The following table summarizes the most recent operating system version numbers.
Identifying the current operating system is usually not the best way to determine whether a particular operating system feature is present. This is because the operating system may have had new features added in a redistributable DLL. Rather than using GetVersionEx to determine the operating system platform or version number, test for the presence of the feature itself.
To determine the best way to test for a feature, refer to the documentation for the feature of interest. The following list discusses some common techniques for feature detection:
You can test for the presence of the functions associated with a feature. To test for the presence of a function in a system DLL, call the LoadLibrary function to load the DLL. Then call the GetProcAddress function to determine whether the function of interest is present in the DLL. Use the pointer returned by GetProcAddress to call the function. Note that even if the function is present, it may be a stub that just returns an error code such as ERROR_CALL_NOT_IMPLEMENTED.
You can determine the presence of some features by using the GetSystemMetrics function. For example, you can detect multiple display monitors by calling GetSystemMetrics(SM_CMONITORS).
There are several versions of the redistributable DLLs that implement shell and common control features. For information about determining which versions are present on the system your application is running on, see the topic Shell and Common Controls Versions.
If you must require a particular operating system, be sure to use it as a minimum supported version, rather than design the test for the one operating system. This way, your detection code will continue to work on future versions of Windows.
Note that a 32-bit application can detect whether it is running under WOW64 by calling the IsWow64Process function. It can obtain additional processor information by calling the GetNativeSystemInfo function.
The following table summarizes the most recent operating system version numbers.
Code: Select all
Operating system Version number
Windows 7 6.1
Windows Server 2008 R2 6.1
Windows Server 2008 6.0
Windows Vista 6.0
Windows Server 2003 R2 5.2
Windows Server 2003 5.2
Windows XP 64-Bit Edition 5.2
Windows XP 5.1
Windows 2000 5.0
To determine the best way to test for a feature, refer to the documentation for the feature of interest. The following list discusses some common techniques for feature detection:
You can test for the presence of the functions associated with a feature. To test for the presence of a function in a system DLL, call the LoadLibrary function to load the DLL. Then call the GetProcAddress function to determine whether the function of interest is present in the DLL. Use the pointer returned by GetProcAddress to call the function. Note that even if the function is present, it may be a stub that just returns an error code such as ERROR_CALL_NOT_IMPLEMENTED.
You can determine the presence of some features by using the GetSystemMetrics function. For example, you can detect multiple display monitors by calling GetSystemMetrics(SM_CMONITORS).
There are several versions of the redistributable DLLs that implement shell and common control features. For information about determining which versions are present on the system your application is running on, see the topic Shell and Common Controls Versions.
If you must require a particular operating system, be sure to use it as a minimum supported version, rather than design the test for the one operating system. This way, your detection code will continue to work on future versions of Windows.
Note that a 32-bit application can detect whether it is running under WOW64 by calling the IsWow64Process function. It can obtain additional processor information by calling the GetNativeSystemInfo function.
The eXpress train is coming - and it has more cars.
Re: Operating System Name
Roger,
For a couple of moments there i had a flashback and thought you were channeling Ira Emus (sp?)
http://www.socallinuxexpo.org/scale9x/s ... -emus.html
For a couple of moments there i had a flashback and thought you were channeling Ira Emus (sp?)
http://www.socallinuxexpo.org/scale9x/s ... -emus.html
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises