public void Execute(InstallEnvironment env) { environment = env; List <InstallSource> sources = env.SourceFileLists[sourceListName]; List <InstallDestination> dests = env.DestinationFileLists[destinationListName]; if (sources == null) { throw new AbortInstallationException( String.Format("Install Source List {0} not found", sourceListName)); } if (dests == null) { throw new AbortInstallationException( String.Format("Install Destination List {0} not found", destinationListName)); } /* if the lengths are the same copy name to name */ if (sources.Count == dests.Count) { List <InstallDestination> .Enumerator destinationEnumerator = dests.GetEnumerator(); foreach (InstallSource source in sources) { destinationEnumerator.MoveNext(); DoCopy(source, destinationEnumerator.Current); } } else { throw new AbortInstallationException("Cannot copy sources to unequal number of destinations"); } }
public void Execute(InstallEnvironment env) { foreach (Guid g in installedPackages) { if (!installService.IsPackageInstalled(g)) { throw new Exception( String.Format("Package {0} is not installed", g)); } } }
public void Execute(InstallEnvironment env) { foreach (Guid app in applicationIds) { if (appDirectory.FindInstances(app).Length == 0) { throw new AbortInstallationException( String.Format("Application {0} is not running but should", app)); } } }
public void Execute(InstallEnvironment env) { environment = env; foreach (InstallDestination dest in env.DestinationFileLists[destinationListName]) { dest.InstallEnvironment = environment; if (!dest.Exists) { using (dest.OpenForWriting <Object>()) { /* do nothing just create and close */ } } } }
public void Execute(InstallEnvironment env) { Service service = new Service(Name, autoStart); service.ApplicationPath = ApplicationPath; Node <object> theNode = databaseManager.Find("/System/Runtime/Services"); if (!theNode.TypedStreamExists <Service>()) { theNode.AddTypedStream <Service>(StreamOptions.Indexed | StreamOptions.AllowDerivedTypes); } using (TypedStream <Service> ts = theNode.OpenForWriting <Service>()) { ts.Write(ts.Count, service); } }