sdistruct.dwStructSize 	= sizeof(SDISTRUCT); sdistruct.fsIDIFile 	= idiSpec; sdistruct.dlDirVRefNum 	= vRefNum; sdistruct.dlDirID 		= dirID; sdistruct.hwndOwner    	= NULL;
if (!ExistArchives(srcVRefNum, srcDirID)) {  srcVRefNum = vRefNum; srcDirID = dirID;  GetIndString(pIDIfname, rStringList, sTempIDIName);
pascal void* Install(void* unused){		short			vRefNum;	long			dirID;	OSErr 			err;	FSSpec			idiSpec, coreFileSpec, tmpSpec;	SDISTRUCT		sdistruct;	Str255			pIDIfname;	StringPtr		coreFile;	THz				ourHZ;	Boolean 		isDir = false;	GrafPtr			oldPort;#if PRE_BETA_HACKERY == 1		/* download to user selected folder */	vRefNum = gControls->opt->vRefNum;	dirID = gControls->opt->dirID;#else /* PRE_BETA_HACKERY */#ifndef MIW_DEBUG	/* get "Temporary Items" folder path */	ERR_CHECK_RET(FindFolder(kOnSystemDisk, kTemporaryFolderType, kCreateFolder, &vRefNum, &dirID), (void*)0);#else	/* for DEBUG builds dump downloaded items in "<currProcessVolume>:Temp NSInstall:" */	vRefNum = gControls->opt->vRefNum;	err = FSMakeFSSpec( vRefNum, 0, TEMP_DIR, &tmpSpec );	if (err != noErr)	{		err = FSpDirCreate(&tmpSpec, smSystemScript, &dirID);		if (err != noErr)		{			ErrorHandler();			return (void*)0;		}	}	else	{		err = FSpGetDirectoryID( &tmpSpec, &dirID, &isDir );		if (!isDir || err!=noErr)		{			ErrorHandler();			return (void*)0;		}	}	#endif /* MIW_DEBUG */#endif /* PRE_BETA_HACKERY */		GetIndString(pIDIfname, rStringList, sTempIDIName);		/* generate idi */	if (!GenerateIDIFromOpt(pIDIfname, dirID, vRefNum, &idiSpec))	{		ErrorHandler();		return (void*) nil;	}				/* populate SDI struct */	sdistruct.dwStructSize 	= sizeof(SDISTRUCT);	sdistruct.fsIDIFile 	= idiSpec;	sdistruct.dlDirVRefNum 	= vRefNum;	sdistruct.dlDirID 		= dirID;	sdistruct.hwndOwner    	= NULL;		/* call SDI_NetInstall */	gSDDlg = true;	ourHZ = GetZone();	GetPort(&oldPort);#if MOZILLA == 0#if SDINST_IS_DLL == 1	gInstFunc(&sdistruct);#else	SDI_NetInstall(&sdistruct);#endif /* SDINST_IS_DLL */#endif /* MOZILLA */	SetPort(oldPort);		if (gWPtr)	{		GetPort(&oldPort);		SetPort(gWPtr);		BeginUpdate(gWPtr);		DrawControls(gWPtr);		ShowLogo(true);		UpdateTerminalWin();		EndUpdate(gWPtr);				SetPort(oldPort);	}	SetZone(ourHZ);	gSDDlg = false;		FSpDelete(&idiSpec);		/* check if coreFile was downloaded */	HLock(gControls->cfg->coreFile);	if (*gControls->cfg->coreFile != NULL)	{		coreFile = CToPascal(*gControls->cfg->coreFile);		if (!coreFile)			return (void*) memFullErr;	}	HUnlock(gControls->cfg->coreFile);			if (coreFile != NULL && *coreFile > 0) /* core file was specified */	{		err = FSMakeFSSpec(vRefNum, dirID, coreFile, &coreFileSpec);		if (err==noErr) /* core file was downloaded */		{			InitProgressBar();						/* extract contents of downloaded core file */			err = ExtractCoreFile(vRefNum, dirID);			if (err!=noErr) 			{				ErrorHandler();				if (coreFile)					DisposePtr((Ptr)coreFile);				return (void*) nil;			}			#if PRE_BETA_HACKERY == 0						/* run all .xpi's through XPInstall */			err = RunAllXPIs(vRefNum, dirID);			if (err!=noErr)				ErrorHandler();							CleanupExtractedFiles(vRefNum, dirID);#endif			err = FSpDelete(&coreFileSpec);#ifdef MIW_DEBUG			if (err!=noErr) SysBeep(10); #endif		}				if (coreFile)			DisposePtr((Ptr)coreFile);	}		/* launch the downloaded apps who had the LAUNCHAPP attr set */	LaunchApps(vRefNum, dirID);	 	/* wind down app */	gDone = true;		return (void*) 0;}