csTmp += "\\netscape.hst"; pDlg->StartFileUpdate("General Files","netscape.hst"); WFE_CopyFile(csMain + "\\netscape.hst" ,csTmp);
csTmp += "\\mozilla.hst"; pDlg->StartFileUpdate("General Files","mozilla.hst"); WFE_CopyFile(csMain + "\\mozilla.hst" ,csTmp);
int     login_UpdateFilesToNewLocation(const char * path,CWnd *pParent,BOOL bCopyDontMove){	CString csTmp;		if (!path) return FALSE;	CUpdateFileDlg * pDlg = new CUpdateFileDlg(pParent,bCopyDontMove);	CString csMain = theApp.GetProfileString("Main","Install Directory","");	CString csBookmarks = theApp.GetProfileString("Bookmark List","File Location","");	if (!csBookmarks.IsEmpty()) {		csTmp = path;		csTmp += "\\bookmark.htm";		pDlg->StartFileUpdate("General Files","bookmark.htm");		if (bCopyDontMove) {			WFE_CopyFile(csBookmarks,csTmp);		} else {			if (WFE_MoveFile(csBookmarks,csTmp))				theApp.WriteProfileString("Bookmark List","File Location",csTmp);		}	}	CString csABook = theApp.GetProfileString("Address Book","File Location","");	if (!csABook.IsEmpty()) {		csTmp = path;		csTmp += "\\address.htm";		pDlg->StartFileUpdate("General Files","address.htm");		if (bCopyDontMove) {			WFE_CopyFile(csABook,csTmp);		} else {			if (WFE_MoveFile(csABook,csTmp))				theApp.WriteProfileString("Address Book","File Location",csTmp);		}	} else {		if (!csMain.IsEmpty()) {			csTmp = path;			csTmp += "\\address.htm";			pDlg->StartFileUpdate("General Files","address.htm");			WFE_CopyFile(csMain + "\\address.htm" ,csTmp);		}	}	CString csHist = theApp.GetProfileString("History","History File","");	if (!csHist.IsEmpty()) {		csTmp = path;		csTmp += "\\netscape.hst";		pDlg->StartFileUpdate("General Files","netscape.hst");		if (bCopyDontMove) {			WFE_CopyFile(csHist,csTmp);		} else {			if (WFE_MoveFile(csHist,csTmp))				theApp.WriteProfileString("History","History File",csTmp);		}	} else {		if (!csMain.IsEmpty()) {			csTmp = path;			csTmp += "\\netscape.hst";			pDlg->StartFileUpdate("General Files","netscape.hst");			WFE_CopyFile(csMain + "\\netscape.hst" ,csTmp);		}	}	CString csNewsRC = theApp.GetProfileString("Main","News RC","");	if (!csNewsRC.IsEmpty()) {		csTmp = path;		csTmp += "\\Newsrc";		pDlg->StartFileUpdate("General Files","Newsrc");		if (bCopyDontMove) {			WFE_CopyFile(csNewsRC,csTmp);		} else {			if (WFE_MoveFile(csNewsRC,csTmp))				theApp.WriteProfileString("Main","News RC",csTmp);		}	} 	if (!csMain.IsEmpty()) {		// these files are always copied since we don't store pointers		csTmp = path;		csTmp += "\\socks.cnf";		pDlg->StartFileUpdate("General Files","socks.cnf");		WFE_CopyFile(csMain + "\\socks.cnf" ,csTmp);		csTmp = path;		csTmp += "\\cookies.txt";		pDlg->StartFileUpdate("General Files","cookies.txt");		WFE_CopyFile(csMain + "\\cookies.txt",csTmp);		csTmp = path;		csTmp += "\\key.db";		pDlg->StartFileUpdate("Security Files","key.db");		WFE_CopyFile(csMain + "\\key.db",csTmp);		csTmp = path;		csTmp += "\\cert5.db";		pDlg->StartFileUpdate("Security Files","cert5.db");		WFE_CopyFile(csMain + "\\cert5.db",csTmp);		csTmp = path;		csTmp += "\\certni.db";		pDlg->StartFileUpdate("Security Files","certni.db");		WFE_CopyFile(csMain + "\\certni.db",csTmp);		csTmp = path;		csTmp += "\\proxy.cfg";		pDlg->StartFileUpdate("Network Files","proxy.cfg");		WFE_CopyFile(csMain + "\\proxy.cfg",csTmp);		csTmp = path;		csTmp += "\\abook.nab";		if (bCopyDontMove)			WFE_CopyFile(csMain + "\\abook.nab",csTmp);		else			WFE_MoveFile(csMain + "\\abook.nab",csTmp);	}	csTmp = path;	csTmp += "\\Mail";	CString csMail = theApp.GetProfileString("Mail","Mail Directory","");	if (!strnicmp(csMail,csTmp,strlen(csMail))) {		char szMsg[256];		_snprintf(szMsg, 256, szLoadString(IDS_UNABLETRANSFER_SUBDIR),"Mail Directory");		AfxMessageBox(szMsg);	}	else {		if (bCopyDontMove) {			if (!csMail.IsEmpty()) {				WFEU_UpdaterCopyDirectory(csMail,csTmp,pDlg,"Mail Directory");			}		} else {			if ((!csMail.IsEmpty()) && WFEU_UpdaterMoveDirectory(csMail,csTmp,pDlg,"Mail Directory")) {				theApp.WriteProfileString("Mail","Mail Directory",csTmp);				CString csFCC = theApp.GetProfileString("Mail","Default Fcc","");				int iSlash = csFCC.ReverseFind('\\');				if (iSlash != -1) {					CString csFolder = csFCC.Right(csFCC.GetLength()-iSlash);					theApp.WriteProfileString("Mail","Default Fcc",csTmp+csFolder);				}			}		}	}	csTmp = path;	csTmp += "\\News";	CString csNews = theApp.GetProfileString("News","News Directory","");	if (!strnicmp(csNews,csTmp,strlen(csNews))) {		char szMsg[256];		_snprintf(szMsg, 256, szLoadString(IDS_UNABLETRANSFER_SUBDIR),"News Directory");		AfxMessageBox(szMsg);	}	else {		if (bCopyDontMove) {			if (!csNews.IsEmpty()) {				WFEU_UpdaterCopyDirectory(csNews,csTmp,pDlg,"News Directory");			}		} else {			if ((!csNews.IsEmpty()) && WFEU_UpdaterMoveDirectory(csNews,csTmp,pDlg,"News Directory"))				theApp.WriteProfileString("News","News Directory",csTmp);               		}		// update news rc file either way to new directory -- creates fat,new		int iRet = WFEU_UpdateNewsFatFile(csTmp,csTmp);		// now move fat.new over the old fat file		if (iRet) {			CString csOldFat = csTmp + "\\fat";			CString csNewFat = csTmp + "\\fat.new";			rename(csOldFat,csTmp + "\\fat.old");			rename(csNewFat,csTmp + "\\fat");		}	}	csTmp = path;	csTmp += "\\cache";	CString csCache = theApp.GetProfileString("Cache","Cache Dir","");	if (!strnicmp(csCache,csTmp,strlen(csCache))) {		char szMsg[256];		_snprintf(szMsg, 256, szLoadString(IDS_UNABLETRANSFER_SUBDIR),"Cache Directory");		AfxMessageBox(szMsg);	}	else {		if (bCopyDontMove) {			if (!csCache.IsEmpty()) {				WFEU_UpdaterCopyDirectory(csCache,csTmp,pDlg,"Cache Directory");			}		} else {			if ((!csCache.IsEmpty()) && WFEU_UpdaterMoveDirectory(csCache,csTmp,pDlg,"Cache Directory"))				theApp.WriteProfileString("Cache","Cache Dir",csTmp);   		}	}	return TRUE;}