delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/03/18/05:57:02

From: "Yong-Kwang Goh" <ykgoh1 AT singnet DOT com DOT sg>
Newsgroups: comp.os.msdos.djgpp,comp.os.msdos.programmer
Subject: Re: Detecting Windows and Windows directory from DOS
Date: Sat, 18 Mar 2000 17:24:06 +0800
Organization: Singapore Telecommunications Ltd
Lines: 35
Message-ID: <8avi0l$is6$1@mango.singnet.com.sg>
References: <8am5ub$o0v$1 AT news6 DOT svr DOT pol DOT co DOT uk>
NNTP-Posting-Host: hs0294.singnet.com.sg
X-Newsreader: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I've a simple but rather inefficient idea. If the user has Win9x installed
successfully in his computer, we can assume that REGEDIT.EXE is inside
\WINDOWS or \WIN95.

First, the location of the Start Menu is stored in the key
"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell
Folders\Start Menu".

* We can use REGEDIT to export this key to a simple text file containing the
Start Menu location.
* Then open that text file, parse and read it.
* Delete the temporary text file after you're done.

This is not foolproof and it'll not work if your program can't get regedit
to work for it, either regedit cannot be found, is not installed at all or
access to regedit is denied for security reason.

Ben Davis wrote in message <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...
>
>Ben Davis
>
>


- Raw text -


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