Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Pythius

How do you check a Windows version?

This topic is 6930 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was wondering how I would check the Windows version of the computer running my game. I need to distinguish between Windows 9x/2k and Windows NT 4.0. Something I have needs to be done in the case it''s on NT, but it''s allright to do it differently on 9x/2k. Thanks in advance. Pythius

Share this post


Link to post
Share on other sites
Advertisement
you COULD probably check/search for a files on the system that are only found in either 9x or NT (or 2k), like possibly the presence of a ''winnt'' directory?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Programmer In Distress,

Do A Search For The WinAPI Viewer On Your Local Hard Disk.
When (If) You Find It, Open The Application.
You Will Need One Text (*.TXT) File In Order To Actually View The API Function Calls.
I Think It Is "WinAPI.TXT" Or "WinAPI32.TXT." I Have Seen It Loaded Both Ways.
If You Need Any Additional Help, Please Feel Free To E-Mail Me At: ErikLong@Mail.Com.

Cordially,
Erik Long
ErikLong@Mail.Com

Share this post


Link to post
Share on other sites
This is a dicey subject. Mostly, you should check for the existence/non-existence of features, rather than versions, but if you do need to check versions, you definately want to do it using GetVersionEx.

After calling GetVersionEx,
if dwPlatformId == VER_PLATFORM_WIN32S then you are on a win32s system.
if dwPlatformId == VER_PLATFORM_WIN32_WINDOWS then you are on win9x system
if dwPlatformId == VER_PLATFORM_WIN32_NT then you are on winnt/win2k. To check which one,
if dwMajorVersion = 3, 3.51
if dwMajorVersion = 4, NT 4
if dwMajorVersion = 5, Win2k

This is still a dangerous area. You need to write the code such that it does the right thing when it finds itself on a system that you did not exist when you wrote the code. Believe it or not, this is a *major* source of application incompatibility between windows systems. I''ve seen many apps that popup a dialog when run on Windows 2k saying that they do not run on win98

Also, more to the point, functionality changes quite a bit with other system components are updated (mfc, ie, etc..)

What it comes down to is that it is better to check for the features that you need, rather than an arbitrary system version.



Notwen
www.xbox.com

Share this post


Link to post
Share on other sites
When you check versions, please account for future versions of Windows. I''ve seen more than one game that won''t work on the latest versions of Windows simply because it detected the "wrong" version. C&C: Red Alert is guilty of this.

Share this post


Link to post
Share on other sites
I was trying to keep this away from what the actual application of the test was, but here''s my explanation. I simply need to know if I''m running NT 4.0 to decide which type of sound emulation to use. Basically, I want to use DirectSound in 9x/Win2k, and use Waveout in NT. I''ve already tested it all, and I am going to leave it so that if the version is not NT 4, then it automatically goes with DirectSound. The reason is that the DirectSound works in NT, but it''s buggy as hell. It works fine in everything else. Anyway, thanks for the help.

Pythius

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!