Solved

O/S Detection

Posted on 2002-06-13
5
321 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month3 days, 13 hours left to enroll

630 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