From 3f50007b68d1be20339bd45f0236b9aa28b21b34 Mon Sep 17 00:00:00 2001 From: "mitchf%netscape.com" Date: Thu, 27 Jun 2002 19:46:02 +0000 Subject: [PATCH] Added RequiredTools value to check existence of needed .exe's on startup. Fixes bug 102537 --- cck/driver/WizardMachine.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/cck/driver/WizardMachine.cpp b/cck/driver/WizardMachine.cpp index 83637e1878a7..f9f9e4d188fa 100644 --- a/cck/driver/WizardMachine.cpp +++ b/cck/driver/WizardMachine.cpp @@ -154,6 +154,7 @@ BOOL CWizardMachineApp::InitInstance() #endif + //Do initializations //Check for comm existence //declare a tree for nodes @@ -170,6 +171,39 @@ BOOL CWizardMachineApp::InitInstance() if (wroot) wroot->cached = TRUE; + + + // see if our required support executables are there, as supplied in wizardmachine.ini + + CString strFailed; + char szToolList[MAX_SIZE]; + char szBuffer[MAX_SIZE]; + + + GetPrivateProfileString("Default", "RequiredTools", "", szToolList, MAX_SIZE, Root + "WizardMachine.ini"); + + char *pTok = strtok(szToolList,","); + + while (pTok) + { + if ((int)FindExecutable(pTok,currDirPath,szBuffer) <= 32) + { + strFailed += " "; + strFailed += pTok; + strFailed += ","; + } + + pTok = strtok(NULL,","); + } + + if (!strFailed.IsEmpty()) + { + CString str; + strFailed = strFailed.Left(strFailed.GetLength()-1); // remove trailing comma + str.Format("The following support files could not be found in the system path: %s. Please fix this problem and restart.",strFailed); + AfxMessageBox(str,MB_ICONSTOP); + } + CString outputFile = Path + "output.dat"; out = fopen(outputFile, "w"); if (!out)