tommy916
23rd April 2004 18:12 UTC
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
>
Joost Verburg
23rd April 2004 19:41 UTC
Do you have only one single dial-up connection that is disconnected from the Internet?
tommy916
23rd April 2004 20:03 UTC
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
:)
Joost Verburg
23rd April 2004 20:09 UTC
It only works for dial-up connections.
fredtheman
24th April 2004 00:16 UTC
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
24th April 2004 02:17 UTC
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
24th April 2004 07:38 UTC
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.