-------------------------------
--擦除文字处理软件运行痕迹
--
-------------------------------

tInitDef = {}

tInitDef[1] = {}
tInitDef[1]["gbT"]="擦除文字处理软件运行痕迹"
tInitDef[1]["big5T"]="揽埃ゅ矪瞶硁ン笲︽勃格"
tInitDef[1]["enT"]="Word processor"
tInitDef[1]["Key"]=120000
tInitDef[1]["iNoMenu"]=0
tInitDef[1]["fInstalled"]="LuaInstalled0"
tInitDef[1]["fEraseOpt"]="LuaCleaner0"
tInitDef[1]["tEraseTable"]="tEraseTable0"
tInitDef[1]["iRoot"]=2
tInitDef[1]["iSecond"]=0
tInitDef[1]["iThird"]=0

tInitDef[2] = {}
tInitDef[2]["gbT"]="擦除Windows附件“写字板”使用痕迹"
tInitDef[2]["big5T"]="揽埃Windowsン¨糶狾〃ㄏノ勃格"
tInitDef[2]["enT"]="Notpad"
tInitDef[2]["Key"]=120100
tInitDef[2]["iNoMenu"]=1
tInitDef[2]["fInstalled"]="LuaInstalled"
tInitDef[2]["fEraseOpt"]="LuaCleaner"
tInitDef[2]["tEraseTable"]="tEraseTable"
tInitDef[2]["iRoot"]=2
tInitDef[2]["iSecond"]=1
tInitDef[2]["iThird"]=0

tInitDef[3] = {}
tInitDef[3]["gbT"]="擦除Foxit PDF Reader(阅读pdf文件)使用痕迹"
tInitDef[3]["big5T"]="揽埃Foxit PDF Reader(綷弄pdfゅン)ㄏノ勃格"
tInitDef[3]["enT"]="Foxit PDF Reader"
tInitDef[3]["Key"]=120800
tInitDef[3]["iNoMenu"]=1
tInitDef[3]["fInstalled"]="LuaInstalled3"
tInitDef[3]["fEraseOpt"]="LuaCleaner3"
tInitDef[3]["tEraseTable"]="tEraseTable"
tInitDef[3]["iRoot"]=2
tInitDef[3]["iSecond"]=7
tInitDef[3]["iThird"]=0

tInitDef[4] = {}
tInitDef[4]["gbT"]="擦除Acrobat Reader 4.x - 8.x (阅读pdf文件)使用痕迹"
tInitDef[4]["big5T"]="揽埃Acrobat Reader 4.x - 8.x (綷弄pdfゅン)ㄏノ勃格"
tInitDef[4]["enT"]="Acrobat Reader 4.x - 8.x"
tInitDef[4]["Key"]=120900
tInitDef[4]["iNoMenu"]=1
tInitDef[4]["fInstalled"]="LuaInstalled4"
tInitDef[4]["fEraseOpt"]="LuaCleaner4"
tInitDef[4]["tEraseTable"]="tEraseTable"
tInitDef[4]["iRoot"]=2
tInitDef[4]["iSecond"]=6
tInitDef[4]["iThird"]=0

tInitDef[5] = {}
tInitDef[5]["gbT"]="擦除UltraEdit使用痕迹"
tInitDef[5]["big5T"]="揽埃UltraEditㄏノ勃格"
tInitDef[5]["enT"]="UltraEdit"
tInitDef[5]["Key"]=121000
tInitDef[5]["iNoMenu"]=1
tInitDef[5]["fInstalled"]="LuaInstalled5"
tInitDef[5]["fEraseOpt"]="LuaCleaner5"
tInitDef[5]["tEraseTable"]="tEraseTable"
tInitDef[5]["iRoot"]=2
tInitDef[5]["iSecond"]=8
tInitDef[5]["iThird"]=0

tInitDef[6] = {}
tInitDef[6]["gbT"]="擦除Edit Plus 2.x - 3.x使用痕迹"
tInitDef[6]["big5T"]="揽埃Edit Plus 2.x - 3.xㄏノ勃格"
tInitDef[6]["enT"]="Edit Plus 2.x - 3.x"
tInitDef[6]["Key"]=121100
tInitDef[6]["iNoMenu"]=1
tInitDef[6]["fInstalled"]="LuaInstalled6"
tInitDef[6]["fEraseOpt"]="LuaCleaner6"
tInitDef[6]["tEraseTable"]="tEraseTable"
tInitDef[6]["iRoot"]=2
tInitDef[6]["iSecond"]=9
tInitDef[6]["iThird"]=0

tInitDef[7] = {}
tInitDef[7]["gbT"]="擦除 Beyond Compare 2.x 痕迹"
tInitDef[7]["big5T"]="揽埃 Beyond Compare 2.x 勃格"
tInitDef[7]["enT"]="Beyond Compare 2.x"
tInitDef[7]["Key"]=121200
tInitDef[7]["iNoMenu"]=1
tInitDef[7]["fInstalled"]="LuaInstalled7"
tInitDef[7]["fEraseOpt"]="LuaCleaner7"
tInitDef[7]["tEraseTable"]="tEraseTable"
tInitDef[7]["iRoot"]=2
tInitDef[7]["iSecond"]=10
tInitDef[7]["iThird"]=0

tInitDef[8] = {}
tInitDef[8]["gbT"]="擦除HTML Help Workshop痕迹"
tInitDef[8]["big5T"]="揽埃HTML Help Workshop勃格"
tInitDef[8]["enT"]="HTML Help Workshop"
tInitDef[8]["Key"]=121300
tInitDef[8]["iNoMenu"]=1
tInitDef[8]["fInstalled"]="LuaInstalled8"
tInitDef[8]["fEraseOpt"]="LuaCleaner8"
tInitDef[8]["tEraseTable"]="tEraseTable"
tInitDef[8]["iRoot"]=2
tInitDef[8]["iSecond"]=11
tInitDef[8]["iThird"]=0

HKEY_CLASSES_ROOT = 0x80000000
HKEY_CURRENT_USER = 0x80000001
HKEY_LOCAL_MACHINE = 0x80000002
HKEY_USERS = 0x80000003

  require "wyzl"

function LuaInstalled0()
	local bInstalled = 1
	return bInstalled
end;

function LuaInstalled()
	local bInstalled = 1

	return bInstalled
end;

function LuaCleaner0()
	tEraseTable0 = {};
end;

function LuaCleaner()

	tEraseTable = {};
	os.RegDeleteAllValue(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Applets\\Wordpad\\Recent File List");

end;

function LuaInstalled3()

	local bInstalled = 0
	bRet = os.RegKeyExists(HKEY_CURRENT_USER,"Software\\Local AppWizard-Generated Applications\\Foxit PDF Reader")
	if( bRet == true) then
			bInstalled = 1
	end
	bRet = os.RegKeyExists(HKEY_CURRENT_USER,"Software\\Foxit Software\\Foxit Reader")
	if( bRet == true) then
			bInstalled = 1
	end
	return bInstalled
end;

function LuaCleaner3()

	tEraseTable = {};
	os.RegDeleteKey(HKEY_CURRENT_USER,"Software\\Local AppWizard-Generated Applications\\Foxit PDF Reader\\Recent File List");
	os.RegDeleteKey(HKEY_CURRENT_USER,"Software\\Foxit Software\\Foxit Reader\\Recent File List");
end;

function LuaInstalled4()

	local bInstalled = 0
	bRet = os.RegKeyExists(HKEY_CURRENT_USER,"Software\\Adobe\\Acrobat Reader\\8.0\\InstallPath")
	if( bRet == true) then
			bInstalled = 1
	end
	bRet = os.RegKeyExists(HKEY_CURRENT_USER,"Software\\Adobe\\Adobe Acrobat\\8.0\\InstallPath")
	if( bRet == true) then
			bInstalled = 1
	end
	bRet = os.RegKeyExists(HKEY_CURRENT_USER,"Software\\Adobe\\Acrobat Reader\\7.0\\InstallPath")
	if( bRet == true) then
			bInstalled = 1
	end
	bRet = os.RegKeyExists(HKEY_CURRENT_USER,"Software\\Adobe\\Adobe Acrobat\\7.0\\InstallPath")
	if( bRet == true) then
			bInstalled = 1
	end
	bRet = os.RegKeyExists(HKEY_CURRENT_USER,"Software\\Adobe\\Acrobat Reader\\6.0\\InstallPath")
	if( bRet == true) then
			bInstalled = 1
	end
	bRet = os.RegKeyExists(HKEY_CURRENT_USER,"Software\\Adobe\\Adobe Acrobat\\6.0\\InstallPath")
	if( bRet == true) then
			bInstalled = 1
	end
	bRet = os.RegKeyExists(HKEY_CURRENT_USER,"Software\\Adobe\\Acrobat Reader\\5.0\\InstallPath")
	if( bRet == true) then
			bInstalled = 1
	end
	bRet = os.RegKeyExists(HKEY_CURRENT_USER,"Software\\Adobe\\Adobe Acrobat\\5.0\\InstallPath")
	if( bRet == true) then
			bInstalled = 1
	end
	bRet = os.RegKeyExists(HKEY_CURRENT_USER,"Software\\Adobe\\Acrobat Reader\\4.0\\InstallPath")
	if( bRet == true) then
			bInstalled = 1
	end
	bRet = os.RegKeyExists(HKEY_CURRENT_USER,"Software\\Adobe\\Adobe Acrobat\\4.0\\InstallPath")
	if( bRet == true) then
			bInstalled = 1
	end
	return bInstalled
end;

function LuaCleaner4()

	strTitle ="擦除Acrobat Reader 4.x - 8.x (阅读pdf文件)使用痕迹"
	if(WYZL.GetLanguage() == 2) then
		strTitle="揽埃Acrobat Reader 4.x - 8.x (綷弄pdfゅン)ㄏノ勃格"
	elseif(WYZL.GetLanguage() == 3) then
		strTitle="Acrobat Reader 4.x - 8.x"
	end

  --require "vcl"
  --VCL.ShowMessage(strTitle);
	
	WYZL.PlugReset();

	sKey = "HKEY_CURRENT_USER\\Software\\Adobe";
	sKeyPara = "\\Acrobat Reader\\7.0\\AVGeneral\\cRecentFiles,all\\r\\n";
	sKeyPara = sKeyPara .. "\\Acrobat Reader\\9.0\\AVGeneral\\cRecentFiles,all\\r\\n";
	sKeyPara = sKeyPara .. "\\Adobe Acrobat\\7.0\\AVGeneral\\cRecentFiles,all\\r\\n";
	sKeyPara = sKeyPara .. "\\Adobe Acrobat\\9.0\\AVGeneral\\cRecentFiles,all\\r\\n";
	sKeyPara = sKeyPara .. "\\Acrobat Reader\\4.0\\AdobeViewer,avpRecentFile\\r\\n";
	WYZL.AddRegItem("DelRegValueListEx",sKey,sKeyPara);
	
  sKey = "HKEY_CURRENT_USER\\Software\\Adobe\\Acrobat Reader";
	sKeyPara = "\\4.0\\AVGeneral\\cRecentFiles,\\5.0\\AVGeneral\\cRecentFiles,\\6.0\\AVGeneral\\cRecentFiles,\\7.0\\AVGeneral\\cRecentFiles,\\8.0\\AVGeneral\\cRecentFiles,";
	WYZL.AddRegItem("DelRegKeyList",sKey,sKeyPara);  
	
  sKey = "HKEY_CURRENT_USER\\Software\\Adobe\\Adobe Acrobat";
	sKeyPara = "\\4.0\\AVGeneral\\cRecentFiles,\\5.0\\AVGeneral\\cRecentFiles,\\6.0\\AVGeneral\\cRecentFiles,\\7.0\\AVGeneral\\cRecentFiles,\\8.0\\AVGeneral\\cRecentFiles,";
	WYZL.AddRegItem("DelRegKeyList",sKey,sKeyPara);  
	
  sKey = "HKEY_CURRENT_USER\\Software\\Adobe\\Acrobat";
	sKeyPara = "\\4.0\\Weblink\\4.0\\OpenURL,\\5.0\\Weblink\\5.0\\OpenURL,\\6.0\\Weblink\\6.0\\OpenURL,\\7.0\\Weblink\\7.0\\OpenURL,\\8.0\\Weblink\\8.0\\OpenURL,";
	WYZL.AddRegItem("DelRegKeyList",sKey,sKeyPara);  
	
	nReturn = 0;
	if(WYZL.IsLoaded() == 1) then
		nReturn = WYZL.DoPlugErase(strTitle,-1,0);
		
		--VCL.ShowMessage("結束");
	end
	
end;

function LuaInstalled5()

	local bInstalled = 0
	szPath = WYZL.GetWindowsDirectory();
	if(szPath ~= nil) then
		if(WYZL.GetDirFileExists(szPath .. "\\uedit32.INI") == true)  then
				bInstalled = 1
		end
	end
	szPath = os.RegQueryValueEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "AppData")
	if(szPath ~= nil) then
		if(WYZL.GetDirFileExists(szPath .. "\\IDMComp\\UltraEdit\\Uedit32.INI") == true)  then
				bInstalled = 1
		end
	end
	bRet = os.RegKeyExists(HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\UltraEdit_is1")
	if( bRet == true) then
			bInstalled = 1
	end
	return bInstalled
end;

function LuaCleaner5()

	strTitle ="擦除UltraEdit使用痕迹"
	if(WYZL.GetLanguage() == 2) then
		strTitle="揽埃UltraEditㄏノ勃格"
	elseif(WYZL.GetLanguage() == 3) then
		strTitle="UltraEdit"
	end

  --require "vcl"
  --VCL.ShowMessage(strTitle);
	
	WYZL.PlugReset();
	
	sKey = "HKEY_CURRENT_USER\\Software\\IDM Computer Solutions\\UltraCompare Pro";
	sKeyPara = "";
	strValue = "";
	
	WYZL.AddActionItem("DelRegValue",sKey .. "\\UltraCompare\\Settings","","InitPath*");
	WYZL.AddActionItem("DelRegValue",sKey .. "\\UltraCompare Professional\\Settings","","InitPath*");
	
	WYZL.AddActionItem("DelRegKeyList",sKey .. "\\UltraCompare","","m_slHistory*");
	WYZL.AddActionItem("DelRegKeyList",sKey .. "\\UltraCompare Professional","","m_slHistory*");
	
	WYZL.AddActionItem("DelFile","%AppData%\\IDMComp\\UltraEdit\\projects.lst","","");
	WYZL.AddActionItem("DelFile","%LocalAppData%\\IDMComp\\UltraEdit\\projects.lst","","");
	
	sKeyPara = "";
	sKey = "%AppData%\\IDMComp\\UltraEdit\\Uedit32.INI";
	nFind = WYZL.FileExists(WYZL.GetCheckPath(sKey),0);
	if(nFind == 1)then
	  sKeyPara = WYZL.GetCheckPath(sKey);
		--VCL.ShowMessage(sKeyPara);
		WYZL.AddActionItem("UpdateFile",sKey,"","\\Account Id\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","\\Account Name\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","\\FindString\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","\\ReplaceString\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","\\Server Address\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","\\User Name\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","Clipboard History\\\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","DOS Dir\\\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","DOS Execute\\\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","Find History\\\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","Find in File History\\\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","FTP Account List\\\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","FTP Settings\\\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","Open Files\\\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","Project\\\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","Recent File List\\\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","Recent Projects\\\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","Replace History\\\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","Settings\\Last File\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","Settings\\Last Project Dir\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","UE-Compare\\\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","Find Hex History\\\\");
	end
	
	if(sKeyPara ~= "") then
		strValue = WYZL.GetIniStr("Settings","Spell Directory","",sKeyPara);
	end

	sKey = "%PROGRAMFILES%\\ULTRAEDIT\\UEDIT32.INI";
	if(strValue ~= "") then
	  sKeyPara = WYZL.TrimRight(strValue,"\\");
		sKey = sKeyPara .. "\\ULTRAEDIT\\UEDIT32.INI";
		--VCL.ShowMessage(sKey);
	end
	
  --VCL.ShowMessage(WYZL.GetCheckPath(sKey));
  
	nFind = WYZL.FileExists(WYZL.GetCheckPath(sKey),0);
	if(nFind == 1)then
		WYZL.AddActionItem("UpdateFile",sKey,"","\\Account Id\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","\\Account Name\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","\\FindString\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","\\ReplaceString\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","\\Server Address\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","\\User Name\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","Clipboard History\\\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","DOS Dir\\\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","DOS Execute\\\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","Find History\\\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","Find in File History\\\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","FTP Account List\\\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","FTP Settings\\\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","Open Files\\\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","Project\\\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","Recent File List\\\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","Recent Projects\\\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","Replace History\\\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","Settings\\Last File\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","Settings\\Last Project Dir\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","UE-Compare\\\\");
		WYZL.AddActionItem("UpdateFile",sKey,"","Find Hex History\\\\");
	end
	
	nReturn = 0;
	if(WYZL.IsLoaded() == 1) then
		nReturn = WYZL.DoPlugErase(strTitle,-1,0);
		
		--VCL.ShowMessage("結束");
	end
	
end;

function LuaInstalled6()

	local bInstalled = 0
	bRet = os.RegKeyExists(HKEY_CURRENT_USER,"Software\\ES-Computing\\EditPlus 2")
	if( bRet == true) then
			bInstalled = 1
	end
	bRet = os.RegKeyExists(HKEY_CURRENT_USER,"Software\\ES-Computing\\EditPlus 3")
	if( bRet == true) then
			bInstalled = 1
	end
	return bInstalled
end;

function LuaCleaner6()

	tEraseTable = {};
	os.RegDeleteAllValue(HKEY_CURRENT_USER,"Software\\ES-Computing\\EditPlus 2\\Recent Dir List");
	os.RegDeleteAllValue(HKEY_CURRENT_USER,"Software\\ES-Computing\\EditPlus 2\\Recent File List");
	os.RegDeleteAllValue(HKEY_CURRENT_USER,"Software\\ES-Computing\\EditPlus 3\\Recent Dir List");
	os.RegDeleteAllValue(HKEY_CURRENT_USER,"Software\\ES-Computing\\EditPlus 3\\Recent File List");

end;

function LuaInstalled7()

	local bInstalled = 0
	bRet = os.RegKeyExists(HKEY_CURRENT_USER,"Software\\Scooter Software\\Beyond Compare")
	if( bRet == true) then
			bInstalled = 1
	end
	return bInstalled
end;

function LuaCleaner7()

	tEraseTable = {};
	os.RegDeleteKey(HKEY_CURRENT_USER,"Software\\Scooter Software\\Beyond Compare\\Recent");

end;

function LuaInstalled8()

	local bInstalled = 0
	bRet = os.RegKeyExists(HKEY_CURRENT_USER,"Software\\Microsoft\\HTML Help Workshop")
	if( bRet == true) then
			bInstalled = 1
	end
	return bInstalled
end;

function LuaCleaner8()

	strTitle ="擦除HTML Help使用痕迹"
	if(WYZL.GetLanguage() == 2) then
		strTitle="揽埃HTML Helpㄏノ勃格"
	elseif(WYZL.GetLanguage() == 3) then
		strTitle="HTML Help"
	end

  --require "vcl"
  --VCL.ShowMessage(strTitle);
	
	WYZL.PlugReset();
	
	sKey = "HKEY_CURRENT_USER\\Software\\Microsoft\\HTML Help Workshop";
	sKeyPara = "";
	strValue = "";
	
	sKeyPara = sKeyPara .. "\\Project Files,all\\r\\n";
	sKeyPara = sKeyPara .. "\\Recent File List,all\\r\\n";
	sKeyPara = sKeyPara .. "\\Compressed HTML,all\\r\\n";
	sKeyPara = sKeyPara .. "\\Html Titles,all\\r\\n";
	WYZL.AddRegItem("DelRegValueListEx",sKey,sKeyPara);

	WYZL.AddActionItem("DelFile","%ALLUSERSPROFILE%\\Application Data\\Microsoft\\HTML Help\\hh.dat","","");
	WYZL.AddActionItem("DelFile","%AppData%\\Microsoft\\HTML Help\\hh.dat","","");
	
	nReturn = 0;
	if(WYZL.IsLoaded() == 1) then
		nReturn = WYZL.DoPlugErase(strTitle,-1,0);
		
		--VCL.ShowMessage("結束");
	end

end;
