if (pArchiveName) DisposePtr((Ptr)pArchiveName);
LaunchApps(short vRefNum, long dirID){	int 				compsDone = 0, i;	int 				instChoice = gControls->opt->instChoice-1;	FSSpec 				fsCurrArchive, fsCurrApp;	OSErr 				err = noErr;	StringPtr 			pArchiveName;	LaunchParamBlockRec	launchPB;		// loop through 0 to kMaxComponents	for(i=0; i<kMaxComponents; i++)	{		// general test: if component in setup type		if ( (gControls->cfg->st[instChoice].comp[i] == kInSetupType) &&			 (compsDone < gControls->cfg->st[instChoice].numComps) )		{ 			// if custom and selected, or not custom setup type			// add file to buffer			if ( ((instChoice == gControls->cfg->numSetupTypes-1) && 				  (gControls->cfg->comp[i].selected == true)) ||				 (instChoice < gControls->cfg->numSetupTypes-1) )			{				// if the LAUNCHAPP attr was set				if (gControls->cfg->comp[i].launchapp)				{					// AppleSingle decode the app					HLock(gControls->cfg->comp[i].archive);					pArchiveName = CToPascal(*gControls->cfg->comp[i].archive);					HUnlock(gControls->cfg->comp[i].archive);										err = FSMakeFSSpec(vRefNum, dirID, pArchiveName, &fsCurrArchive);					if (err == noErr) /* archive exists */					{						err = AppleSingleDecode(&fsCurrArchive, &fsCurrApp);						if (err == noErr) /* AppleSingle decoded successfully */						{								// launch the decoded app							launchPB.launchAppSpec = & fsCurrApp;							launchPB.launchAppParameters = NULL;							launchPB.launchBlockID = extendedBlock;							launchPB.launchEPBLength = extendedBlockLen;							launchPB.launchFileFlags = NULL;							launchPB.launchControlFlags = launchContinue + launchNoFileFlags + launchUseMinimum;							launchPB.launchControlFlags += launchDontSwitch;							err = LaunchApplication( &launchPB );#ifdef MIW_DEBUG							if (err!=noErr) SysBeep(10);#endif													}					}				}				}		}				compsDone++;	}}