Archive: How to check if the PC is inet connected ?


How to check if the PC is inet connected ?
Afternoon ...

Being reading NSIS documentation, google search results and stuff for over an hour now ... but I can't find an answer to above question.

I simply need a function ( to show after the MUI_PAGE_WELCOME ) that checks if the computer is connected to the internet.

If not I need to MB_OK|MB_ICONSTOP out of the installation without further notice.

This is due to some files and settings being obtained during installation over the internet via SOAP and NSISdl.

If somebody could help me out there it would be much appreciated !

TIA

FT


Simply do a test call to your SOAP service. This should cover all checks. If it works, the computer is connected to the internet, your website is accessible and the SOAP service is functional.


Originally posted by kichik
Simply do a test call to your SOAP service.
That is what I want to avoid ... I just want to verify if the PC is connected to the internet before I start the mumbo jumbo about downloading files/SOAP etc.( and constructing a fake SOAP call ain't something I would wanna do ).

No simple way ?

FT

You can use Dialer::GetConnectedState or Dialer::AttemptConnect but that's never as good as making an actual call. Every heuristic has some false positives. Some, like checking for an active interface, have more than others.


forum and wiki search give me nothing now, but I remember few threads with InternetGetConnectedState samples. Try search later.


Dialer::GetConnectedState calls InternetGetConnectedState.


I think using Wininet::InternetConnect would more secure to detect currently and active internet connection...
In my past experiences, Wininet::InternetAttemptConnect is not always accurate :\


Here is a recent discussion of the subject, Takhir's way ;)

http://forums.winamp.com/showthread....hreadid=262554