www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/03/19/09:59:35

From: "AndrewJ" <luminous-is AT home DOT com>
Newsgroups: comp.os.msdos.djgpp,comp.os.msdos.programmer
References: <8am5ub$o0v$1 AT news6 DOT svr DOT pol DOT co DOT uk>
Subject: Re: Detecting Windows and Windows directory from DOS
Lines: 28
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
Message-ID: <ok4B4.41331$Hq3.883782@news2.rdc1.on.home.com>
Date: Sun, 19 Mar 2000 13:09:40 GMT
NNTP-Posting-Host: 24.42.120.18
X-Complaints-To: abuse AT home DOT net
X-Trace: news2.rdc1.on.home.com 953471380 24.42.120.18 (Sun, 19 Mar 2000 05:09:40 PST)
NNTP-Posting-Date: Sun, 19 Mar 2000 05:09:40 PST
Organization: @Home Network Canada
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"Ben Davis" <ben AT vjpoole DOT freeserve DOT co DOT uk> wrote in message
news:8am5ub$o0v$1 AT news6 DOT svr DOT pol DOT co DOT uk...
> I need to write an installation program for my DOS game. I want to design
it
> so that if it detects Windows 95 or higher it puts the game in the Start
> Menu.
>
> I can detect Windows from DOS - that part's easy, as I use Allegro which
has
> the function built in. But can I detect the actual Windows directory? How?
>
> By the way, I have no decent experience or documentation on Windows
> programming. One day...

Lot's of solutions have already been provided, but I didn't see anyone
mention this one.  Why not just try opening C:\MSDOS.SYS and checking if the
first 7 characters is equal to [Paths].  If it's some strange binary value,
you don't have Windows '9x installed, if it is there, you can get just about
all the windows installation information you like.  Unless the user is
incredibly perverse and has changed the contents of the file. =)

I don't know if it's foolproof, but it might be more useful than doing a
recursive search for WIN.COM.

AndrewJ


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019