From 2724cfee4c163f3297ee25edfd2372767cfd4945 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 19 Jul 2018 00:58:00 -0700 Subject: Move tool projects to Tools repo --- src/WixToolset.BuildTasks/GetCabList.cs | 87 --------------------------------- 1 file changed, 87 deletions(-) delete mode 100644 src/WixToolset.BuildTasks/GetCabList.cs (limited to 'src/WixToolset.BuildTasks/GetCabList.cs') diff --git a/src/WixToolset.BuildTasks/GetCabList.cs b/src/WixToolset.BuildTasks/GetCabList.cs deleted file mode 100644 index e97538af..00000000 --- a/src/WixToolset.BuildTasks/GetCabList.cs +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.BuildTasks -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Diagnostics; - using System.IO; - using System.Reflection; - using System.Xml; - using Microsoft.Build.Framework; - using Microsoft.Build.Utilities; - using WixToolset.Dtf.WindowsInstaller; - using Microsoft.Win32; - - /// - /// This task assigns Culture metadata to files based on the value of the Culture attribute on the - /// WixLocalization element inside the file. - /// - public class GetCabList : Task - { - private ITaskItem database; - private ITaskItem[] cabList; - - /// - /// The list of database files to find cabs in - /// - [Required] - public ITaskItem Database - { - get { return this.database; } - set { this.database = value; } - } - - /// - /// The total list of cabs in this database - /// - [Output] - public ITaskItem[] CabList - { - get { return this.cabList; } - } - - /// - /// Gets a complete list of external cabs referenced by the given installer database file. - /// - /// True upon completion of the task execution. - public override bool Execute() - { - string databaseFile = this.database.ItemSpec; - Object []args = { }; - System.Collections.Generic.List cabNames = new System.Collections.Generic.List(); - - // If the file doesn't exist, no cabs to return, so exit now - if (!File.Exists(databaseFile)) - { - return true; - } - - using (Database database = new Database(databaseFile)) - { - // If the media table doesn't exist, no cabs to return, so exit now - if (null == database.Tables["Media"]) - { - return true; - } - - System.Collections.IList records = database.ExecuteQuery("SELECT `Cabinet` FROM `Media`", args); - - foreach (string cabName in records) - { - if (String.IsNullOrEmpty(cabName) || cabName.StartsWith("#", StringComparison.Ordinal)) - { - continue; - } - - cabNames.Add(new TaskItem(Path.Combine(Path.GetDirectoryName(databaseFile), cabName))); - } - } - - this.cabList = cabNames.ToArray(); - - return true; - } - } -} -- cgit v1.2.3-55-g6feb