local myclass = XLGetObject("Xunlei.Thunder.Shell")
local strPath, bGetResult = myclass:GetComponentsPath()
local str = "\\.."
strPath = strPath..str;
local strComponentPath = "\\Components\\FtpExplorer\\FtpExplorer.exe"
local strFullPath = strPath..strComponentPath;
if myclass:QueryFileExists(strFullPath) then 
 myclass:Execute("",strFullPath,"")
else
 local ModuleDownloadMgr = XLGetObject("Xunlei.Thunder.ModuleDownloadMgr")
 ModuleDownloadMgr:AddModule("FtpExplorer",strPath,100,"",0)
 local function OnDownloadFinish(strName,nStatus)
  if strName ~= "FtpExplorer" then
	return true
  end

  myclass:Execute("",strFullPath,"")
  return false
 end
 ModuleDownloadMgr:AttachEventFinish(OnDownloadFinish,true)
 ModuleDownloadMgr:BeginDownload("FtpExplorer")
 ModuleDownloadWndMgr = XLGetObject("Xunlei.Thunder.LuaModuleDownloadWndMgr")
 ModuleDownloadWndMgr:CreateDownloadDlg("FtpExplorer","FTP探测器",0,"","")
 ModuleDownloadWndMgr:ShowDownloadDlg("FtpExplorer",1,0)
end
