脚本:迅雷5.5.1.241

优质
小牛编辑
133浏览
2023-12-01
; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "迅雷"
!define PRODUCT_VERSION "5.5.1.241"
!define PRODUCT_PUBLISHER "Ayu"
!define PRODUCT_WEB_SITE "http://ayux.net/bbs/index.php"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"

SetCompressor /SOLID lzma
SetCompressorDictSize 128

; MUI 1.67 compatible ------
!include "MUI.nsh"

; MUI Settings
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install-blue.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall-blue.ico"
!define MUI_WELCOMEFINISHPAGE_BITMAP "WizardImage.bmp"
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "WizardImage.bmp"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "WizardSmallImage.bmp"
!define MUI_HEADERIMAGE_RIGHT
!define MUI_LICENSEPAGE_BUTTON "我同意(&I)"

; Welcome page
!insertmacro MUI_PAGE_WELCOME
; License page
!insertmacro MUI_PAGE_LICENSE "licence.txt"
; Components page
!insertmacro MUI_PAGE_COMPONENTS
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!define MUI_FINISHPAGE_RUN "$INSTDIR\Thunder.exe"
!insertmacro MUI_PAGE_FINISH

; Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES

; Language files
!insertmacro MUI_LANGUAGE "SimpChinese"

; Reserve files
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS

; MUI end ------

Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "Thunder.v5.5.1.241.NoAD-Ayu.exe"
InstallDir "$PROGRAMFILES\Thunder"
InstallDirRegKey HKLM "SOFTWARE\Thunder Network\ThunderOem\thunder_backwnd" "Path"
BrandingText "AyuX.net Made by Ayu"

Section "-pre"
SetOverwrite off
SetOutPath "$SYSDIR"
File "pre\msvcp60.dll"
SetOverwrite on
SectionEnd

Section "主程序" SEC_PROGRAM
SectionIn RO
SetOverwrite off
SetOutPath "$INSTDIR\Profiles"
File /r "Profiles\*.*"
SetOutPath "$INSTDIR\ComDlls"
File /r "ComDlls\*.*"
SetOverwrite on
SetOutPath "$INSTDIR"
File /r "Thunder\*.*"
SectionEnd

Section "IE右键菜单" SEC_IEMENUEXT
WriteRegStr HKLM "SOFTWARE\Thunder Network\ThunderOem\thunder_backwnd" "Path" "$INSTDIR\Thunder.exe"
WriteRegStr HKCU "Software\Microsoft\Internet Explorer\MenuExt\使用迅雷下载" "" "$INSTDIR\Program\geturl.htm"
WriteRegDWORD HKCU "Software\Microsoft\Internet Explorer\MenuExt\使用迅雷下载" "Contexts" 0x22
WriteRegStr HKCU "Software\Microsoft\Internet Explorer\MenuExt\使用迅雷下载全部链接" "" "$INSTDIR\Program\getallurl.htm"
WriteRegDWORD HKCU "Software\Microsoft\Internet Explorer\MenuExt\使用迅雷下载全部链接" "Contexts" 0xf3
RegDLL "$INSTDIR\ComDlls\TGSearch.dll"
RegDLL "$INSTDIR\ComDlls\ThunderAgent_004.dll"
RegDLL "$INSTDIR\ComDlls\XunLeiBHO_004.dll"
SectionEnd

SectionGroup /e "快捷方式" SECGRP_SHORTCUT
Section "桌面" SEC_DESKTOP
CreateShortCut "$DESKTOP\迅雷.lnk" "$INSTDIR\Thunder.exe"
SectionEnd
Section "开始菜单" SEC_SMPROGRAMS
CreateDirectory "$SMPROGRAMS\迅雷"
CreateShortCut "$SMPROGRAMS\迅雷\启动迅雷.lnk" "$INSTDIR\Thunder.exe"
CreateShortCut "$SMPROGRAMS\迅雷\卸载迅雷.lnk" "$INSTDIR\uninst.exe"
SectionEnd
SectionGroupEnd

Section -Post
WriteUninstaller "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\Thunder.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
SectionEnd


Function un.onUninstSuccess
HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
FunctionEnd

Function un.onInit
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
Abort
FunctionEnd

Section Uninstall
UnRegDLL "$INSTDIR\ComDlls\TGSearch.dll"
UnRegDLL "$INSTDIR\ComDlls\ThunderAgent_004.dll"
UnRegDLL "$INSTDIR\ComDlls\XunLeiBHO_004.dll"
DeleteRegKey HKCR "CLSID\{DD069A98-B494-487D-B0B3-C2F56ECB6DAA}"
DeleteRegKey HKCR "TGSearch.Search"
DeleteRegKey HKCR "TGSearch.Search.1"
DeleteRegKey HKCR "TypeLib\{A329DA93-0F8B-4F1C-9CA3-A51A4802C9E2}"
DeleteRegKey HKCR "Interface\{F4C72227-EFD5-4D8D-AB6B-C4CAB37CE892}"
DeleteRegKey HKLM "SOFTWARE\Thunder Network"
DeleteRegKey HKCU "Software\Microsoft\Internet Explorer\MenuExt\使用迅雷下载"
DeleteRegKey HKCU "Software\Microsoft\Internet Explorer\MenuExt\使用迅雷下载全部链接"

Delete "$DESKTOP\迅雷.lnk"
RMDir /r "$SMPROGRAMS\迅雷"

MessageBox MB_YESNO "是否保留设置文件和历史记录?" IDYES FOR_YES IDNO FOR_NO
FOR_YES:
Delete "$INSTDIR\AyuConfig.exe"
Delete "$INSTDIR\uninst.exe"
Delete "$INSTDIR\Thunder.exe"
RMDir /r /REBOOTOK "$INSTDIR\ComDlls"
RMDir /r "$INSTDIR\Components"
RMDir /r "$INSTDIR\Languages"
RMDir /r "$INSTDIR\Program"
RMDir /r "$INSTDIR\Skins"
Goto NEXT
FOR_NO:
RMDir /r /REBOOTOK "$INSTDIR"
NEXT:

DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
SetAutoClose true
SectionEnd

; Section descriptions
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_PROGRAM} "迅雷主程序"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_IEMENUEXT} "将 使用迅雷下载 添加到IE右键菜单"
!insertmacro MUI_DESCRIPTION_TEXT ${SECGRP_SHORTCUT} "创建快捷方式"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_DESKTOP} "创建桌面快捷方式"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_SMPROGRAMS} "创建开始菜单快捷方式"
!insertmacro MUI_FUNCTION_DESCRIPTION_END