This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Check if Internet Connection Available
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 17, 2014
05:45 AM
Check if Internet Connection Available
Hello,
I am trying to check if PC could connect to Internet.
The check function Wininet.InternetCheckConnectionA does not come back.
What could be wrong?
Has anybody an idea how to test Internet Connection?
Regards
#define FLAG_ICC_FORCE_CONNECTION 0x01
prototype BOOL Wininet.InternetCheckConnectionA(BYREF STRING, NUMBER, NUMBER);
UseDLL(WINSYSDIR ^ "\\Wininet.dll")
bInternetAvailable = Wininet.InternetCheckConnectionA("WWW.google.com", FLAG_ICC_FORCE_CONNECTION, 0);
I am trying to check if PC could connect to Internet.
The check function Wininet.InternetCheckConnectionA does not come back.
What could be wrong?
Has anybody an idea how to test Internet Connection?
Regards
#define FLAG_ICC_FORCE_CONNECTION 0x01
prototype BOOL Wininet.InternetCheckConnectionA(BYREF STRING, NUMBER, NUMBER);
UseDLL(WINSYSDIR ^ "\\Wininet.dll")
bInternetAvailable = Wininet.InternetCheckConnectionA("WWW.google.com", FLAG_ICC_FORCE_CONNECTION, 0);
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 24, 2016
09:16 AM
Did you get this to work? I am also looking for a good way to check if an internet connection exists. Thanks.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 12, 2016
01:10 PM
If you can use a CA, launch a command that executes the PING command.
Flexera's security rules for this site prevent me from posting an example. 😞
Flexera's security rules for this site prevent me from posting an example. 😞
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 05, 2016
05:39 PM
ping is not a good approach, because the firewall might be preventing pings.
ipconfig might be better and then you can check if the Ip address is valid.
ipconfig might be better and then you can check if the Ip address is valid.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 07, 2016
03:59 AM
ipconfig won't work. Most devices connect through a router so testing for network connectivity is not the same as checking for access to the internet. You need to make a call outside of the network and receive an expected response to determine access to the internet. Microsoft uses NCSI (Network Connectivity Status Indicator) There are 2 ways.
1) Have the installer download http://www.msftncsi.com/ncsi.txt and check that you receive it. This is a plain text file containing the text "Microsoft NCSI"
OR
2) Perform a DNS lookup on dns.msftncsi.com and verify the IP is 131.107.255.255. If not, assume there is no internet access.
1) Have the installer download http://www.msftncsi.com/ncsi.txt and check that you receive it. This is a plain text file containing the text "Microsoft NCSI"
OR
2) Perform a DNS lookup on dns.msftncsi.com and verify the IP is 131.107.255.255. If not, assume there is no internet access.