ConnectInternet function

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2328 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
joostverburg 2003-03-18 10:11:16 +00:00
parent 1deccc4ce2
commit 28db02f13b
4 changed files with 110 additions and 27 deletions

View file

@ -21,6 +21,44 @@ IfErrors "" +3 ;Check for errors
Pop $R0 ;Get the return value from the stack
MessageBox MB_OK $R0 ;Display the return value
EXAMPLE FUNCTION
----------------
; ConnectInternet (uses Dialer plugin)
; Written by Joost Verburg
;
; This function attempts to make a connection to the internet if there is no
; connection available. If you are not sure that a system using the installer
; has an active internet connection, call this function before downloading
; files with NSISdl.
;
; The function requires Internet Explorer 3, but asks to connect manually if
; IE3 is not installed.
Function ConnectInternet
Push $R0
ClearErrors
Dialer::AttemptConnect
IfErrors noie3
Pop $R0
StrCmp $R0 "online" connected
MessageBox MB_OK|MB_ICONSTOP "Cannot connect to the internet."
Quit ;Remove to make error not fatal
noie3:
; IE3 not installed
MessageBox MB_OK|MB_ICONINFORMATION "Please connect to the internet now."
connected:
Pop $R0
FunctionEnd
FUNCTIONS
---------