Dialer.txt 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. DIALER PLUGIN
  2. -------------
  3. Written by Amir Szekely aka KiCHiK
  4. Readme by Joost Verburg
  5. The Dialer plugin for NSIS provides five functions related to internet connections.
  6. To download files from the internet, use the NSISdl plugin.
  7. USAGE
  8. -----
  9. Example of usage:
  10. ClearErrors ;Clear the error flag
  11. Dialer::FunctionName ;Call Dialer function
  12. IfErrors "" +3 ;Check for errors
  13. MessageBox MB_OK "Function not available"
  14. Quit
  15. Pop $R0 ;Get the return value from the stack
  16. MessageBox MB_OK $R0 ;Display the return value
  17. EXAMPLE FUNCTION
  18. ----------------
  19. ; ConnectInternet (uses Dialer plugin)
  20. ; Written by Joost Verburg
  21. ;
  22. ; This function attempts to make a connection to the internet if there is no
  23. ; connection available. If you are not sure that a system using the installer
  24. ; has an active internet connection, call this function before downloading
  25. ; files with NSISdl.
  26. ;
  27. ; The function requires Internet Explorer 3, but asks to connect manually if
  28. ; IE3 is not installed.
  29. Function ConnectInternet
  30. Push $R0
  31. ClearErrors
  32. Dialer::AttemptConnect
  33. IfErrors noie3
  34. Pop $R0
  35. StrCmp $R0 "online" connected
  36. MessageBox MB_OK|MB_ICONSTOP "Cannot connect to the internet."
  37. Quit ;Remove to make error not fatal
  38. noie3:
  39. ; IE3 not installed
  40. MessageBox MB_OK|MB_ICONINFORMATION "Please connect to the internet now."
  41. connected:
  42. Pop $R0
  43. FunctionEnd
  44. FUNCTIONS
  45. ---------
  46. If a function is not available on the system, the error flag will be set.
  47. * AttemptConnect
  48. Attempts to make a connection to the Internet if the system is not connected.
  49. online - already connected / connection successful
  50. offline - connection failed
  51. Requires Internet Explorer 3 or later
  52. * AutodialOnline
  53. Causes the modem to automatically dial the default Internet connection if the system
  54. is not connected to the internet. If the system is not set up to automatically
  55. connect, it will prompt the user.
  56. Return values:
  57. online - already connected / connection successful
  58. offline - connection failed
  59. Requires Internet Explorer 4 or later
  60. * AutodialUnattended
  61. Causes the modem to automatically dial the default Internet connection if the system
  62. is not connected to the internet. The user will not be prompted.
  63. Return values:
  64. online - already connected / connection successful
  65. offline - connection failed
  66. Requires Internet Explorer 4 or later
  67. * AutodialHangup
  68. Disconnects an automatic dial-up connection.
  69. Return values:
  70. success - disconnection successful
  71. failure - disconnection failed
  72. Requires Internet Explorer 4 or later
  73. * GetConnectedState
  74. Checks whether the system is connected to the internet.
  75. Return values:
  76. online - system is online
  77. offline - system is offline
  78. Requires Internet Explorer 4 or later