err = FSMakeFSSpec(vRefNum, dirID, pcurrArchive, &xpiSpec);
err = FSMakeFSSpec(xpiVRefNum, xpiDirID, pcurrArchive, &xpiSpec);
RunAllXPIs(short vRefNum, long dirID){	OSErr 				err = noErr;	FSSpec				tgtDirSpec, xpiStubDirSpec, xpiSpec;	XPI_InitProc		xpi_initProc;	XPI_InstallProc		xpi_installProc;	XPI_ExitProc		xpi_exitProc;	CFragConnectionID	connID;	nsresult 			rv = NS_OK;	StringPtr			pcurrArchive;	int					i, compsDone = 0, instChoice = gControls->opt->instChoice-1;;	Boolean				isCurrXPI = false;		err = FSMakeFSSpec(vRefNum, dirID, 0, &xpiStubDirSpec); /* temp dir */	err = FSMakeFSSpec(gControls->opt->vRefNum, gControls->opt->dirID, 0, &tgtDirSpec);	/* program dir */		ERR_CHECK_RET(LoadXPIStub(&xpi_initProc, &xpi_installProc, &xpi_exitProc, &connID, xpiStubDirSpec), err);	XPI_ERR_CHECK(xpi_initProc( xpiStubDirSpec, tgtDirSpec, xpicbStart, xpicbProgress, xpicbFinal ));		// enumerate through all .xpi's	// 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 LAUNCHAPP attr wasn't set			 	if (!gControls->cfg->comp[i].launchapp)				HLock(gControls->cfg->comp[i].archive);				pcurrArchive = CToPascal(*gControls->cfg->comp[i].archive);				HUnlock(gControls->cfg->comp[i].archive);					isCurrXPI = IsArchiveXPI(pcurrArchive);											err = FSMakeFSSpec(vRefNum, dirID, pcurrArchive, &xpiSpec);				if (err==noErr && isCurrXPI)					RunXPI(xpiSpec, &xpi_installProc);				if (pcurrArchive)					DisposePtr((Ptr) pcurrArchive);				compsDone++;			}		}		else if (compsDone >= gControls->cfg->st[instChoice].numComps)			break;  	}		xpi_exitProc();		UnloadXPIStub(&connID);	return err;}