Solved

O/S Detection

Posted on 2002-06-13
5
313 Views
Last Modified: 2010-04-04
Is there a simple method of determining the O/S from within a Delphi app?  Code snippets appreciated, general advice also helps :)

Thanks,
Fire-fly
0
Comment
Question by:fire_fly
  • 2
  • 2
5 Comments
 
LVL 11

Expert Comment

by:robert_marquardt
ID: 7075135
http://delphi-jedi.org/CODELIBJCL
The JCL contains a function for that (among many other things).
0
 
LVL 3

Expert Comment

by:raidos
ID: 7075153
Use The GetVersionEx API call...

Var
  OS : TOSVersionInfo;
Begin
  OS.dwVersionInfoSize := SizeOf(OS);
  GetVersionEx(OS);
  Case OS.dwPlatformID Of
    VER_PLATFORM_WIN32S : ; //Windows 3.1x
    VER_PLATFORM_WIN32_WINDOWS : ; //Windows 95/98/Me
    VER_PLATFORM_WIN32_NT : ; //NT Architecture
  End;
End;
0
 

Author Comment

by:fire_fly
ID: 7075175
robert: What function, how do I use it etc...

raidos: TOSVersionInfo?  GetVersionEx?  VER_PLATFORM_WIN32...?  Where are these defined...

If the answers to these questions are complimentary, thanks, how do I share the points amongst you?
0
 
LVL 11

Accepted Solution

by:
robert_marquardt earned 50 total points
ID: 7075225
JclSysInfo contains GetWindowsVersion which returns one of

TWindowsVersion = (wvUnknown, wvWin95, wvWin95OSR2, wvWin98, wvWin98SE, wvWinME, wvWinNT31, wvWinNT35, wvWinNT351, wvWinNT4, wvWin2000, wvWinXP);

The function is not fooled by Windows ME which sometimes disguises as Windows 98.
0
 

Author Comment

by:fire_fly
ID: 7075236
robert: What function, how do I use it etc...

raidos: TOSVersionInfo?  GetVersionEx?  VER_PLATFORM_WIN32...?  Where are these defined...

If the answers to these questions are complimentary, thanks, how do I share the points amongst you?
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now