static WixEntity[] GetEasyCaptureStructures(string root) { var filter = new FileFilter(root); var dirs = new WixEntity[] { GetTopDir(filter), //new Dir("x86", filter.GetWixFiles("*.dll", "x86")), //new Dir("x64", filter.GetWixFiles("*.dll", "x64")), //new Dir("logs", new File [] { }), //new Dir("wwwroot", new Files(System.IO.Path.Combine(root, @"wwwroot\*.*"))) }; return(dirs.ToArray()); }
internal void ResetAutoIdGeneration(bool supressWarning) { WixGuid.ConsistentGenerationStartValue = this.UpgradeCode; WixEntity.ResetIdGenerator(supressWarning); }
void AddItems(WixEntity[] items) { var files = new List<File>(); var dirs = new List<Dir>(); var fileCollections = new List<DirFiles>(); var dirItemsCollections = new List<Files>(); var shortcuts = new List<ExeFileShortcut>(); var mergeModules = new List<Merge>(); var dirPermissions = new List<DirPermission>(); var odbcSources = new List<ODBCDataSource>(); foreach (WixEntity item in items) if (item is Dir) dirs.Add(item as Dir); else if (item is File) files.Add(item as File); else if (item is DirFiles) fileCollections.Add(item as DirFiles); else if (item is Files) dirItemsCollections.Add(item as Files); else if (item is ExeFileShortcut) shortcuts.Add(item as ExeFileShortcut); else if (item is Merge) mergeModules.Add(item as Merge); else if (item is DirPermission) dirPermissions.Add(item as DirPermission); else if (item is ODBCDataSource) odbcSources.Add(item as ODBCDataSource); else throw new Exception(item.GetType().Name + " is not expected to be a child of WixSharp.Dir"); Files = files.ToArray(); Dirs = dirs.ToArray(); DirFileCollections = fileCollections.ToArray(); FileCollections = dirItemsCollections.ToArray(); Shortcuts = shortcuts.ToArray(); MergeModules = mergeModules.ToArray(); Permissions = dirPermissions.ToArray(); ODBCDataSources = odbcSources.ToArray(); }
void AddItems(WixEntity[] items) { Shortcuts = items.OfType<FileShortcut>().ToArray(); Associations = items.OfType<FileAssociation>().ToArray(); IISVirtualDirs = items.OfType<IISVirtualDir>().ToArray(); ServiceInstaller = items.OfType<ServiceInstaller>().FirstOrDefault(); Permissions = items.OfType<FilePermission>().ToArray(); var firstUnExpectedItem = items.Except(Shortcuts) .Except(Associations) .Except(IISVirtualDirs) .Except(Permissions) .Where(x => x != ServiceInstaller) .ToArray(); if (firstUnExpectedItem.Any()) throw new ApplicationException("{4} is unexpected. Only {0}, {1}, {2}, and {3} items can be added to {4}".FormatInline( typeof(FileShortcut), typeof(FileAssociation), typeof(ServiceInstaller), typeof(FilePermission), this.GetType(), firstUnExpectedItem.First().GetType())); }