err = FSMakeFSSpec(vRefNum, dirID, "\pmozilla.jar", &xpiSpec);  if (err==noErr) err =  RunXPI(xpiSpec, xpiStubDirSpec, tgtDirSpec); else ErrorHandler();
ERR_CHECK_RET(LoadXPIStub(&xpi_initProc, &xpi_installProc, &xpi_exitProc, &connID, xpiStubDirSpec), err); XPI_ERR_CHECK(xpi_initProc( xpiStubDirSpec, tgtDirSpec, xpicbStart, xpicbProgress, xpicbFinal ));    for(i=0; i<kMaxComponents; i++) {  if ( (gControls->cfg->st[instChoice].comp[i] == kInSetupType) && (compsDone < gControls->cfg->st[instChoice].numComps) ) {   if ( ((instChoice == gControls->cfg->numSetupTypes-1) && (gControls->cfg->comp[i].selected == true)) || (instChoice < gControls->cfg->numSetupTypes-1) ) { 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);
RunAllXPIs(short vRefNum, long dirID){	OSErr 	err = noErr;	FSSpec	tgtDirSpec, xpiStubDirSpec, xpiSpec;	err = FSMakeFSSpec(vRefNum, dirID, 0, &xpiStubDirSpec); /* temp dir */	err = FSMakeFSSpec(gControls->opt->vRefNum, gControls->opt->dirID, 0, &tgtDirSpec);	/* program dir */		// TO DO	//		enumerate through all .xpi's	err = FSMakeFSSpec(vRefNum, dirID, "\pmozilla.jar", &xpiSpec); // XXX change	if (err==noErr)		err =  RunXPI(xpiSpec, xpiStubDirSpec, tgtDirSpec);	else		ErrorHandler(); 			return err;}