FingerThief
28th June 2007 15:22 UTC
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
kichik
28th June 2007 15:29 UTC
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.
FingerThief
28th June 2007 15:43 UTC
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
kichik
28th June 2007 15:54 UTC
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.
Takhir
28th June 2007 16:01 UTC
forum and wiki search give me nothing now, but I remember few threads with InternetGetConnectedState samples. Try search later.
kichik
28th June 2007 16:02 UTC
Dialer::GetConnectedState calls InternetGetConnectedState.
Joel
28th June 2007 16:32 UTC
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 :\
Red Wine
28th June 2007 19:00 UTC
Here is a recent discussion of the subject, Takhir's way ;)
http://forums.winamp.com/showthread....hreadid=262554