
// Returns a count of detected applications
function GetProductList(){
	var productCount=0;
	var productListString="";
	var CurrentProductList=['NAV','Norton AntiVirus','Norton CleanSweep','Norton Ghost','Norton Internet Security','Norton SystemWorks','Norton Utilities','pcAnywhere',"WinFax","Norton Personal Firewall","Norton Desktop Firewall","AntiSpam"];
	// get  list of values in InstalledApps key assign to productListString.
	var productListString= ProductDataCollector.EnumRegSubkeyValues("HKEY_LOCAL_MACHINE","SOFTWARE\\Symantec\\InstalledApps");
	// if NIS is found check if NPF or NDF
	if (productListString.indexOf("Norton Internet Security") != -1) {
		var NISValue=ProductDataCollector.GetRegValueData("HKEY_LOCAL_MACHINE","Software\\Symantec\\InstalledApps","Norton Internet Security");
		if (NISValue.indexOf("Personal Firewall") != -1) {
			var pattern = /Internet Security/gi;
			var newString = productListString.replace(pattern,"Personal Firewall");
			productListString=newString
		}
		if (NISValue.indexOf("Desktop_Firewall") != -1) {
			var pattern = /Norton Internet Security/gi;
			var newString = productListString.replace(pattern,"Symantec Desktop Firewall");
			productListString=newString;
		}
	}
	if (productListString.indexOf("NAV") != -1) {
		var pattern = /NAV/g;
		var newString = productListString.replace(pattern,"Norton AntiVirus");
		productListString=newString;
	}
	if (productListString.indexOf("WINFAX") != -1) {
		var pattern = /WINFAX/g;
		var newString = productListString.replace(pattern,"WinFax");
		productListString=newString;
	}
	// Split productListString into ProductList() array
	var ProductList=SplitData(productListString);
	for (var i=0; i < ProductList.length; i++){
		ProductList[i]=ProductList[i].substr(0,ProductList[i].indexOf("\t"));
	}
	/* loop through ProductList(). Match against elements in CurrentProductList(). */
	for (var i=0; i < CurrentProductList.length; i++) {
		for (var loop=0; loop < ProductList.length; loop++) {
			if (CurrentProductList[i] == ProductList[loop]) {
				// If it is NAV  check for coorporate edition
				var corpnav=false;
				if (ProductList[loop] == "Norton AntiVirus") {
					var NavDir=escapePath(GetRegValueData("HKEY_LOCAL_MACHINE","SOFTWARE\\Symantec\\InstalledApps","NAV"));
					var LongBuild=GetFileInfo(NavDir+"\\ABOUTPLG.DLL","version");
					if (LongBuild == "UNKNOWN" || LongBuild == null || LongBuild == "" || LongBuild.indexOf("ERR") != -1) {
						var iscorporateproduct="no";
						// check for NAV CE 7.x
						var navcorp7x=GetRegValueData("HKEY_LOCAL_MACHINE","Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{BD12EB47-DBDF-11D3-BEEA-00A0CC272509}","DisplayName");
						if (navcorp7x.indexOf("Corporate Edition") != -1) {
							ProductList[loop]="Norton AntiVirus Corporate Edition";
							iscorporateproduct="yes";
						}
						// check for SAV 8.x
						var navcorp8x=GetRegValueData("HKEY_LOCAL_MACHINE","Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{0EFC6259-3AD8-4CD2-BC57-D4937AF5CC0E}","DisplayName");
						if (navcorp8x.indexOf("Client") != -1) {
							ProductList[loop]="Symantec AntiVirus Client";
							iscorporateproduct="yes";
						}
						if (iscorporateproduct == "yes") corpnav=true;
					}
				}
				if (ProductList[loop] == "AntiSpam") {ProductList[loop] = "Norton AntiSpam";}
				if (!corpnav) {
					productCount++;
				}
			}
		}
	}
	// Check For GoBack
	var isGoBack="";
	isGoBack=ProductDataCollector.GetRegValueData("HKEY_LOCAL_MACHINE","Software\\Roxio\\GoBack\\Install","Path");
	if (isGoBack!="" && isGoBack.indexOf("ERR") == -1)	productCount++;
	return(productCount);
}


