脚本:ESET NOD32 Antivirus 3.0.659.0

优质
小牛编辑
141浏览
2023-12-01
引用脚本内容:

SetCompressor /SOLID lzma
SetCompressorDictSize 32!include "MUI.nsh"
!include "logiclib.nsh"
!include "WinMessages.nsh"
!define MUI_ABORTWARNING
!define MUI_ICON "nod32.ico"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "header.bmp"
!define MUI_HEADERIMAGE_RIGHT
page custom io1 leave
page custom io2
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "SimpChinese"
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
ReserveFile "io1.ini"
ReserveFile "header.bmp"
ReserveFile "io2.ini"
ReserveFile "fix.ico"
ReserveFile "del.ico"
OutFile "NodSet.exe"
InstallDir "$EXEDIR"
Caption "ESET NOD32 Antivirus 安装/卸载"
BrandingText "ESET NOD32 Antivirus 3.0.659.0"
Section
!insertmacro MUI_INSTALLOPTIONS_READ $0 "io1.ini" "Settings" "Check"
StrCmp $0 "fix" 0 +3
Call inst
Quit
StrCmp $0 "del" 0 +3
Call uninst
Quit
SectionEnd
Function .onInit
;IfFileExists "$EXEDIR\egui.exe" +3
;  MessageBox MB_OK|MB_ICONEXCLAMATION "请把本程序放在NOD32安装目录下运行!"
;  Quit
  !insertmacro MUI_INSTALLOPTIONS_EXTRACT "io1.ini"
  !insertmacro MUI_INSTALLOPTIONS_EXTRACT "io2.ini"
  !insertmacro MUI_INSTALLOPTIONS_EXTRACT "fix.ico"
  !insertmacro MUI_INSTALLOPTIONS_EXTRACT "del.ico"
  !insertmacro MUI_INSTALLOPTIONS_WRITE "io1.ini" "Field 1" "Text" "$PLUGINSDIR\fix.ico"
  !insertmacro MUI_INSTALLOPTIONS_WRITE "io1.ini" "Field 3" "Text" "$PLUGINSDIR\del.ico"
FunctionEnd
Function io1
  Push $R1
  Push $R2
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "io1.ini"
GetDlgItem $R1 $HWNDPARENT 1
ShowWindow $R1 ${SW_HIDE}
!insertmacro MUI_INSTALLOPTIONS_READ $R1 "io1.ini" "Field 5" "HWND"
CreateFont $R2 "$(^Font)" "$(^FontSize)" "700"
SendMessage $R1 ${WM_SETFONT} $R2 0
!insertmacro MUI_INSTALLOPTIONS_READ $R1 "io1.ini" "Field 7" "HWND"
SendMessage $R1 ${WM_SETFONT} $R2 0
!insertmacro MUI_HEADER_TEXT "修改、修复或删除安装" "选择您想执行的操作。"
!insertmacro MUI_INSTALLOPTIONS_SHOW
  Pop $R2
  Pop $R1
FunctionEnd
Function leave
!insertmacro MUI_INSTALLOPTIONS_READ $0 "io1.ini" "Settings" "State"
${Switch} $0
${Default}
Abort
${Case} 2
    !insertmacro MUI_INSTALLOPTIONS_WRITE "io1.ini" "Settings" "Check" "fix"
    !insertmacro MUI_INSTALLOPTIONS_WRITE "io2.ini" "Field 1" "Text" "单击“修复”来修复 ESET NOD32 Antivirus的安装。如果您想复查或更改您的安装设置,请单击“上一步”。单击“取消”可退出向导。"
    Goto skip
    ${Case} 4
    !insertmacro MUI_INSTALLOPTIONS_WRITE "io1.ini" "Settings" "Check" "del"
    !insertmacro MUI_INSTALLOPTIONS_WRITE "io2.ini" "Field 1" "Text" "单击“删除”来从您的计算机删除 ESET NOD32 Antivirus。如果您想复查或更改您的安装设置,请单击“上一步”。单击“取消”可退出向导。"
skip:
    ${Case} 0
${EndSwitch}
FunctionEnd
!macro MY_INSTALLOPTIONS str ht1 ht2
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "io2.ini"
GetDlgItem $R1 $HWNDPARENT 1
SendMessage $R1 ${WM_SETTEXT} 0 "STR:${str}"
!insertmacro MUI_HEADER_TEXT "${ht1}" "${ht2}"
!insertmacro MUI_INSTALLOPTIONS_SHOW
!macroend
Function io2
GetDlgItem $R1 $HWNDPARENT 1
ShowWindow $R1 ${SW_SHOW}
!insertmacro MUI_INSTALLOPTIONS_READ $0 "io1.ini" "Settings" "Check"
StrCmp $0 "fix" 0 +2
!insertmacro MY_INSTALLOPTIONS "修复(R)" "修复 ESET NOD32 Antivirus" "安装向导准备开始修复 ESET NOD32 Antivirus。"
StrCmp $0 "del" 0 +2
!insertmacro MY_INSTALLOPTIONS "删除(R)" "删除 ESET NOD32 Antivirus" "您已选择从您的计算机删除程序。"
FunctionEnd
Function inst
;在这里放上绿化的代码
;....................
HideWindow
MessageBox MB_OK|MB_ICONINFORMATION "NOD32 已修复成功!"
Return
FunctionEnd
Function uninst
;在这里放上卸载的代码
;....................
HideWindow
MessageBox MB_OK|MB_ICONINFORMATION "NOD32 已卸载成功!"
Return
FunctionEnd

引用 IO1.ini 的内容:

[Settings]
NumFields=8
[Field 1]
Type=Icon
Left=35
Right=64
Top=30
Bottom=56
Flags=GROUP
[Field 2]
Type=Button
Left=26
Right=63
Top=21
Bottom=58
Flags=GROUP|NOTIFY
Text=P
[Field 3]
Type=Icon
Left=35
Right=64
Top=75
Bottom=99
Flags=GROUP
[Field 4]
Type=Button
Left=26
Right=63
Top=68
Bottom=104
Flags=GROUP|NOTIFY
Text=R
[Field 5]
Type=Label
Text=修复(P)
Left=76
Right=-4
Top=25
Bottom=40
Flags=GROUP
[Field 6]
Type=Label
Text=修复最近的安装状态中的错误 - 修正丢失或损坏的文件、\r\n快捷方式和注册表项目。
Left=76
Right=-1
Top=36
Bottom=56
[Field 7]
Type=Label
Text=删除(R)
Left=76
Right=-1
Top=73
Bottom=81
Flags=GROUP
[Field 8]
Type=Label
Text=从您的计算机删除 ESET NOD32 Antivirus。
Left=76
Right=-1
Top=84
Bottom=95

引用 IO2.ini 的内容:

[Settings]
NumFields=1
[Field 1]
Type=Label
Left=0
Right=-1
Top=14
Bottom=38