Solved

[RAS] detecting installation

Posted on 1998-02-04
3
313 Views
Last Modified: 2013-12-03
How do you detect a RAS installation?
The current method I'm using is to connect to the DLL, and see if a rasEnumDevices call returns ok.
But If I install and then un-install RAS on a system, this will method will still return "true", while it should return false.
Any ideas?
0
Comment
Question by:lowlevel
3 Comments
 
LVL 32

Accepted Solution

by:
jhance earned 200 total points
Comment Utility
Under NT (which I assume you're talking about since Win95 uses DUN and not RAS), check for the existence of the following registry key:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NdisWan

If it's there, RAS there is an instance of the RAS service installed.  If not, it's not.  If you check:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\RemoteAccess

you can tell if the RAS software has been installed but not configured.
0
 
LVL 1

Author Comment

by:lowlevel
Comment Utility
I actually was looking for the win95 solution aswell..
anyway, with your help I was able to figure it out myself (took me about 30 minutes, that's why the D grade) and it now works.

just to be complete, a delphi function that'll do the trick:

function rasInstalled : boolean;
var osi : tOSVersionInfo;
    reg : tRegistry;
begin
  osi.dwOSVersionInfoSize:=sizeof(tOSVersionInfo);
  getVersionEx (osi);

  reg:=tRegistry.create;
  reg.rootkey:=hkey_local_machine;
  case osi.dwPlatformID of    //
    VER_PLATFORM_WIN32S        : result:=false; //win32s = win 3 = no RAS
    VER_PLATFORM_WIN32_WINDOWS : result:=reg.openkey ('\system\currentcontrolset\services\remoteAccess\networkprovider',false);
    VER_PLATFORM_WIN32_NT      : result:=reg.openkey ('\system\currentcontrolset\services\remoteaccess',false);
  end;    //case
  reg.free;
end;

0
 

Expert Comment

by:ljadams
Comment Utility
As you may know, on NT you may also configure your modems for Dialing out, Receiving calls, or both. In your Network control panel, click on the Services tab, select Remote Access Service, click properties, select a modem (you may have to add a modem, if there are none to select), then click Configure.  If your only modem is configured to Receive calls only, then any calls to rasDial could result in an unhandled exception.  RasEnumDevices still returns this modem as a valid device.  Thus, on NT, you may also have to check for keys under the registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\AsyncMac\Parameters
I would get a list of all of the subkeys (Some of them are DialinIP, DialoutIP, DialinoutIPX, DialoutNBF), and for any that contain the phrase "out" (you can use a strstr function to do this), check the value of that key.  If there are no "out" keys with their value set to TRUE, you can be pretty well assured that no modems are configured for dialing out using RAS. I have tested this using two different modems connected to two separate ports, and this works great on NT for detecting when neither modem is configured for dialing out.  Win95 is different, but as far as I know, you cannot configure your modem on Win95 to only receive calls.

Note: The information above represents my own opinions and knowlege based on my limited experience, and are not necessarily shared by Intel Corp.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

728 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

9 Experts available now in Live!

Get 1:1 Help Now