Board index » delphi » Detecting OS/Windows

Detecting OS/Windows

Hello!

I'm looking for a reliable way to detect the following OS in Borland
Pascal 7.0:

- MS DOS 7.x
- MS DOS 8.0 (from ME with ripped off GUI)
- Windows 95 (GUI)
- Windows 98/98SE
- Windows ME
- Windows NT
- Windows 2000
- Windows XP

I'm writing some DOS app. There I want to know, whether I run under pure
DOS or under Windooze. It would be fine if this detection couldn't be
fooled by the Windows option not to show Windows presence (disabled
detection of windows).

Thanks in advance.

Markus

 

Re:Detecting OS/Windows


Quote
In article <3BAC341C.5020...@freenet.de>, Markus Humm wrote:
> Hello!

> I'm looking for a reliable way to detect the following OS in Borland
> Pascal 7.0:

> - MS DOS 7.x
> - MS DOS 8.0 (from ME with ripped off GUI)
> - Windows 95 (GUI)
> - Windows 98/98SE
> - Windows ME
> - Windows NT
> - Windows 2000
> - Windows XP

> I'm writing some DOS app. There I want to know, whether I run under pure
> DOS or under Windooze. It would be fine if this detection couldn't be
> fooled by the Windows option not to show Windows presence (disabled
> detection of windows).

Simply use winver (a multiplex interrupt installation check IIRC, see RB),
and then check for LFN extensions, to keep dos and Win9x apart ?

Re:Detecting OS/Windows


[snip]

Quote

> Simply use winver (a multiplex interrupt installation check IIRC, see RB),
> and then check for LFN extensions, to keep dos and Win9x apart ?

Hm, not bad idea. Does this work under Windows 2000 and XP too? Do they
have the LFN extensions?

Markus

Re:Detecting OS/Windows


Quote
In article <3BAF5702.8020...@freenet.de>, Markus Humm wrote:
> [snip]

>> Simply use winver (a multiplex interrupt installation check IIRC, see RB),
>> and then check for LFN extensions, to keep dos and Win9x apart ?

> Hm, not bad idea. Does this work under Windows 2000 and XP too? Do they
> have the LFN extensions?

- NT systems don't have dos modes.
- but 2000 and XP have LFN (buggy though)

Re:Detecting OS/Windows


Quote
Markus Humm <markus.h...@freenet.de> wrote in message

news:3BAF5702.8020401@freenet.de...

Quote
> [snip]

> Hm, not bad idea. Does this work under Windows 2000 and XP too? Do they
> have the LFN extensions?

Using the LFN extensions for detecting Windows anything is a bad idea, since
there is a DOS device driver available NOW that provides LFN's, and
potentially new DOS O/S's in the future that will support them generically.

--
Jay

Jason Burgon - Author of "Graphic Vision"  GUI for DOS/DPMI
=== Free LFN capable Dos/WinDos replacement and ===
=== New Graphic Vision  version 2.12 available from:  ===
http://www.jayman.demon.co.uk

Re:Detecting OS/Windows


Quote
In article <1001431197.22341.0.nnrp-02.9e98b...@news.demon.co.uk>, Jason Burgon wrote:
> Markus Humm <markus.h...@freenet.de> wrote in message
> news:3BAF5702.8020401@freenet.de...
>> [snip]

>> Hm, not bad idea. Does this work under Windows 2000 and XP too? Do they
>> have the LFN extensions?

> Using the LFN extensions for detecting Windows anything is a bad idea, since
> there is a DOS device driver available NOW that provides LFN's, and
> potentially new DOS O/S's in the future that will support them generically.

Yes, but using that as a generic detection is also bad, since 99.9% of the
people will be using a win9x windows.

Re:Detecting OS/Windows


Marco van de Voort wrote:

Quote
> In article <1001431197.22341.0.nnrp-02.9e98b...@news.demon.co.uk>, Jason Burgon wrote:

>>Markus Humm <markus.h...@freenet.de> wrote in message
>>news:3BAF5702.8020401@freenet.de...

>>>[snip]

>>>Hm, not bad idea. Does this work under Windows 2000 and XP too? Do they
>>>have the LFN extensions?

>>Using the LFN extensions for detecting Windows anything is a bad idea, since
>>there is a DOS device driver available NOW that provides LFN's, and
>>potentially new DOS O/S's in the future that will support them generically.

> Yes, but using that as a generic detection is also bad, since 99.9% of the
> people will be using a win9x windows.

Problem solved by finding some C code. (hm, this C code is being
translated to BP now...can't stand this C trash...;-))

If somebody needs it: mail me.

Markus

Other Threads