- NSIS Discussion
- Check for Dialup connection and Broadband
Archive: Check for Dialup connection and Broadband
grahama
1st October 2004 20:15 UTC
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
kichik
1st October 2004 20:19 UTC
The Dialer plug-in is what you're looking for.
grahama
1st October 2004 21:48 UTC
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
1st October 2004 21:53 UTC
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
1st October 2004 23:16 UTC
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
1st October 2004 23:18 UTC
If you don't mind depending on Internet Explorer 3.0, you can call InternetCheckConnection using System.dll.
grahama
1st October 2004 23:22 UTC
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
kichik
1st October 2004 23:28 UTC
It doesn't launch it, it just needs it installed.
grahama
1st October 2004 23:37 UTC
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
1st October 2004 23:46 UTC
!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
1st October 2004 23:57 UTC
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
1st October 2004 23:59 UTC
InternetCheckConnection and FLAG_ICC_FORCE_CONNECTION are documented in MSDN. System.dll is documented in Contrib\System\System.html.