public static DriverInstaller Compile(this DriverInstaller driver, Project project, XElement component) { if (driver != null) { component.Add(driver.ToXml()); project.IncludeWixExtension(WixExtension.Difx); project.LibFiles.Add(System.IO.Path.Combine(Compiler.WixLocation, "difxapp_{0}.wixlib".FormatWith(driver.Architecture))); } return(driver); }
void AddItems(WixEntity[] items) { Shortcuts = items.OfType<FileShortcut>().ToArray(); Associations = items.OfType<FileAssociation>().ToArray(); IISVirtualDirs = items.OfType<IISVirtualDir>().ToArray(); ServiceInstaller = items.OfType<ServiceInstaller>().FirstOrDefault(); DriverInstaller = items.OfType<DriverInstaller>().FirstOrDefault(); Permissions = items.OfType<FilePermission>().ToArray(); var firstUnExpectedItem = items.Except(Shortcuts) .Except(Associations) .Except(IISVirtualDirs) .Except(Permissions) .Where(x => x != ServiceInstaller) .Where(x => x != DriverInstaller) .ToArray(); if (firstUnExpectedItem.Any()) throw new ApplicationException("{0} is unexpected. Only {1}, {2}, {3}, {4}, and {5} items can be added to {6}".FormatInline( firstUnExpectedItem.First().GetType(), typeof(FileShortcut), typeof(FileAssociation), typeof(ServiceInstaller), typeof(FilePermission), typeof(DriverInstaller), this.GetType())); }