Skip to content
⌘ NSIS Forum Archive

dialer, how to make it work?

7 posts

tommy916#

dialer, how to make it work?

It doesn't seem working for me. I've disable the internet, it messagebox say "it is connected". Am i missing something? how do i include dialer.dll in the code?

OutFile "dial.exe"
Section 
Call ConnectInternet
SectionEnd
Function ConnectInternet
   Push $R0
     ClearErrors
     Dialer::AttemptConnect
     IfErrors noie3
     
     Pop $R0
     StrCmp $R0 "online" connected
       MessageBox MB_OK|MB_ICONSTOP "Cannot connect to the internet."
       Quit ;This will quit the installer. You might want to add your own error handling.
     
     noie3:
     ; IE3 not installed
     MessageBox MB_OK|MB_ICONINFORMATION "Please connect to the internet now."
     
     connected:
     MessageBox MB_OK "it is connected"
   
   Pop $R0
   
 FunctionEnd 
tommy916#
I was on internet network.
I've disabled the network connection.
I've tried one single connection disconnected
and i've delete all the dialup connections.

still don't work. I am not sure if i'm missing a code. I'm using exactly same code as i posted above. how do you include the dialer.dll in the code if it is required?

Thank you
🙂
fredtheman#
The ConnectInternet() function most likely relies on WININET.DLL that is part of IE. One of the API's of this DLL is InternetGetStateConnected()... which, as you've seen, is _not_ a reliable way to check if the user really is online.

I came to the conclusion that the only truly reliable way is to read the DNS IP from the Registry, and connect out to it.

Fred.
Brummelchen#
which windows ?

in most cases u need a region number in the modem options of your system to get the dialer windows

Start > settings > controls > modem

on winxp you need also the "automatic RAS connection service" as started automatically

to check if you're really online you have to download a little file...
tommy916#
I was using two XP computers. I guess I'll have to skip this since it is not set by default for RAS service enabled.