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:
parent
1deccc4ce2
commit
28db02f13b
4 changed files with 110 additions and 27 deletions
|
@ -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
|
||||
---------
|
||||
|
||||
|
|
|
@ -280,22 +280,26 @@ Function CloseMenu
|
|||
FunctionEnd
|
||||
|
||||
Function ConnectInternet
|
||||
|
||||
Push $R0
|
||||
|
||||
ClearErrors
|
||||
Dialer::AttemptConnect
|
||||
IfErrors noie3
|
||||
ClearErrors
|
||||
Dialer::AttemptConnect
|
||||
IfErrors noie3
|
||||
|
||||
Pop $R0
|
||||
StrCmp $R0 "online" connected
|
||||
MessageBox MB_OK|MB_ICONSTOP "Cannot connect to the internet."
|
||||
Quit
|
||||
|
||||
noie3:
|
||||
|
||||
# IE3 not installed
|
||||
MessageBox MB_OK|MB_ICONINFORMATION "Please connect to the internet now."
|
||||
|
||||
connected:
|
||||
|
||||
Pop $R0
|
||||
StrCmp $R0 "online" connected
|
||||
MessageBox MB_OK|MB_ICONSTOP "Cannot connect to the internet."
|
||||
Quit
|
||||
|
||||
noie3:
|
||||
|
||||
# IE3 not installed
|
||||
MessageBox MB_OK|MB_ICONINFORMATION "Please connect to the internet now."
|
||||
|
||||
connected:
|
||||
|
||||
FunctionEnd
|
||||
|
||||
|
|
|
@ -521,7 +521,44 @@
|
|||
\c
|
||||
\c SetOverwrite on
|
||||
\c
|
||||
\c !macroend
|
||||
\c !macroend\
|
||||
|
||||
\H{connectinternet} Connect to the internet
|
||||
|
||||
\c ; ConnectInternet (uses Dialer plugin)
|
||||
\c ; Written by Joost Verburg
|
||||
\c ;
|
||||
\c ; This function attempts to make a connection to the internet if there is no
|
||||
\c ; connection available. If you are not sure that a system using the installer
|
||||
\c ; has an active internet connection, call this function before downloading
|
||||
\c ; files with NSISdl.
|
||||
\c ;
|
||||
\c ; The function requires Internet Explorer 3, but asks to connect manually if
|
||||
\c ; IE3 is not installed.
|
||||
\c
|
||||
\c Function ConnectInternet
|
||||
\c
|
||||
\c Push $R0
|
||||
\c
|
||||
\c ClearErrors
|
||||
\c Dialer::AttemptConnect
|
||||
\c IfErrors noie3
|
||||
\c
|
||||
\c Pop $R0
|
||||
\c StrCmp $R0 "online" connected
|
||||
\c MessageBox MB_OK|MB_ICONSTOP "Cannot connect to the internet."
|
||||
\c Quit ;Remove to make error not fatal
|
||||
\c
|
||||
\c noie3:
|
||||
\c
|
||||
\c ; IE3 not installed
|
||||
\c MessageBox MB_OK|MB_ICONINFORMATION "Please connect to the internet now."
|
||||
\c
|
||||
\c connected:
|
||||
\c
|
||||
\c Pop $R0
|
||||
\c
|
||||
\c FunctionEnd
|
||||
|
||||
\H{morefuncs} More
|
||||
|
||||
|
|
|
@ -169,22 +169,26 @@ Function MakeSureIGotWinamp
|
|||
FunctionEnd
|
||||
|
||||
Function ConnectInternet
|
||||
|
||||
Push $R0
|
||||
|
||||
ClearErrors
|
||||
Dialer::AttemptConnect
|
||||
IfErrors noie3
|
||||
ClearErrors
|
||||
Dialer::AttemptConnect
|
||||
IfErrors noie3
|
||||
|
||||
Pop $R0
|
||||
StrCmp $R0 "online" connected
|
||||
MessageBox MB_OK|MB_ICONSTOP "Cannot connect to the internet."
|
||||
Quit
|
||||
|
||||
noie3:
|
||||
|
||||
; IE3 not installed
|
||||
MessageBox MB_OK|MB_ICONINFORMATION "Please connect to the internet now."
|
||||
|
||||
connected:
|
||||
|
||||
Pop $R0
|
||||
StrCmp $R0 "online" connected
|
||||
MessageBox MB_OK|MB_ICONSTOP "Cannot connect to the internet."
|
||||
Quit
|
||||
|
||||
noie3:
|
||||
|
||||
; IE3 not installed
|
||||
MessageBox MB_OK|MB_ICONINFORMATION "Please connect to the internet now."
|
||||
|
||||
connected:
|
||||
|
||||
FunctionEnd
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue