local shell = XLGetObject("Xunlei.Thunder.Shell")
strCurrentPath = shell:GetComponentsPath()
strCurrentPath = strCurrentPath.."\\ResWorker"
shell:DeleteRegValue("HKEY_LOCAL_MACHINE","SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Browser Helper Objects\\{0D42E1BD-09DD-4873-A826-9C7E793EB7B6}")
strDSIeHelper = strCurrentPath.."\\DSIeHelper.dll"
shell:DeletePathFile(strDSIeHelper)
strDataProcessor = strCurrentPath.."\\DataProcessor.dll"
shell:DeletePathFile(strDataProcessor)
local function SetCurrentDll( strBaseDir, strDllBaseName, strSetupName)
	for i=0,9,1 do
	  strFileName = strBaseDir.."\\"
	  strFileName = strFileName..strDllBaseName
	  strFileName = strFileName.."_0"
	  strFileName = strFileName..i
	  strFileName = strFileName..".dll"
	  shell:DeletePathFile(strFileName)
	end
	
	strDstName = nil
	strNewName = nil
	for i=0,9,1 do
	 strFileName = strBaseDir.."\\"
	  strFileName = strFileName..strDllBaseName
	  strFileName = strFileName.."_0"
	  strFileName = strFileName..i
	  strFileName = strFileName..".dll"
	 if shell:QueryFileExists(strFileName) == false then
		strDstName = strDllBaseName.."_0"
		strDstName = strDstName..i
		strNewName = strFileName
		break;
	 end
	end

	strNameTemp = strBaseDir.."\\"
	strNameTemp = strNameTemp..strSetupName
	shell:RenameFile(strNameTemp, strNewName)
	
	strIniFile = strBaseDir.."\\dllswitch.ini"
	shell:WriteINI(strDllBaseName, "current", strDstName, strIniFile)
	
	return true
end
SetCurrentDll(strCurrentPath, "DataProcessor","DataProcessor_setup.dll")
strDsBho = strCurrentPath.."\\DsBho.dll"
shell:DeletePathFile(strDsBho)
SetCurrentDll(strCurrentPath, "DsBho","DsBho_setup.dll")