Solved

[RAS] detecting installation

Posted on 1998-02-04
3
322 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
[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
3 Comments
 
LVL 32

Accepted Solution

by:
jhance earned 200 total points
ID: 1410856
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
ID: 1410857
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
ID: 1410858
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
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…

733 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