/// <summary> /// Gets services properties. /// </summary> public static List <ServiceItem> GetServiceItemList( TargetFramework targetFramework, string binaryPathName) { HashSet <ServiceItem> oldServices = GetInstalledServices(); InstallService( targetFramework, binaryPathName); HashSet <ServiceItem> newServices = GetInstalledServices(); newServices.ExceptWith(oldServices); foreach (var serviceItem in newServices) { serviceItem.TargetFramework = targetFramework; serviceItem.BinaryPathName = GetInstalledServiceBinaryPathName(serviceItem.ServiceName); } ServiceTransaction.Begin(newServices.ToList()); UninstallService( targetFramework, binaryPathName); ServiceTransaction.Commit(); return(newServices.ToList()); }
/// <summary> /// Deletes previously installed services. /// </summary> public static void DeletePreviouslyInstalledServices() { var services = ServiceTransaction.GetUncommited(); foreach (var service in services) { UninstallService( service.TargetFramework, service.BinaryPathName); } if (services.Count > 0) { ServiceTransaction.Commit(); } }