kotkovets, спасибо за оперативную помощ но:
Код:
!include "$%WinDir%\Temp\ESETSIM\defines.txt"
!define /date date "%H:%M %d %b, %Y"
!define version "5.0.94.8"
VIAddVersionKey /LANG=1049 "ProductName" "ESET Antivirus"
VIAddVersionKey /LANG=1049 "Comments" "Built on ${date}"
VIAddVersionKey /LANG=1049 "CompanyName" "Alexey_KF"
VIAddVersionKey /LANG=1049 "LegalCopyright" "Copyright (c) Eset 1992-2011"
VIAddVersionKey /LANG=1049 "FileDescription" "Alexey_KF & Antivirus"
VIAddVersionKey /LANG=1049 "FileVersion" "${version}"
VIAddVersionKey /LANG=1049 "OriginalFilename" "EsetClient.exe"
VIProductVersion "${version}"
SetCompressor /SOLID lzma
SetCompressorDictSize 32
SilentInstall silent
Name "ESET Antivirus"
XPStyle on
Icon install.ico
ChangeUI IDD_VERIFY progress.exe
OutFile "${Path}\Eset_5_garant.exe"
SubCaption 3 " "
ShowInstDetails nevershow
!include FileFunc.nsh
!include x64.nsh
!insertmacro GetRoot
!insertmacro DriveSpace
!insertmacro GetOptions
!insertmacro GetParameters
var bit
var product
var setup
var silent
Function .onInit
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "EsetSIM") i .r1 ?e'
Pop $R0
StrCmp $R0 0 +2
Quit
${GetRoot} "$WINDIR" $R0
${DriveSpace} "$R0" "/D=F /S=M" $R1
IntCmp $R1 300 +3 0 +3
MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "На системном диске должно быть более$\n300 мегабайт свободного места.$\nУстановка антивируса отменена!"
Quit
ReadEnvStr $0 OS
StrCmp $0 "Windows_NT" 0 begin
ClearErrors
UserInfo::GetAccountType
IfErrors +3
Pop $0
StrCmp $0 "Admin" begin
MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "Для установки программы у пользователя$\nдолжны быть права администратора.$\nУстановка антивируса отменена!"
Quit
begin:
ReadRegStr $0 HKLM "SOFTWARE\ESET\ESET Security\CurrentVersion\Info" "InstallDir"
IfErrors run
StrCpy $1 $0 "" -1
StrCmp $1 "\" 0 +2
StrCpy $0 $0 -1
IfFileExists "$0" 0 run
SetOutPath "$0\Updates"
Delete "$OutDir\*"
File /nonfatal /x em011_*.nup /x *_r*.nup "$%WinDir%\Temp\EsetSIM\Distrib\Updfiles\*.nup" "$%WinDir%\Temp\EsetSIM\Distrib\Updfiles\update.ver"
IfFileExists "$OutDir\update.ver" 0 run
WriteRegStr HKLM "SOFTWARE\ESET\ESET Security\CurrentVersion\Plugins\01000400\Profiles\@My profile" "SelectedServer" "$OutDir"
IfSilent +2
MessageBox MB_OK|MB_ICONINFORMATION|MB_TOPMOST "Антивирусные базы скопированы.$\nНажмите $\"Обновить$\" в главном окне."
Quit
run:
ClearErrors
StrCpy $R0 "G DATA Software"
StrCpy $0 "SYSTEM\CurrentControlSet\Services\AVKWCtl"
EnumRegKey $R1 HKLM $0 0
IfErrors 0 conflicts
ClearErrors
StrCpy $R0 "AVAST Antivirus"
StrCpy $0 "Software\ALWIL Software\Avast\4.0"
EnumRegKey $R1 HKLM $0 0
IfErrors +4
ReadRegStr $R1 HKLM $0 Avast4ProgramFolder
IfFileExists $R1\aswRunDll.exe conflicts
DeleteRegKey HKLM $0
ClearErrors
StrCpy $1 "Software\Wow6432Node\ALWIL Software\Avast\4.0"
EnumRegKey $R2 HKLM $1 0
IfErrors +4
ReadRegStr $R1 HKLM $0 Avast4ProgramFolder
IfFileExists $R1\aswRunDll.exe conflicts
DeleteRegKey HKLM $0
ClearErrors
StrCpy $R0 "AVG Antivirus or Internet Security"
StrCpy $0 "SYSTEM\CurrentControlSet\Services\AvgCoreSvc"
StrCpy $1 "SYSTEM\CurrentControlSet\Services\avg8wd"
EnumRegKey $R1 HKLM $0 0
EnumRegKey $R2 HKLM $1 0
IfErrors 0 conflicts
ClearErrors
StrCpy $R0 "Kaspersky Antivirus or Internet Security"
StrCpy $0 "SYSTEM\CurrentControlSet\Services\AVP"
EnumRegKey $R1 HKLM $0 0
IfErrors 0 conflicts
ClearErrors
StrCpy $R0 "Symantec Software"
StrCpy $0 "SYSTEM\CurrentControlSet\Services\ccEvtMgr"
EnumRegKey $R1 HKLM $0 0
IfErrors 0 conflicts
ClearErrors
StrCpy $R0 "Panda Software"
StrCpy $0 "SYSTEM\CurrentControlSet\Services\PAVSRV"
EnumRegKey $R1 HKLM $0 0
IfErrors 0 conflicts
ClearErrors
StrCpy $R0 "Avira Antivirus or Security Suite"
StrCpy $0 "SYSTEM\CurrentControlSet\Services\AntiVirService"
EnumRegKey $R1 HKLM $0 0
IfErrors 0 conflicts
ClearErrors
StrCpy $R0 "BitDefender Software"
StrCpy $0 "SOFTWARE\BitDefender"
EnumRegKey $R1 HKLM $0 0
IfErrors 0 conflicts
ClearErrors
StrCpy $R0 "CA Software"
StrCpy $0 "SYSTEM\CurrentControlSet\Services\CAISafe"
EnumRegKey $R1 HKLM $0 0
IfErrors 0 conflicts
ClearErrors
StrCpy $R0 "F-Secure Software"
StrCpy $0 "SYSTEM\CurrentControlSet\Services\Eventlog\System\F-Secure Gatekeeper"
EnumRegKey $R1 HKLM $0 0
IfErrors 0 conflicts
ClearErrors
StrCpy $R0 "McAfee Software"
StrCpy $0 "SYSTEM\CurrentControlSet\Services\McShield"
EnumRegKey $R1 HKLM $0 0
IfErrors 0 conflicts
ClearErrors
StrCpy $R0 "Windows Live OneCare"
StrCpy $0 "SYSTEM\CurrentControlSet\Services\OneCareMP"
EnumRegKey $R1 HKLM $0 0
IfErrors 0 conflicts
ClearErrors
StrCpy $R0 "TrendMicro Software"
StrCpy $0 "SYSTEM\CurrentControlSet\Services\SfCtlCom"
EnumRegKey $R1 HKLM $0 0
IfErrors 0 conflicts
ClearErrors
StrCpy $R0 "TrustPort Antivirus or PC Security"
StrCpy $0 "SYSTEM\CurrentControlSet\Services\avas_service"
EnumRegKey $R1 HKLM $0 0
IfErrors 0 conflicts
ClearErrors
StrCpy $R0 "Norman Antivirus or Security Suite"
StrCpy $0 "SYSTEM\CurrentControlSet\Services\nsesvc"
EnumRegKey $R1 HKLM $0 0
IfErrors 0 conflicts
ClearErrors
StrCpy $R0 "Rising Antivirus"
StrCpy $0 "SYSTEM\CurrentControlSet\Services\RsRavMon"
EnumRegKey $R1 HKLM $0 0
IfErrors 0 conflicts
ClearErrors
StrCpy $R0 "Bullguard Internet Security"
StrCpy $0 "SYSTEM\CurrentControlSet\Services\BsFileScan"
EnumRegKey $R1 HKLM $0 0
IfErrors 0 conflicts
ClearErrors
StrCpy $R0 "Sunbelt VIPRE Antivirus"
StrCpy $0 "SYSTEM\CurrentControlSet\Services\SBAMSvc"
EnumRegKey $R1 HKLM $0 0
IfErrors 0 conflicts
ClearErrors
Goto +3
conflicts:
MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "Внимание! На вашем компьютере уже установлен $R0$\nУдалите его из Панели управления и запустите установку снова"
Quit
${GetParameters} $R0
StrCpy $silent qb
${GetOptions} "$R0" "/eav" $product
IfErrors +4
StrCpy $product "eav"
StrCpy $silent qn
Goto bit
ClearErrors
messagebox::show MB_DEFBUTTON3|MB_TOPMOST "Production by Alexey_KF" "0,103" "Сборка собрана на инсталляторах:$\n$\nESET NOD32 Antivirus Business Edition 5.0.94.8 32-bit Final$\n$\nESETNOD32 Antivirus Business Edition 5.0.94.8 Final 64-bit$\n$\nУстанавливается на Windows NT ОС х86 и х64 (Авто выбор)$\n$\nСпециально для soft.4local.ru" "Установка" "Отмена"
Pop $product
StrCmp $product "1" 0 +3
StrCpy $product "eav"
Goto bit
Quit
bit:
${If} ${RunningX64}
StrCpy $bit 64
${Else}
StrCpy $bit 32
${EndIf}
FunctionEnd
Section Install
File cfg.xml
SetOutPath "$WINDIR\Temp\EsetSIM"
File /nonfatal "/oname=$WINDIR\Temp\EsetSIM\cfg.xml" "eset.xml"
StrCmp $product "eav" 0
StrCmp $bit "32" 0 eav64
File /r "Distrib\eavbe_nt32_rus\*.*"
File /nonfatal "/oname=$WINDIR\Temp\EsetSIM\cfg.xml" "eav.xml"
StrCpy $setup eavbe_nt32_rus
Goto install
eav64:
StrCmp $bit "64" 0 exit
File /r "Distrib\eavbe_nt64_rus\*.*"
File /nonfatal "/oname=$WINDIR\Temp\EsetSIM\cfg.xml" "eav.xml"
StrCpy $setup eavbe_nt64_rus
Goto install
install:
SetOutPath "$WINDIR\Temp\EsetSIM\APPDATADIR\Updfiles"
File /nonfatal /x em011_*.nup /x *_r*.nup "$%WinDir%\Temp\EsetSIM\Distrib\Updfiles\*.nup"
IfFileExists "$EXEDIR\Updates\update.ver" 0 start
IfFileExists "$EXEDIR\Updates\em000_32_l0.nup" 0 start
IfFileExists "$EXEDIR\Updates\em005_32_l0.nup" 0 start
CopyFiles /silent /filesonly "$EXEDIR\Updates\*.nup" "$WINDIR\Temp\EsetSIM\APPDATADIR\Updfiles"
start:
ReadRegStr $0 HKLM "SOFTWARE\ESET\ESET Security\CurrentVersion\Info" "InstallDir"
ExecWait '"$SYSDIR\msiexec.exe" /i "$WINDIR\Temp\EsetSIM\$setup.msi" /$silent'
WriteRegDWORD HKCU "Software\ESET\ESET Security\CurrentVersion\Client" "ShowSplash" 0x00000000
WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\ESET\ESET Security\CurrentVersion\Info" "PackageFeatures" 0x1
WriteRegStr HKLM "SOFTWARE\ESET\ESET Security\CurrentVersion\Plugins\01000400\UI_Settings\Servers"Server_0" "http://4local.ru:2221"
WriteRegStr HKLM "SOFTWARE\ESET\ESET Security\CurrentVersion\Plugins\01000400\Profiles\@My profile" "SelectedServer" "http://4local.ru:2221"
ClearErrors
IfErrors exit
StrCpy $1 $0 "" -1
StrCmp $1 "\" 0 +2
StrCpy $0 $0 -1
IfFileExists "$0" 0 exit
File /nonfatal "/oname=$0\License\eset.lic" "eset.lic"
exit:
SetOutPath "$WINDIR\Temp"
RMDir /r /rebootok "$WINDIR\Temp\EsetSIM"
Quit
SectionEnd
что не так? почему после установки антивируса не изменяется реестр???
Все таки сработала одна строка из 3-ех:
Код:
WriteRegStr HKLM "SOFTWARE\ESET\ESET Security\CurrentVersion\Plugins\01000400\UI_Settings\Servers"Server_0" "http://4local.ru:2221"
а почему 2 остальные не стработали?