//*安装代码*//
$AppData = StringLeft(@AppDataCommonDir, StringInStr(@AppDataCommonDir, "/", 0, -1) - 1) ;处理安装或卸载迅雷遗留的旧文件和注册表 RegDelete("HKCR/SOFTWARE/thunder") RegDelete("HKLM/SOFTWARE/Thunder Network") RegDelete("HKLM/SOFTWARE/Wow6432Node/Thunder Network") RegDelete("HKCU/Software/Microsoft/Internet Explorer/MenuExt/使用迅雷下载") RegDelete("HKCU/Software/Microsoft/Internet Explorer/MenuExt/使用迅雷下载全部链接") DirRemove(@HomeDrive & "/Users/Public/Thunder Network", 1) DirRemove(@HomeDrive & "/Users/Public/Documents/Thunder Network", 1) DirRemove(@TempDir & "/LiveUD", 1) DirRemove(@TempDir & "/Thunder Network", 1) DirRemove(@TempDir & "/Xunlei", 1) DirRemove(@AppDataCommonDir & "/Thunder Network", 1) DirRemove($AppData & "/Thunder Network", 1) DirRemove(@AppDataCommonDir & "/Xunlei", 1) DirRemove(@AppDataDir & "/Thunder Network", 1) DirRemove(@AppDataDir & "/Xunlei", 1) DirRemove(@CommonFilesDir & "/Xunlei", 1) DirRemove(@CommonFilesDir & "/Thunder Network", 1) DirRemove(@CommonFilesDir & "/迅雷7", 1) DirRemove(@AppDataDir & "/LocalLow/Thunder Network", 1) DirRemove(@AppDataDir & "/LocalLow/Xunlei", 1) ; FileCopy(@ScriptDir & "/Program/atl71.dll", @SystemDir & "/") ;添加IE浏览器支持 RunWait(@ComSpec & " /c " & 'Regsvr32 /s "' & @ScriptDir & '/BHO/ThunderAgent.dll"', "", @SW_HIDE) RunWait(@ComSpec & " /c " & 'Regsvr32 /s "' & @ScriptDir & '/BHO/XunLeiBHO.dll"', "", @SW_HIDE) RunWait(@ComSpec & " /c " & '"' & @ScriptDir & '/BHO/XLNonIESvr.exe" ie -silent -setfirst', "", @SW_HIDE) ;添加Chrome浏览器支持 RunWait(@ComSpec & " /c " & '"' & @ScriptDir & '/BHO/XLNonIESvr.exe" -r chrome -silent -setfirst', "", @SW_HIDE) ;添加360安全浏览器支持 RunWait(@ComSpec & " /c " & '"' & @ScriptDir & '/BHO/XLNonIESvr.exe" -r 360 -silent -setfirst', "", @SW_HIDE) ;添加世界之窗浏览器支持...") RunWait(@ComSpec & " /c " & '"' & @ScriptDir & '/BHO/XLNonIESvr.exe" -r theworld -silent -setfirst', "", @SW_HIDE) ;添加Opera浏览器支持 RunWait(@ComSpec & " /c " & '"' & @ScriptDir & '/BHO/XLNonIESvr.exe" -r opera -silent -setfirst', "", @SW_HIDE) ;添加遨游浏览器支持 RunWait(@ComSpec & " /c " & '"' & @ScriptDir & '/BHO/XLNonIESvr.exe" -r maxthon -silent -setfirst', "", @SW_HIDE) ;添加火狐狸浏览器支持 RunWait(@ComSpec & " /c " & '"' & @ScriptDir & '/BHO/XLNonIESvr.exe" -r firefox -silent -setfirst', "", @SW_HIDE) ;添加快车,旋风专用链 RunWait(@ComSpec & " /c " & 'Regsvr32 /s "' & @ScriptDir & '/BHO/LinkSimulate.dll"', "", @SW_HIDE) ;屏蔽迅雷偷偷上传 If @OSVersion <> "WIN_XP" And @OSVersion <> "WIN_2003" Then DirCreate(@HomeDrive & "/Users/Public/Thunder Network") FileInstall("cid_store.dat", @HomeDrive & "/Users/Public/Thunder Network/") EndIf DirCreate($AppData & "/Thunder Network/DownloadLib") FileInstall("pub_store.dat", $AppData & "/Thunder Network/DownloadLib/") ;写入必要的注册表信息 If @OSArch = "X64" Then RegWrite("HKLM/SOFTWARE/Wow6432Node/Thunder Network/ThunderOem/thunder_backwnd", "addinsdir", "REG_SZ", @ScriptDir & "/addins") RegWrite("HKLM/SOFTWARE/Wow6432Node/Thunder Network/ThunderOem/thunder_backwnd", "dir", "REG_SZ", @ScriptDir) RegWrite("HKLM/SOFTWARE/Wow6432Node/Thunder Network/ThunderOem/thunder_backwnd", "instdir", "REG_SZ", @ScriptDir) RegWrite("HKLM/SOFTWARE/Wow6432Node/Thunder Network/ThunderOem/thunder_backwnd", "Path", "REG_SZ", @ScriptDir & "/Program/Thunder.exe") RegWrite("HKLM/SOFTWARE/Wow6432Node/Thunder Network/ThunderOem/thunder_backwnd", "Version", "REG_SZ", "7.1.3.2044") ElseIf @OSArch = "X86" Then RegWrite("HKLM/SOFTWARE/Thunder Network/ThunderOem/thunder_backwnd", "addinsdir", "REG_SZ", @ScriptDir & "/addins") RegWrite("HKLM/SOFTWARE/Thunder Network/ThunderOem/thunder_backwnd", "dir", "REG_SZ", @ScriptDir) RegWrite("HKLM/SOFTWARE/Thunder Network/ThunderOem/thunder_backwnd", "instdir", "REG_SZ", @ScriptDir) RegWrite("HKLM/SOFTWARE/Thunder Network/ThunderOem/thunder_backwnd", "Path", "REG_SZ", @ScriptDir & "/Program/Thunder.exe") RegWrite("HKLM/SOFTWARE/Thunder Network/ThunderOem/thunder_backwnd", "Version", "REG_SZ", "7.1.3.2044") EndIf RegWrite("HKEY_CURRENT_USER/Software/Microsoft/Internet Explorer/MenuExt/使用迅雷下载", "", "REG_SZ", @ScriptDir & "/BHO/geturl.htm") RegWrite("HKEY_CURRENT_USER/Software/Microsoft/Internet Explorer/MenuExt/使用迅雷下载", "Contexts", "REG_DWORD", "34") RegWrite("HKEY_CURRENT_USER/Software/Microsoft/Internet Explorer/MenuExt/使用迅雷下载", "Name", "REG_SZ", "xl_geturl") RegWrite("HKEY_CURRENT_USER/Software/Microsoft/Internet Explorer/MenuExt/使用迅雷下载全部链接", "", "REG_SZ", @ScriptDir & "/BHO/GetAllUrl.htm") RegWrite("HKEY_CURRENT_USER/Software/Microsoft/Internet Explorer/MenuExt/使用迅雷下载全部链接", "Contexts", "REG_DWORD", "243") RegWrite("HKEY_CURRENT_USER/Software/Microsoft/Internet Explorer/MenuExt/使用迅雷下载全部链接", "Name", "REG_SZ", "xl_getallurl") ;关联迅雷 ShellExecuteWait(@ScriptDir & "/Program/Thunder.exe", "-associate:td -associate:torrent -associate:downlist -associate:thunderskin -regprotocol:ed2k -regprotocol:thunder", @ScriptDir & "/Program") ;写入控制面板的“添加或删除程序”,这个不要也罢 ;RegWrite("HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Uninstall/thunder_is1", "DisplayIcon", "REG_SZ", @ScriptDir & "/Program/Thunder.exe") ;RegWrite("HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Uninstall/thunder_is1", "DisplayName", "REG_SZ", "迅雷7") ;RegWrite("HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Uninstall/thunder_is1", "DisplayVersion", "REG_SZ", "7.1.3.2044") ;RegWrite("HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Uninstall/thunder_is1", "UserInstdir", "REG_SZ", @ScriptDir) ;RegWrite("HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Uninstall/thunder_is1", "HelpLink", "REG_SZ", "http://www.xunlei.com") ;RegWrite("HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Uninstall/thunder_is1", "Publisher", "REG_SZ", "迅雷网络技术有限公司") ;RegWrite("HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Uninstall/thunder_is1", "UninstallString", "REG_SZ", @ScriptDir & "/uninstall.exe") ;RegWrite("HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Uninstall/thunder_is1", "URLInfoAbout", "REG_SZ", "http://www.xunlei.com") ; ;创建桌面快捷方式 FileCreateShortcut(@ScriptDir & "/Program/Thunder.exe", @DesktopCommonDir & "/迅雷7.lnk", @ScriptDir & "/Program") ;创建开始程序菜单 DirCreate(@ProgramsCommonDir & "/迅雷软件/迅雷7") FileCreateShortcut(@ScriptDir & "/Program/Thunder.exe", @ProgramsCommonDir & "/迅雷软件/迅雷7/启动迅雷7.lnk", @ScriptDir & "/Program") FileCreateShortcut(@ScriptDir & "/uninstall.exe", @ProgramsCommonDir & "/迅雷软件/迅雷7/卸载迅雷7.lnk", @ScriptDir)
//*卸载代码*//
$AppData = StringLeft(@AppDataCommonDir, StringInStr(@AppDataCommonDir, "/", 0, -1) - 1) ShellExecuteWait(@ScriptDir & "/BHO/XLNonIESvr.exe", "-u ie -silent", @ScriptDir & "/BHO") ShellExecuteWait(@ScriptDir & "/BHO/XLNonIESvr.exe", "-u 360 -silent", @ScriptDir & "/BHO") ShellExecuteWait(@ScriptDir & "/BHO/XLNonIESvr.exe", "-u opera -silent", @ScriptDir & "/BHO") ShellExecuteWait(@ScriptDir & "/BHO/XLNonIESvr.exe", "-u maxthon -silent", @ScriptDir & "/BHO") ShellExecuteWait(@ScriptDir & "/BHO/XLNonIESvr.exe", "-u chrome -silent", @ScriptDir & "/BHO") ShellExecuteWait(@ScriptDir & "/BHO/XLNonIESvr.exe", "-u theworld -silent", @ScriptDir & "/BHO") ShellExecuteWait(@ScriptDir & "/BHO/XLNonIESvr.exe", "-u firefox -silent", @ScriptDir & "/BHO") ShellExecuteWait(@ScriptDir & "/BHO/BHOInstall.exe", "-u chrome -silent", @ScriptDir & "/BHO") ShellExecuteWait(@ScriptDir & "/BHO/BHOInstall.exe", "-u theworld -silent", @ScriptDir & "/BHO") ShellExecuteWait(@ScriptDir & "/BHO/BHOInstall.exe", "-u firefox -silent", @ScriptDir & "/BHO") ShellExecuteWait(@ScriptDir & "/BHO/BHOInstall.exe", "-u ie -silent", @ScriptDir & "/BHO") ShellExecuteWait(@ScriptDir & "/BHO/BHOInstall.exe", "-u 360 -silent", @ScriptDir & "/BHO") ShellExecuteWait(@ScriptDir & "/BHO/BHOInstall.exe", "-u opera -silent", @ScriptDir & "/BHO") ShellExecuteWait(@ScriptDir & "/BHO/BHOInstall.exe", "-u maxthon -silent", @ScriptDir & "/BHO") ShellExecuteWait(@SystemDir & "/Regsvr32.exe", "/s /u " & @ScriptDir & "/BHO/ThunderAgent.dll") ShellExecuteWait(@SystemDir & "/Regsvr32.exe", "/s /u " & @ScriptDir & "/BHO/XunLeiBHO.dll") ShellExecuteWait(@SystemDir & "/Regsvr32.exe", "/s /u " & @ScriptDir & "/BHO/LinkSimulate.dll") ShellExecuteWait(@ScriptDir & "/Program/Thunder.exe", "-unassociate:td -unassociate:torrent -unassociate:downlist -unassociate:thunderskin -unregprotocol:ed2k -unregprotocol:thunder", @ScriptDir & "/Program") Sleep(1000) RegDelete("HKCR/SOFTWARE/thunder") RegDelete("HKLM/SOFTWARE/Thunder Network") RegDelete("HKLM/SOFTWARE/Wow6432Node/Thunder Network") RegDelete("HKEY_CURRENT_USER/Software/Microsoft/Internet Explorer/MenuExt/使用迅雷下载") RegDelete("HKEY_CURRENT_USER/Software/Microsoft/Internet Explorer/MenuExt/使用迅雷下载全部链接") RegDelete("HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Uninstall/thunder_is1") RegDelete("HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Explorer/Browser Helper Objects/{889D2FEB-5411-4565-8998-1DD2C5261283}") RegDelete("HKEY_CLASSES_ROOT/CLSID/{889D2FEB-5411-4565-8998-1DD2C5261283}") DirRemove(@HomeDrive & "/Users/Public/Thunder Network", 1) DirRemove(@HomeDrive & "/Users/Public/Documents/Thunder Network", 1) DirRemove(@TempDir & "/LiveUD", 1) DirRemove(@TempDir & "/Thunder Network", 1) DirRemove(@TempDir & "/Xunlei", 1) DirRemove(@AppDataCommonDir & "/Thunder Network", 1) DirRemove($AppData & "/Thunder Network", 1) DirRemove(@AppDataCommonDir & "/Xunlei", 1) DirRemove(@AppDataDir & "/Thunder Network", 1) DirRemove(@AppDataDir & "/Xunlei", 1) DirRemove(@CommonFilesDir & "/Xunlei", 1) DirRemove(@CommonFilesDir & "/Thunder Network", 1) DirRemove(@CommonFilesDir & "/迅雷7", 1) DirRemove(@AppDataDir & "/LocalLow/Thunder Network", 1) DirRemove(@AppDataDir & "/LocalLow/Xunlei", 1) FileDelete(@DesktopCommonDir & "/迅雷7.lnk") DirRemove(@ProgramsCommonDir & "/迅雷软件/迅雷7", 1) $dx = DirGetSize(@ProgramsCommonDir & "/迅雷软件") If $dx = 0 Then DirRemove(@ProgramsCommonDir & "/迅雷软件", 1) EndIf
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/143416.html