郴州信息港

当前位置:

迅雷NSIS安裝腳本開源

2019/05/03 来源:郴州信息港

导读

!define PRODUCT_NAME "迅雷"!define PRODUCT_VERSION "V5.7.9.486"!defi

!define PRODUCT_NAME "迅雷"

!define PRODUCT_VERSION "V5.7.9.486"

!define PRODUCT_PUBLISHER "迅雷络技术有限公司"

!define PRODUCT_WEB_SITE ""

!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\e"

!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"

!define PRODUCT_UNINST_ROOT_KEY "HKLM"

SetCompressor lzma

ReserveFile "p"

ReserveFile "p"

ReserveFile "i"

!define IOS "i"

Var INI

!include "h"

!include "h"

!define MUI_ABORTWARNING

!define MUI_HEADERIMAGE

!define MUI_HEADERIMAGE_RIGHT

!define MUI_HEADERIMAGE_BITMAP "p"

!define MUI_WELCOMEFINISHPAGE_BITMAP "p"

!define MUI_UNWELCOMEFINISHPAGE_BITMAP "p"

!define MUI_WELCOMEPAGE_TITLE "迅雷V5.7.9.486 特别版"

!define MUI_ICON "o"

!define MUI_UNICON "o"

!define MUI_COMPONENTSPAGE_SMALLDESC

!insertmacro MUI_PAGE_WELCOME

!insertmacro MUI_PAGE_LICENSE "t"

Page custom Choose

!insertmacro MUI_PAGE_DIRECTORY

!insertmacro MUI_PAGE_INSTFILES

!define MUI_PAGE_CUSTOMFUNCTION_PRE FinishPagePre

!define MUI_PAGE_CUSTOMFUNCTION_SHOW FinishPageShow

!define MUI_PAGE_CUSTOMFUNCTION_LEAVE FinishPageLeave

!define MUI_FINISHPAGE_RUN "$INSTDIR\e"

!define MUI_FINISHPAGE_SHOWREADME_TEXT "查看更新历史"

!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\Program\t"

!insertmacro MUI_PAGE_FINISH

!insertmacro MUI_UNPAGE_WELCOME

!insertmacro MUI_UNPAGE_INSTFILES

!insertmacro MUI_UNPAGE_FINISH

!insertmacro MUI_LANGUAGE "SimpChinese"

!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS

VIProductVersion "5.7.9.486"

VIAddVersionKey /LANG=2052 "ProductName" "迅雷5特别版"

VIAddVersionKey /LANG=2052 "Comments" "请仔细阅读许可协议"

VIAddVersionKey /LANG=2052 "CompanyName" "Thunder Networking Technologies,LTD"

VIAddVersionKey /LANG=2052 "LegalCopyright" ""

VIAddVersionKey /LANG=2052 "FileDescription" "xunlei"

VIAddVersionKey /LANG=2052 "FileVersion" "5.7.9.486"

Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"

OutFile "Thunder5"

InstallDir "$PROGRAMFILES\Thunder"

InstallDirRegKey HKLM "${PRODUCT_UNINST_KEY}" "UninstallString"

ShowInstDetails hide

ShowUnInstDetails hide

BrandingText ""

Section "-clean"

DeleteRegKey HKCU "Software\Microsoft\Internet Explorer\MenuExt\使用迅雷下载"

DeleteRegKey HKCU "Software\Microsoft\Internet Explorer\MenuExt\使用迅雷下载全部链接"

DeleteRegKey HKLM "SOFTWARE\Microsoft\Internet Explorer\Extensions\{0062C9BD-BDE-91AF37ACD559}"

SectionEnd

Section "基本功能(必须)" SECBasic

SectionIn ro

SetDetailsPrint textonly

DetailPrint "正在安装基本功能(必需)..."

SetDetailsPrint listonly

SetOutPath "$INSTDIR"

SetOverwrite ifnewer

File "Thunder\e"

SetOutPath "$INSTDIR\Program"

File /r "Thunder\Program\*.*"

ExecShell open "$INSTDIR\Program\e" "/exit_thunder5"

ExecShell open "$INSTDIR\Program\e" "/close_firewall"

SetOutPath "$INSTDIR\Languages"

File /r "Thunder\Languages\*.*"

SetOutPath "$INSTDIR\Plugins\XLSafeHost"

File /r "Thunder\Plugins\XLSafeHost\*.*"

SetOutPath "$INSTDIR\ComDlls"

SetOverwrite try

File /r "Thunder\ComDlls\*.*"

SetOutPath "$INSTDIR\Profiles"

File "i"

SetOutPath "$INSTDIR\Components"

File /r "Thunder\Components\*.*"

RegDLL "$INSTDIR\Components\DownAndPlay\l"

RegDLL "$INSTDIR\Components\DownAndPlay\l"

RegDLL "$INSTDIR\Components\DownAndPlay\l"

SetOutPath "$SYSDIR"

File "l"

Exec '"$INSTDIR\Program\e" /installaddin:{76F61D18-CE-BC7A-A41A45D04113}|迅雷安全下载组件|..\Components\security\l'

SectionEnd

Section "迅雷看看" SECKankan

ReadIniStr $0 "$INI" "Field 6" "state"

${If} $0 == 1

SetDetailsPrint textonly

DetailPrint "正在安装迅雷看看..."

SetDetailsPrint listonly

SetOutPath "$INSTDIR\Components\KanKan"

File /r "KanKan\*.*"

RegDLL "$INSTDIR\Components\KanKan\"

RegDLL "$INSTDIR\Components\KanKan\l"

RegDLL "$INSTDIR\Components\KanKan\l"

RegDLL "$INSTDIR\Components\KanKan\l"

RegDLL "$INSTDIR\Components\KanKan\l"

${EndIf}

SectionEnd

Section "狗狗搜索" SECGouGouTop

ReadIniStr $5 "$INI" "Field 5" "state"

${If} $5 == 1

SetDetailsPrint textonly

DetailPrint "正在安装狗狗搜索排行..."

SetDetailsPrint listonly

SetOutPath "$INSTDIR\Components\Search"

File /r "Search\*.*"

SetOutPath "$INSTDIR\Plugins\GouGouTop"

File /r "GouGouTop\*.*"

${EndIf}

SectionEnd

Section "创建快捷方式" SecDesktop

ReadIniStr $4 "$INI" "Field 4" "state"

${If} $4 == 1

SetDetailsPrint textonly

DetailPrint "正在创建快捷方式..."

SetDetailsPrint listonly

CreateShortCut "$DESKTOP\迅雷k" "$INSTDIR\e"

CreateDirectory "$SMPROGRAMS\迅雷"

CreateShortCut "$SMPROGRAMS\迅雷\启动迅雷k" "$INSTDIR\e"

CreateShortCut "$SMPROGRAMS\迅雷\更新信息.lnk" "$INSTDIR\Program\t"

CreateShortCut "$SMPROGRAMS\迅雷\卸载迅雷k" "$INSTDIR\e"

${EndIf}

SectionEnd

Section "-修复视频缓存文件夹" Vol_cache

WriteRegStr HKLM "SOFTWARE\Thunder Network\ThunderOem\thunder_backwnd" "Cache" "$APPDATA\vod_cache_data\"

SectionEnd

Section "-Regedit"

SetDetailsPrint textonly

DetailPrint "正在添加注册表信息..."

SetDetailsPrint none

WriteRegStr HKLM "SOFTWARE\Thunder Network\ThunderOem\thunder_backwnd" "Path" "$INSTDIR\e"

WriteRegStr HKLM "SOFTWARE\Thunder Network\ThunderOem\thunder_backwnd" "Version" "5.7.9.486"

WriteRegStr HKCU "Software\Microsoft\Internet Explorer\MenuExt\使用迅雷下载" "" "$INSTDIR\Program\m"

WriteRegDWORD HKCU "Software\Microsoft\Internet Explorer\MenuExt\使用迅雷下载" "Contexts" 0x

WriteRegStr HKCU "Software\Microsoft\Internet Explorer\MenuExt\使用迅雷下载全部链接" "" "$INSTDIR\Program\m"

WriteRegDWORD HKCU "Software\Microsoft\Internet Explorer\MenuExt\使用迅雷下载全部链接" "Contexts" 0x000000f3

WriteRegStr HKLM "SOFTWARE\Microsoft\Internet Explorer\Extensions\{09BA8F6D-CBB-839C-C2A6C8E6B436}" "ButtonText" "迅雷5"

WriteRegStr HKLM "SOFTWARE\Microsoft\Internet Explorer\Extensions\{09BA8F6D-CBB-839C-C2A6C8E6B436}" "Exec" "$INSTDIR\e"

WriteRegStr HKLM "SOFTWARE\Microsoft\Internet Explorer\Extensions\{09BA8F6D-CBB-839C-C2A6C8E6B436}" "Icon" "$INSTDIR\Program\o"

WriteRegStr HKLM "SOFTWARE\Microsoft\Internet Explorer\Extensions\{09BA8F6D-CBB-839C-C2A6C8E6B436}" "HotIcon" "$INSTDIR\Program\o"

WriteRegStr HKLM "SOFTWARE\Microsoft\Internet Explorer\Extensions\{09BA8F6D-CBB-839C-C2A6C8E6B436}" "MenuStatusBar" "迅雷5"

WriteRegStr HKLM "SOFTWARE\Microsoft\Internet Explorer\Extensions\{09BA8F6D-CBB-839C-C2A6C8E6B436}" "MenuText" "迅雷5"

WriteRegStr HKLM "SOFTWARE\Microsoft\Internet Explorer\Extensions\{09BA8F6D-CBB-839C-C2A6C8E6B436}" "CLSID" "{1FBA04EE-DF1F-0000F87ABD16}"

WriteRegStr HKLM "SOFTWARE\Microsoft\Internet Explorer\Extensions\{09BA8F6D-CBB-839C-C2A6C8E6B436}" "Default Visible" "Yes"

SectionEnd

Section -Post

WriteUninstaller "$INSTDIR\e"

WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\e"

WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"

WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\e"

WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\e"

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

Section Uninstall

SetDetailsPrint textonly

DetailPrint "正在卸载$(^Name)..."

SetDetailsPrint none

Delete "$INSTDIR\e"

ExecWait '"$INSTDIR\Program\e" /exit_thunder5'

ExecWait '"$INSTDIR\Program\e" /delete_bho'

ExecWait '"$INSTDIR\Program\e" /close_firewall'

ExecWait '"$INSTDIR\Program\e" fromfile|-1'

UnRegDLL "$INSTDIR\Components\KanKan\"

UnRegDLL "$INSTDIR\Components\KanKan\l"

UnRegDLL "$INSTDIR\Components\KanKan\l"

UnRegDLL "$INSTDIR\Components\KanKan\l"

UnRegDLL "$INSTDIR\Components\KanKan\l"

UnRegDLL "$INSTDIR\Components\DownAndPlay\l"

UnRegDLL "$INSTDIR\Components\DownAndPlay\l"

UnRegDLL "$INSTDIR\Components\DownAndPlay\l"

UnRegDLL "$INSTDIR\ComDlls\l"

UnRegDLL "$INSTDIR\ComDlls\l"

UnRegDLL "$INSTDIR\ComDlls\l"

Delete "$INSTDIR\e"

Delete "$DESKTOP\迅雷k"

Delete "$SMPROGRAMS\迅雷\迅雷5 卸载.lnk"

Delete "$SMPROGRAMS\迅雷\迅雷k"

RMDir /r "$SMPROGRAMS\迅雷"

RMDir /r "$INSTDIR\Skins"

RMDir /r "$INSTDIR\Languages"

RMDir /r /REBOOTOK "$INSTDIR\TDTmp"

RMDir /r /REBOOTOK "$INSTDIR\Program"

RMDir /r /REBOOTOK "$INSTDIR\Components"

RMDir /r /REBOOTOK "$INSTDIR\ComDlls"

RMDir /r /REBOOTOK "$INSTDIR\Plugins"

DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"

DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"

DeleteRegKey HKCR "bittorrent\shell\open\command"

DeleteRegKey HKCR "bittorrent\shell\open"

DeleteRegKey HKCR "bittorrent\shell"

DeleteRegKey HKCR "bittorrent\DefaultIcon"

DeleteRegKey HKCR "bittorrent"

DeleteRegKey HKCU "Software\Microsoft\Internet Explorer\MenuExt\使用迅雷下载全部链接"

DeleteRegKey HKCU "Software\Microsoft\Internet Explorer\MenuExt\使用迅雷下载"

DeleteRegKey HKLM "SOFTWARE\Thunder Network\ThunderOem\thunder_backwnd"

DeleteRegKey HKLM "SOFTWARE\Thunder Network\ThunderOem"

DeleteRegKey HKLM "SOFTWARE\Thunder Network"

System::Call 'l::SHChangeNotify(i, i, i, i) v (0x, 0, 0, 0)'

HideWindow

MessageBox MB_ICONINFORMATION|MB_OK "迅雷5 卸载完成。$\r$\r有些内容不能被删除。您可以手工删除它们。"

SetAutoClose true

SectionEnd

Function .onInit

InitPluginsDir

File "/oname=$PLUGINSDIR\i" "i"

GetTempFileName $INI $PLUGINSDIR

File /oname=$INI "i"

!addplugindir "${NSISDIR}\Plugins"

FindProcDLL::FindProc "e"

StrCmp $R0 1 +1 +6

MessageBox MB_ICONINFORMATION|MB_ABORTRETRYIGNORE "检测到 迅雷 正在运行!疏忽:强制安装;终止:退出安装程序!" /SD IDABORT IDRETRY Retry IDIGNORE Ignore

Abort

Retry:

Goto -4

Ignore:

Goto +1

KillProcDLL::KillProc "e"

FunctionEnd

Function Choose

InstallOptions::initDialog /NOUNLOAD "$INI"

!insertmacro MUI_HEADER_TEXT "选定使用环境" "选者使用环境,获得推荐的安全配置,以更好的保护帐号安全."

ReadINIStr $0 "$INI" "Field 1" "HWND"

CreateFont $R2 "宋体" 9 700

SendMessage $0 ${WM_SETFONT} $R2 0

SetCtlColors $0 /BRANDING '0x009300' ''

ReadINIStr $0 "$INI" "Field 5" "HWND"

SetCtlColors $0 0x000000 0xFFFFFF

ReadINIStr $0 "$INI" "Field 6" "HWND"

SetCtlColors $0 0x000000 0xFFFFFF

ReadINIStr $0 "$INI" "Field 7" "HWND"

SetCtlColors $0 0x000000 0xFFFFFF

InstallOptions::show

FunctionEnd

Function FinishPagePre

WriteINIStr "$PLUGINSDIR\i" "Settings" "NumFields" "6"

WriteINIStr "$PLUGINSDIR\${IOS}" "Field 6" "Type" "CheckBox"

WriteINIStr "$PLUGINSDIR\${IOS}" "Field 6" "State" "0"

WriteINIStr "$PLUGINSDIR\${IOS}" "Field 6" "Text" "下载更多精品软件,访问迅雷站(D)"

WriteINIStr "$PLUGINSDIR\${IOS}" "Field 6" "Left" "120"

WriteINIStr "$PLUGINSDIR\${IOS}" "Field 6" "Right" "315"

WriteINIStr "$PLUGINSDIR\${IOS}" "Field 6" "Top" "129"

WriteINIStr "$PLUGINSDIR\${IOS}" "Field 6" "Bottom" "140"

FunctionEnd

Function FinishPageShow

ReadINIStr $0 "$PLUGINSDIR\${IOS}" "Field 6" "HWND"

SetCtlColors $0 0x000000 0xFFFFFF

FunctionEnd

Function FinishPageLeave

ReadINIStr $0 "$PLUGINSDIR\${IOS}" "Field 6" "State"

StrCmp $0 "1" +1 +2

ExecShell open ""

FunctionEnd

Function .onInstSuccess

HideWindow

Exec '"$INSTDIR\Program\e" /register_plugins'

Exec '"$INSTDIR\Program\e" /open_firewall'

Exec '"$INSTDIR\Program\e" /for_all_users'

ExecWait '"$INSTDIR\Program\e" /installaddin:{76F61D18-CE-BC7A-A41A45D04113}|迅雷安全下载组件|..\Components\security\l'

Sleep 500

ReadIniStr $6 "$INI" "Field 6" "state"

${If} $6 == 1

ExecWait '"$INSTDIR\Program\e" /Installaddin:{EBDFA-4CC5-B6F2-B7C5E5D59735}|迅雷看看|..\Plugins\KanKanTop\l'

${EndIf}

Sleep 500

ReadIniStr $5 "$INI" "Field 5" "state"

${If} $5 == 1

ExecWait '"$INSTDIR\Program\e" /Installaddin:{1FC7CACDAcb0-B440-C069956CC0CA}|狗狗搜索排行|..\Plugins\GouGouTop\l'

${EndIf}

FunctionEnd

南京市民多数支持闯红灯罚款
苏州狮子林百岁腊梅迎冬绽放
乳房瘙痒异常小心是特殊的癌
标签