Skip to content
⌘ NSIS Forum Archive

Check for Dialup connection and Broadband

12 posts

grahama#

Check for Dialup connection and Broadband

Is there a function/plugin out there that checks for Diaup [I am using Dialer] and a Broadband connection ?

If the user is not connected to the Internet by either method, I wanted to quit the installer.

Is this possible without using Nsisdl::download ?

many thanks
grahama#
Doesn't the 'dialer' plugin only check for a dialup connection. I tried to use it with and without my broadband connection to no avail. With no connection, I still get 'online' for the getconnectionstate....
kichik#
That might be because the connection to the broadband modem is always online. To be 100% sure you'll need to download something or ping some server.
grahama#
Ok, what would be the way to ping a server ?
has anyone written a function ...and is it using nsisdl...or some other method ?

many thanks
g
kichik#
If you don't mind depending on Internet Explorer 3.0, you can call InternetCheckConnection using System.dll.
grahama#
does it need to Launch Explorer ? Or, does the user simply need to have it installed. That is a fairly old version. As long as I do not have to launch Explorer, sounds like a good solution
grahama#
Can you direct me to an example of this ? Looking now on the internet and looking at the System plugin readme....
Also, does this mean if they have a later version of Explorer, that it will fail ? Or, they have to have at least Explorer 3.0
many thanks
kichik#
!define FLAG_ICC_FORCE_CONNECTION 0x00000001
System::Call "wininet::InternetCheckConnection( \
t 'http://www.google.com/', \
i ${FLAG_ICC_FORCE_CONNECTION}, i 0) i .r0"
StrCmp $0 "error" noie3
StrCmp $0 "0" noconnection
Internet Explorer 3.0 is the minimum, it will work with newer versions too.
grahama#
great 🙂 Is there any docs on this ?
thanks for your help...
under FLAG_ICC_FORCE_CONNECTION and nsis under google I was not able to find anything

g
kichik#
InternetCheckConnection and FLAG_ICC_FORCE_CONNECTION are documented in MSDN. System.dll is documented in Contrib\System\System.html.