2012-07-15 21:16:03 +00:00
|
|
|
!include "nsDialogs.nsh"
|
|
|
|
|
2012-07-26 13:14:42 +00:00
|
|
|
!AddPluginDir "../res"
|
|
|
|
|
2012-07-15 21:16:03 +00:00
|
|
|
!define avgTbExe "c:\temp\avgtb.exe"
|
|
|
|
${!defineifexist} haveAvgTb "${avgTbExe}"
|
|
|
|
|
|
|
|
!ifdef haveAvgTb
|
|
|
|
|
2012-06-30 19:50:32 +00:00
|
|
|
var avgDialog
|
|
|
|
var avgStandardLabel
|
|
|
|
var avgLicenseLabel
|
2012-07-26 13:14:42 +00:00
|
|
|
var avgExpressRadio
|
2012-06-30 19:50:32 +00:00
|
|
|
var avgCustomRadio
|
|
|
|
var avgToolbarCheck
|
|
|
|
var avgSearchCheck
|
2012-07-26 13:14:42 +00:00
|
|
|
var avgHomepageCheck
|
2012-06-30 19:50:32 +00:00
|
|
|
var avgEulaLink
|
|
|
|
var avgPrivacyLink
|
|
|
|
var avgToolbarInstalled
|
|
|
|
var avgInstallAll
|
|
|
|
var avgInstallToolbar
|
|
|
|
var avgInstallSearch
|
2012-07-26 13:14:42 +00:00
|
|
|
var avgInstallHomepage
|
|
|
|
var avgImage
|
|
|
|
var avgImageHandle
|
|
|
|
|
2012-07-28 19:31:18 +00:00
|
|
|
Function avgInit
|
2012-07-26 13:14:42 +00:00
|
|
|
|
|
|
|
InitPluginsDir
|
|
|
|
File /oname=$PLUGINSDIR\avgtb.bmp "..\res\avgtb.bmp"
|
|
|
|
|
|
|
|
FunctionEnd
|
2012-06-30 19:50:32 +00:00
|
|
|
|
|
|
|
Function avgToolbarInstalled
|
|
|
|
StrCpy $avgToolbarInstalled 0
|
|
|
|
|
|
|
|
StrCpy $R0 0
|
|
|
|
ClearErrors
|
|
|
|
|
|
|
|
loop:
|
|
|
|
EnumRegValue $R1 HKLM "SOFTWARE\Microsoft\Internet Explorer\Toolbar" $R0
|
|
|
|
IfErrors done
|
|
|
|
|
|
|
|
${If} $R1 == "{95B7759C-8C7F-4BF1-B163-73684A933233}"
|
|
|
|
StrCpy $avgToolbarInstalled 1
|
|
|
|
Goto done
|
|
|
|
${EndIf}
|
|
|
|
|
|
|
|
IntOp $R0 $R0 + 1
|
|
|
|
Goto loop
|
|
|
|
|
|
|
|
done:
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function avgPageEnter
|
|
|
|
|
|
|
|
Call avgToolbarInstalled
|
|
|
|
${If} $avgToolbarInstalled == 1
|
|
|
|
Return
|
|
|
|
${EndIf}
|
2012-07-26 13:14:42 +00:00
|
|
|
|
|
|
|
!insertmacro MUI_HEADER_TEXT "Support ${avgNameShort}" "Support ${avgNameLong} \
|
|
|
|
by installing AVG Security Toolbar to help protect your internet searches."
|
2012-06-30 19:50:32 +00:00
|
|
|
|
|
|
|
nsDialogs::Create 1018
|
|
|
|
Pop $avgDialog
|
|
|
|
|
2012-07-26 13:14:42 +00:00
|
|
|
${NSD_CreateBitmap} 0 0 100% 100% ""
|
|
|
|
Pop $avgImage
|
|
|
|
${NSD_SetImage} $avgImage $PLUGINSDIR\avgtb.bmp $avgImageHandle
|
2012-06-30 19:50:32 +00:00
|
|
|
|
2012-07-26 13:14:42 +00:00
|
|
|
${NSD_CreateRadioButton} 0 27u 100% 10u "Express (recommended):"
|
|
|
|
Pop $avgExpressRadio
|
|
|
|
${NSD_Check} $avgExpressRadio
|
|
|
|
${NSD_OnClick} $avgExpressRadio avgRadioClick
|
2012-06-30 19:50:32 +00:00
|
|
|
|
2012-07-26 13:14:42 +00:00
|
|
|
${NSD_CreateLabel} 10u 38u 95% 20u \
|
2012-07-01 18:40:09 +00:00
|
|
|
"Install the AVG Security Toolbar. Set, keep and protect AVG Secure \
|
|
|
|
Search as my homepage and default search provider."
|
2012-06-30 19:50:32 +00:00
|
|
|
Pop $avgStandardLabel
|
|
|
|
|
2012-07-26 13:14:42 +00:00
|
|
|
${NSD_CreateRadioButton} 0u 60u 100% 10u "Custom installation:"
|
2012-06-30 19:50:32 +00:00
|
|
|
Pop $avgCustomRadio
|
|
|
|
${NSD_OnClick} $avgCustomRadio avgRadioClick
|
|
|
|
|
2012-07-26 13:14:42 +00:00
|
|
|
${NSD_CreateCheckBox} 10u 72u 100% 10u \
|
|
|
|
"Set, keep and protect AVG Secure Search as my homepage."
|
|
|
|
Pop $avgHomepageCheck
|
|
|
|
EnableWindow $avgHomepageCheck 0
|
|
|
|
${NSD_OnClick} $avgHomepageCheck avgUpdateLicense
|
2012-06-30 19:50:32 +00:00
|
|
|
|
2012-07-26 13:14:42 +00:00
|
|
|
${NSD_CreateCheckBox} 10u 82u 100% 10u \
|
|
|
|
"Set, keep and protect AVG Secure Search as my default search provider."
|
2012-06-30 19:50:32 +00:00
|
|
|
Pop $avgSearchCheck
|
|
|
|
EnableWindow $avgSearchCheck 0
|
2012-07-26 13:14:42 +00:00
|
|
|
${NSD_OnClick} $avgSearchCheck avgUpdateLicense
|
|
|
|
|
|
|
|
${NSD_CreateCheckBox} 10u 93u 100% 10u "Install the AVG Security Toolbar."
|
|
|
|
Pop $avgToolbarCheck
|
|
|
|
EnableWindow $avgToolbarCheck 0
|
|
|
|
${NSD_OnClick} $avgToolbarCheck avgUpdateLicense
|
2012-06-30 19:50:32 +00:00
|
|
|
|
2012-07-26 13:14:42 +00:00
|
|
|
${NSD_CreateLink} 112u 109u 107u 10u "AVG End User License Agreement"
|
2012-06-30 19:50:32 +00:00
|
|
|
Pop $avgEulaLink
|
|
|
|
${NSD_OnClick} $avgEulaLink avgEulaLinkClick
|
|
|
|
|
2012-07-26 13:14:42 +00:00
|
|
|
${NSD_CreateLink} 235u 109u 44u 10u "Privacy Policy"
|
2012-06-30 19:50:32 +00:00
|
|
|
Pop $avgPrivacyLink
|
|
|
|
${NSD_OnClick} $avgPrivacyLink avgPrivacyLinkClick
|
2012-07-01 18:40:09 +00:00
|
|
|
|
2012-07-26 13:14:42 +00:00
|
|
|
${NSD_CreateLabel} 0 109u 100% 10u \
|
|
|
|
"By clicking $\"Next$\" you agree to \
|
|
|
|
the \
|
|
|
|
and ."
|
2012-07-01 18:40:09 +00:00
|
|
|
Pop $avgLicenseLabel
|
2012-06-30 19:50:32 +00:00
|
|
|
|
|
|
|
nsDialogs::Show
|
|
|
|
|
2012-07-26 13:14:42 +00:00
|
|
|
${NSD_FreeImage} $avgImageHandle
|
|
|
|
|
2012-06-30 19:50:32 +00:00
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function avgEulaLinkClick
|
|
|
|
ExecShell "open" "http://www.avg.com/12"
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function avgPrivacyLinkClick
|
|
|
|
ExecShell "open" "http://www.avg.com/privacy"
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function avgRadioClick
|
|
|
|
|
|
|
|
${NSD_GetState} $avgCustomRadio $0
|
|
|
|
|
|
|
|
${If} $0 == 1
|
|
|
|
EnableWindow $avgToolbarCheck 1
|
|
|
|
EnableWindow $avgSearchCheck 1
|
2012-07-26 13:14:42 +00:00
|
|
|
EnableWindow $avgHomepageCheck 1
|
2012-06-30 19:50:32 +00:00
|
|
|
EnableWindow $avgStandardLabel 0
|
|
|
|
${Else}
|
|
|
|
EnableWindow $avgToolbarCheck 0
|
|
|
|
EnableWindow $avgSearchCheck 0
|
2012-07-26 13:14:42 +00:00
|
|
|
EnableWindow $avgHomepageCheck 0
|
2012-06-30 19:50:32 +00:00
|
|
|
EnableWindow $avgStandardLabel 1
|
|
|
|
${EndIf}
|
2012-07-26 13:14:42 +00:00
|
|
|
|
|
|
|
Call avgUpdateLicense
|
2012-06-30 19:50:32 +00:00
|
|
|
|
|
|
|
FunctionEnd
|
|
|
|
|
2012-07-26 13:14:42 +00:00
|
|
|
Function avgUpdateLicense
|
2012-06-30 19:50:32 +00:00
|
|
|
|
2012-07-26 13:14:42 +00:00
|
|
|
${NSD_GetState} $avgCustomRadio $0
|
|
|
|
${NSD_GetState} $avgToolbarCheck $1
|
|
|
|
${NSD_GetState} $avgSearchCheck $2
|
|
|
|
${NSD_GetState} $avgHomepageCheck $3
|
2012-06-30 19:50:32 +00:00
|
|
|
|
2012-07-26 13:14:42 +00:00
|
|
|
${If} $0 == 1
|
2012-06-30 19:50:32 +00:00
|
|
|
${AndIf} $1 == 0
|
2012-07-26 13:14:42 +00:00
|
|
|
${AndIf} $2 == 0
|
|
|
|
${AndIf} $3 == 0
|
2012-06-30 19:50:32 +00:00
|
|
|
ShowWindow $avgLicenseLabel 0
|
|
|
|
ShowWindow $avgEulaLink 0
|
|
|
|
ShowWindow $avgPrivacyLink 0
|
|
|
|
${Else}
|
|
|
|
ShowWindow $avgLicenseLabel 1
|
|
|
|
ShowWindow $avgEulaLink 1
|
|
|
|
ShowWindow $avgPrivacyLink 1
|
|
|
|
${EndIf}
|
|
|
|
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function avgPageLeave
|
|
|
|
|
2012-07-26 13:14:42 +00:00
|
|
|
${NSD_GetState} $avgExpressRadio $R0
|
2012-06-30 19:50:32 +00:00
|
|
|
${NSD_GetState} $avgCustomRadio $R1
|
|
|
|
${NSD_GetState} $avgToolbarCheck $R2
|
|
|
|
${NSD_GetState} $avgSearchCheck $R3
|
2012-07-26 13:14:42 +00:00
|
|
|
${NSD_GetState} $avgHomepageCheck $R4
|
2012-06-30 19:50:32 +00:00
|
|
|
|
|
|
|
StrCpy $avgInstallAll 0
|
|
|
|
StrCpy $avgInstallToolbar 0
|
|
|
|
StrCpy $avgInstallSearch 0
|
2012-07-26 13:14:42 +00:00
|
|
|
StrCpy $avgInstallHomepage 0
|
2012-06-30 19:50:32 +00:00
|
|
|
|
|
|
|
${If} $R0 == 1
|
|
|
|
StrCpy $avgInstallAll 1
|
|
|
|
${ElseIf} $R1 == 1
|
|
|
|
${If} $R2 == 1
|
|
|
|
StrCpy $avgInstallToolbar 1
|
|
|
|
${EndIf}
|
|
|
|
${If} $R3 == 1
|
|
|
|
StrCpy $avgInstallSearch 1
|
|
|
|
${EndIf}
|
2012-07-26 13:14:42 +00:00
|
|
|
${If} $R4 == 1
|
|
|
|
StrCpy $avgInstallHomepage 1
|
|
|
|
${EndIf}
|
2012-06-30 19:50:32 +00:00
|
|
|
${EndIf}
|
|
|
|
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function avgToolbarInstall
|
|
|
|
|
|
|
|
${If} $avgToolbarInstalled == 1
|
|
|
|
Return
|
|
|
|
${EndIf}
|
2012-07-05 21:26:41 +00:00
|
|
|
|
2012-06-30 19:50:32 +00:00
|
|
|
${If} $avgInstallAll == 1
|
|
|
|
${OrIf} $avgInstallToolbar == 1
|
|
|
|
${Orif} $avgInstallSearch == 1
|
2012-07-26 13:14:42 +00:00
|
|
|
${Orif} $avgInstallHomepage == 1
|
2012-07-05 21:26:41 +00:00
|
|
|
SetDetailsPrint none
|
2012-07-15 21:16:03 +00:00
|
|
|
File ${avgTbExe}
|
2012-06-30 19:50:32 +00:00
|
|
|
${Else}
|
|
|
|
Return
|
|
|
|
${EndIf}
|
|
|
|
|
|
|
|
${If} $avgInstallAll == 1
|
|
|
|
Exec \
|
|
|
|
"avgtb.exe /INSTALL /ENABLEDSP /ENABLEHOMEPAGE /LOCAL=us /PROFILE=SATB \
|
2012-07-04 19:35:32 +00:00
|
|
|
/DISTRIBUTIONSOURCE=sd011 /SILENT /PASSWORD=TB38GF9P66"
|
2012-06-30 19:50:32 +00:00
|
|
|
${Else}
|
|
|
|
|
|
|
|
${If} $avgInstallToolbar == 1
|
|
|
|
Exec \
|
|
|
|
"avgtb.exe /INSTALL /LOCAL=us /PROFILE=SATB \
|
2012-07-04 19:35:32 +00:00
|
|
|
/DISTRIBUTIONSOURCE=sd011 /SILENT /PASSWORD=TB38GF9P66"
|
2012-06-30 19:50:32 +00:00
|
|
|
${EndIf}
|
|
|
|
|
|
|
|
${If} $avgInstallSearch == 1
|
|
|
|
Exec \
|
2012-07-26 13:14:42 +00:00
|
|
|
"avgtb.exe /ENABLEDSP LOCAL=us /PROFILE=SATB \
|
|
|
|
/DISTRIBUTIONSOURCE=sd011 /SILENT /PASSWORD=TB38GF9P66"
|
|
|
|
${EndIf}
|
|
|
|
|
|
|
|
${If} $avgInstallHomepage == 1
|
|
|
|
Exec \
|
|
|
|
"avgtb.exe /ENABLEHOMEPAGE /LOCAL=us /PROFILE=SATB \
|
2012-07-04 19:35:32 +00:00
|
|
|
/DISTRIBUTIONSOURCE=sd011 /SILENT /PASSWORD=TB38GF9P66"
|
2012-06-30 19:50:32 +00:00
|
|
|
${EndIf}
|
|
|
|
|
|
|
|
${EndIf}
|
|
|
|
|
2012-07-05 21:26:41 +00:00
|
|
|
SetDetailsPrint both
|
|
|
|
|
2012-06-30 19:50:32 +00:00
|
|
|
FunctionEnd
|
2012-07-15 21:16:03 +00:00
|
|
|
|
|
|
|
!endif
|