using plugin inetc.dll
can sync with scheduler
Code: Select all
;--------------------------------
; General Attributes
Name "adblock.ini updater"
OutFile "adblock.ini updater.exe"
BrandingText " "
;SilentInstall silent
AutoCloseWindow True
CRCCheck off
SetCompressor /SOLID lzma
VIProductVersion "0.0.0.1"
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "adblock.ini Updater"
VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" ""
VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "SRWare Iron Forum"
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalTrademarks" "SRWARE Iron - adblock.ini updater is a copyleft :)"
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Copyleft :) 2o11"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "SRWare Iron - adblock.ini updater for Windows XP/2003/Vista/2008/7"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "0.0.0.1"
;--------------------------------
;Interface Settings
!include "MUI.nsh"
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
!insertmacro MUI_PAGE_INSTFILES
;SetFont 14
;--------------------------------
;Installer Sections
Section "Dummy Section" SecDummy
SetDetailsView hide
; single file,
inetc::get /useragent "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.1 (KHTML, like Gecko) Chrome/6.0.417.0 Safari/534.1" /popup "" /caption "Please Wait" /canceltext "Cancel" "http://www.fanboy.co.nz/adblock/iron/complete/adblock.ini" "C:\Program Files\SRWare Iron\adblock.ini" /end
Pop $2 # return value = exit code, "OK" means OK
MessageBox MB_OK "Download Status: [ $2 ]"
SectionEnd
;--------------------------------
;Installer Functions
Function .onInit
; plug-in auto-recognizes 'no parent dlg' in onInit and works accordingly
; inetc::head /useragent "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.1 (KHTML, like Gecko) Chrome/6.0.417.0 Safari/534.1" /RESUME "Network error. Retry?" "http://www.fanboy.co.nz/adblock/iron/complete/adblock.ini" "C:\Program Files\SRWare Iron\adblock.ini"
; Pop $4
FunctionEnd