// this is mostly a copy of FirstRun() from dotnet_new3.Program.cs public static void FirstRun(IEngineEnvironmentSettings environmentSettings, IInstallerBase installer) { List <string> toInstallList = new List <string>(); Paths paths = new Paths(environmentSettings); if (paths.FileExists(paths.Global.DefaultInstallPackageList)) { toInstallList.AddRange(paths.ReadAllText(paths.Global.DefaultInstallPackageList).Split(new[] { '\n' }, StringSplitOptions.RemoveEmptyEntries)); } if (paths.FileExists(paths.Global.DefaultInstallTemplateList)) { toInstallList.AddRange(paths.ReadAllText(paths.Global.DefaultInstallTemplateList).Split(new[] { '\n' }, StringSplitOptions.RemoveEmptyEntries)); } if (toInstallList.Count > 0) { for (int i = 0; i < toInstallList.Count; i++) { toInstallList[i] = toInstallList[i].Replace("\r", "") .Replace('\\', Path.DirectorySeparatorChar); } installer.InstallPackages(toInstallList); } }
public void ApplyUpdates(IInstallerBase installer, IReadOnlyList <IUpdateUnitDescriptor> updatesToApply) { if (updatesToApply.Any(x => x.InstallUnitDescriptor.FactoryId != DescriptorFactoryId)) { throw new Exception("Incorrect descriptor type"); } installer.InstallPackages(updatesToApply.Select(x => x.InstallString)); }
public TemplateUpdateCoordinator(IEngineEnvironmentSettings environmentSettings, IInstallerBase installer) { _environmentSettings = environmentSettings; _installer = installer; _updateChecker = new TemplateUpdateChecker(_environmentSettings); }
public void ApplyUpdates(IInstallerBase installer, IReadOnlyList <IUpdateUnitDescriptor> updatesToApply) { IReadOnlyList <IUpdateUnitDescriptor> filteredUpdateToApply = updatesToApply.Where(x => x.InstallUnitDescriptor.FactoryId == DescriptorFactoryId).ToList(); installer.InstallPackages(filteredUpdateToApply.Select(x => x.InstallString)); }