Example #1
0
void USetupDefinition::DoInstallSteps( FInstallPoll* Poll )
{
	guard(USetupDefinition::DoInstallSteps);

	// Handle all install steps.
	BeginSteps();
	TotalBytes = 0;
	InstallTree( TEXT("ProcessPreCopy"),  Poll, (INSTALL_STEP)ProcessPreCopy  );
	InstallTree( TEXT("ProcessCopy"),     Poll, (INSTALL_STEP)ProcessCopy     );
	InstallTree( TEXT("ProcessExtra"),    Poll, (INSTALL_STEP)ProcessExtra    );
	InstallTree( TEXT("ProcessPostCopy"), Poll, (INSTALL_STEP)ProcessPostCopy );
	Exists = FolderExists = 1;
	RegistryFolder = DestPath;
	if( IsMasterProduct )
		GConfig->SetString( TEXT("Setup"), TEXT("MasterProduct"), *Product, *(DestPath * TEXT("System") * SETUP_INI) );
	TMultiMap<FString,FString>* Map = GConfig->GetSectionPrivate( TEXT("Setup"), 1, 0, *(DestPath * TEXT("System") * SETUP_INI) );
		Map->AddUnique( TEXT("Group"), *Product );
	for( TArray<FSavedIni>::TIterator It(SavedIni); It; ++It )
		GConfig->SetString( *It->Section, *It->Key, *It->SavedValue, *It->File );
	UninstallLogAdd( TEXT("Caption"), *LocalProduct, 1, 0 );
	RootGroup->UninstallLog.Remove( TEXT("Version") );
	UninstallLogAdd( TEXT("Version"), *Version, 1, 0 );
	for( INT i=0; i<Requires.Num(); i++ )
	{
		USetupProduct* SetupProduct = new(GetOuter(),*Requires(i))USetupProduct;
		if( SetupProduct->Product!=Product )
			UninstallLogAdd( TEXT("Requires"), *SetupProduct->Product, 0, 0 );
	}
	EndSteps();

	unguard;
}
Example #2
0
bool HierarchyInstaller::InstallTree(HierarchConfNamed *root, const char *rootName, const ROAnything tree, Registry *r) {
	StartTrace(HierarchyInstaller.InstallTree);
	bool installSuccess = InstallRoot(root, rootName);
	Trace("root [" << rootName << "] success: " << (installSuccess ? "true" : "false"));
	long subTreeSz = tree.GetSize();
	for (int i = 0; i < subTreeSz; ++i) {
		bool subtree = true;
		const char *leafName = tree.SlotName(i);
		if (!leafName) {
			leafName = tree[i].AsCharPtr(0);
			subtree = false; // no more hierarchy
		}
		if (leafName) { // there is something to install
			HierarchConfNamed *leaf = GetLeaf(leafName, root, r);
			if (leaf) {
				leaf->SetSuper(root);
				if (subtree) {
					installSuccess = InstallTree(leaf, leafName, tree[i], r) && installSuccess;
				}
			} else {
				Trace("failed leaf:" << leafName);
				installSuccess = false;
			}
		}
	}
	return installSuccess;
}
Example #3
0
void USetupDefinition::InstallTree( const TCHAR* Action, FInstallPoll* Poll, void (USetupDefinition::*Process)( FString Key, FString Value, UBOOL Selected, FInstallPoll* Poll ), USetupGroup* SetupGroup, UBOOL Selected )
{
	guard(USetupDefinition::InstallTree);
	if( !SetupGroup )
		SetupGroup = RootGroup;

	// Update selection status.
	Selected = Selected && SetupGroup->Selected;

	// Process this item.
	(this->*Process)( TEXT("GroupSpecial"), SetupGroup->GetName(), Selected, Poll );
	TMultiMap<FString,FString>* Map = GConfig->GetSectionPrivate( SetupGroup->GetName(), 0, 1, *ConfigFile );
	check(Map);
	for( TMultiMap<FString,FString>::TIterator It(*Map); It; ++It )
	{
		FString V = Format(It.Value());
		(this->*Process)( It.Key(), V, Selected, Poll );
	}

	// Handle all subgroups here.
	for( TArray<USetupGroup*>::TIterator ItG(SetupGroup->Subgroups); ItG; ++ItG )
		InstallTree( Action, Poll, Process, *ItG, Selected );

	unguardf(( TEXT("(%s %s)"), Action, SetupGroup->GetFullName() ));
}
Example #4
0
bool HierarchyInstaller::DoInstall(const ROAnything installerSpec, Registry *r) {
	StartTrace(HierarchyInstaller.DoInstall);
	TraceAny(installerSpec, "");
	long isSz = installerSpec.GetSize();
	bool installSuccess = true;
	for (long l = 0; l < isSz; ++l) {
		const char *pcRegObjectName = installerSpec.SlotName(l);
		installSuccess = InstallTree(GetLeaf(pcRegObjectName, 0, r), pcRegObjectName, installerSpec[l], r);
	}
	return installSuccess;
}