diff --git a/Plugins/Wox.Plugin.QueryHistory/HistoryItem.cs b/Plugins/Wox.Plugin.QueryHistory/HistoryItem.cs deleted file mode 100644 index 0921a95203..0000000000 --- a/Plugins/Wox.Plugin.QueryHistory/HistoryItem.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Wox.Plugin.QueryHistory -{ - public class HistoryItem - { - public string Query { get; set; } - public DateTime ExecutedDateTime { get; set; } - - public string GetTimeAgo() - { - return DateTimeAgo(ExecutedDateTime); - } - - private string DateTimeAgo(DateTime dt) - { - TimeSpan span = DateTime.Now - dt; - if (span.Days > 365) - { - int years = (span.Days / 365); - if (span.Days % 365 != 0) - years += 1; - return String.Format("about {0} {1} ago", - years, years == 1 ? "year" : "years"); - } - if (span.Days > 30) - { - int months = (span.Days / 30); - if (span.Days % 31 != 0) - months += 1; - return String.Format("about {0} {1} ago", - months, months == 1 ? "month" : "months"); - } - if (span.Days > 0) - return String.Format("about {0} {1} ago", - span.Days, span.Days == 1 ? "day" : "days"); - if (span.Hours > 0) - return String.Format("about {0} {1} ago", - span.Hours, span.Hours == 1 ? "hour" : "hours"); - if (span.Minutes > 0) - return String.Format("about {0} {1} ago", - span.Minutes, span.Minutes == 1 ? "minute" : "minutes"); - if (span.Seconds > 5) - return String.Format("about {0} seconds ago", span.Seconds); - if (span.Seconds <= 5) - return "just now"; - return string.Empty; - } - } -} diff --git a/Plugins/Wox.Plugin.QueryHistory/Images/history.png b/Plugins/Wox.Plugin.QueryHistory/Images/history.png deleted file mode 100644 index 6bb070398f..0000000000 Binary files a/Plugins/Wox.Plugin.QueryHistory/Images/history.png and /dev/null differ diff --git a/Plugins/Wox.Plugin.QueryHistory/Properties/AssemblyInfo.cs b/Plugins/Wox.Plugin.QueryHistory/Properties/AssemblyInfo.cs deleted file mode 100644 index dce06522b6..0000000000 --- a/Plugins/Wox.Plugin.QueryHistory/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// 有关程序集的常规信息通过以下 -// 特性集控制。更改这些特性值可修改 -// 与程序集关联的信息。 -[assembly: AssemblyTitle("Wox.Plugin.QueryHistory")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Wox.Plugin.QueryHistory")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// 将 ComVisible 设置为 false 使此程序集中的类型 -// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, -// 则将该类型上的 ComVisible 特性设置为 true。 -[assembly: ComVisible(false)] - -// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID -[assembly: Guid("25ab1bbc-f625-4bf5-a2d0-73313abdaae5")] - -// 程序集的版本信息由下面四个值组成: -// -// 主版本 -// 次版本 -// 生成号 -// 修订号 -// -// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, -// 方法是按如下所示使用“*”: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Plugins/Wox.Plugin.QueryHistory/QueryHistory.cs b/Plugins/Wox.Plugin.QueryHistory/QueryHistory.cs deleted file mode 100644 index 838e08bfe1..0000000000 --- a/Plugins/Wox.Plugin.QueryHistory/QueryHistory.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading; - -namespace Wox.Plugin.QueryHistory -{ - public class QueryHistory : IPlugin - { - private PluginInitContext context; - - public List Query(Query query) - { - var histories = QueryHistoryStorage.Instance.GetHistory(); - string filter = query.Search; - if (!string.IsNullOrEmpty(filter)) - { - histories = histories.Where(o => o.Query.Contains(filter)).ToList(); - } - return histories.Select(history => new Result() - { - Title = history.Query, - SubTitle = history.GetTimeAgo(), - IcoPath = "Images\\history.png", - Action = _ => - { - context.API.ChangeQuery(history.Query); - return false; - } - }).ToList(); - } - - public void Init(PluginInitContext context) - { - this.context = context; - } - - void API_BeforeWoxQueryEvent(WoxQueryEventArgs e) - { - Thread.Sleep(5000); - } - - private void API_AfterWoxQueryEvent(WoxQueryEventArgs e) - { - QueryHistoryStorage.Instance.Add(e.Query.RawQuery); - } - } -} diff --git a/Plugins/Wox.Plugin.QueryHistory/QueryHistoryStorage.cs b/Plugins/Wox.Plugin.QueryHistory/QueryHistoryStorage.cs deleted file mode 100644 index 3d10f4a491..0000000000 --- a/Plugins/Wox.Plugin.QueryHistory/QueryHistoryStorage.cs +++ /dev/null @@ -1,83 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using Newtonsoft.Json; -using Wox.Core.Exception; -using Wox.Infrastructure.Storage; - -namespace Wox.Plugin.QueryHistory -{ - public class QueryHistoryStorage : JsonStrorage - { - [JsonProperty] - private List History = new List(); - - private int MaxHistory = 300; - private int cursor = 0; - - protected override string ConfigFolder - { - get { return Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); } - } - - protected override string ConfigName - { - get { return "QueryHistory"; } - } - - public HistoryItem Pop() - { - if (History.Count == 0) return null; - - if (cursor > History.Count - 1) - { - cursor = History.Count - 1; - } - if (cursor < 0) - { - cursor = 0; - } - - return History[cursor--]; - } - - public void Reset() - { - cursor = History.Count - 1; - } - - public void Add(string query) - { - if (string.IsNullOrEmpty(query)) return; - if (History.Count > MaxHistory) - { - History.RemoveAt(0); - } - - if (History.Count > 0 && History.Last().Query == query) - { - History.Last().ExecutedDateTime = DateTime.Now; - } - else - { - History.Add(new HistoryItem() - { - Query = query, - ExecutedDateTime = DateTime.Now - }); - } - - if (History.Count % 5 == 0) - { - Save(); - } - } - - public List GetHistory() - { - return History.OrderByDescending(o => o.ExecutedDateTime).ToList(); - } - } -} diff --git a/Plugins/Wox.Plugin.QueryHistory/Wox.Plugin.QueryHistory.csproj b/Plugins/Wox.Plugin.QueryHistory/Wox.Plugin.QueryHistory.csproj deleted file mode 100644 index 34fc2868db..0000000000 --- a/Plugins/Wox.Plugin.QueryHistory/Wox.Plugin.QueryHistory.csproj +++ /dev/null @@ -1,85 +0,0 @@ - - - - - Debug - AnyCPU - {B552DCB6-692E-4B1D-9E0B-9096A2A7E6B0} - Library - Properties - Wox.Plugin.QueryHistory - Wox.Plugin.QueryHistory - v3.5 - 512 - ..\..\ - - - true - full - false - ..\..\Output\Debug\Plugins\Wox.Plugin.QueryHistory\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - ..\..\Output\Release\Plugins\Wox.Plugin.QueryHistory\ - TRACE - prompt - 4 - - - - False - ..\..\packages\Newtonsoft.Json.6.0.8\lib\net35\Newtonsoft.Json.dll - - - - - - - - - - - - - - - - - {B749F0DB-8E75-47DB-9E5E-265D16D0C0D2} - Wox.Core - - - {4fd29318-a8ab-4d8f-aa47-60bc241b8da3} - Wox.Infrastructure - - - {8451ecdd-2ea4-4966-bb0a-7bbc40138e80} - Wox.Plugin - - - - - - PreserveNewest - - - - - PreserveNewest - - - - - - diff --git a/Plugins/Wox.Plugin.QueryHistory/packages.config b/Plugins/Wox.Plugin.QueryHistory/packages.config deleted file mode 100644 index 7a13476a54..0000000000 --- a/Plugins/Wox.Plugin.QueryHistory/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/Plugins/Wox.Plugin.QueryHistory/plugin.json b/Plugins/Wox.Plugin.QueryHistory/plugin.json deleted file mode 100644 index 959874b682..0000000000 --- a/Plugins/Wox.Plugin.QueryHistory/plugin.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "ID":"54F327C503414B9489CDD331EE9472EF", - "ActionKeyword":"history", - "Name":"Query History", - "Description":"Remember Wox query history", - "Author":"qianlifeng", - "Version":"1.0.0", - "Language":"csharp", - "Website":"http://www.getwox.com/plugin", - "ExecuteFileName":"Wox.Plugin.QueryHistory.dll", - "IcoPath":"Images\\history.png" -} \ No newline at end of file diff --git a/Wox.UpdateFeedGenerator/ConfigStorage.cs b/Wox.UpdateFeedGenerator/ConfigStorage.cs deleted file mode 100644 index a7dcbc35cf..0000000000 --- a/Wox.UpdateFeedGenerator/ConfigStorage.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System.IO; -using System.Reflection; -using Newtonsoft.Json; -using Wox.Infrastructure.Storage; - -namespace Wox.UpdateFeedGenerator -{ - public class ConfigStorage : JsonStrorage - { - [JsonProperty] - public string OutputDirectory { get; set; } - - [JsonProperty] - public string SourceDirectory { get; set; } - - [JsonProperty] - public string BaseURL { get; set; } - - [JsonProperty] - public string FeedXMLName { get; set; } - - [JsonProperty] - public bool CheckVersion { get; set; } - - [JsonProperty] - public bool CheckSize { get; set; } - - [JsonProperty] - public bool CheckDate { get; set; } - - [JsonProperty] - public bool CheckHash { get; set; } - - protected override void OnAfterLoad(ConfigStorage config) - { - if (string.IsNullOrEmpty(config.OutputDirectory)) - { - config.OutputDirectory = @"Update"; - Instance.Save(); - } - } - - protected override string FileName { get; } = "config"; - } -} diff --git a/Wox.UpdateFeedGenerator/FileInfoEx.cs b/Wox.UpdateFeedGenerator/FileInfoEx.cs deleted file mode 100644 index c02704157e..0000000000 --- a/Wox.UpdateFeedGenerator/FileInfoEx.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.Diagnostics; -using System.IO; -using NAppUpdate.Framework.Utils; - -namespace Wox.UpdateFeedGenerator -{ - public class FileInfoEx - { - private readonly FileInfo myFileInfo; - private readonly string myFileVersion; - private readonly string myHash; - - public FileInfo FileInfo - { - get { return myFileInfo; } - } - - public string FileVersion - { - get { return myFileVersion; } - } - - public string Hash - { - get { return myHash; } - } - - public string RelativeName { get; private set; } - - public FileInfoEx(string fileName,int rootDirectoryLength) - { - myFileInfo = new FileInfo(fileName); - myFileVersion = FileVersionInfo.GetVersionInfo(fileName).FileVersion; - if (myFileVersion != null) myFileVersion = myFileVersion.Replace(", ", "."); - myHash = FileChecksum.GetSHA256Checksum(fileName); - RelativeName = fileName.Substring(rootDirectoryLength + 1); - } - } -} diff --git a/Wox.UpdateFeedGenerator/FileSystemEnumerator.cs b/Wox.UpdateFeedGenerator/FileSystemEnumerator.cs deleted file mode 100644 index b087f9d4d2..0000000000 --- a/Wox.UpdateFeedGenerator/FileSystemEnumerator.cs +++ /dev/null @@ -1,248 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Runtime.ConstrainedExecution; -using System.Runtime.InteropServices; -using System.Security.Permissions; -using System.Text.RegularExpressions; -using Microsoft.Win32.SafeHandles; -using Wox.UpdateFeedGenerator.Win32; - -namespace Wox.UpdateFeedGenerator -{ - namespace Win32 - { - /// - /// Structure that maps to WIN32_FIND_DATA - /// - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] - internal sealed class FindData - { - public int fileAttributes; - public int creationTime_lowDateTime; - public int creationTime_highDateTime; - public int lastAccessTime_lowDateTime; - public int lastAccessTime_highDateTime; - public int lastWriteTime_lowDateTime; - public int lastWriteTime_highDateTime; - public int nFileSizeHigh; - public int nFileSizeLow; - public int dwReserved0; - public int dwReserved1; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] public String fileName; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 14)] public String alternateFileName; - } - - /// - /// SafeHandle class for holding find handles - /// - internal sealed class SafeFindHandle : SafeHandleMinusOneIsInvalid - { - /// - /// Constructor - /// - public SafeFindHandle() : base(true) {} - - /// - /// Release the find handle - /// - /// true if the handle was released - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] - protected override bool ReleaseHandle() - { - return SafeNativeMethods.FindClose(handle); - } - } - - /// - /// Wrapper for P/Invoke methods used by FileSystemEnumerator - /// - [SecurityPermission(SecurityAction.Assert, UnmanagedCode = true)] - internal static class SafeNativeMethods - { - [DllImport("Kernel32.dll", CharSet = CharSet.Auto)] - public static extern SafeFindHandle FindFirstFile(String fileName, [In, Out] FindData findFileData); - - [DllImport("kernel32", CharSet = CharSet.Auto)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool FindNextFile(SafeFindHandle hFindFile, [In, Out] FindData lpFindFileData); - - [DllImport("kernel32", CharSet = CharSet.Auto)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool FindClose(IntPtr hFindFile); - } - } - - /// - /// File system enumerator. This class provides an easy to use, efficient mechanism for searching a list of - /// directories for files matching a list of file specifications. The search is done incrementally as matches - /// are consumed, so the overhead before processing the first match is always kept to a minimum. - /// - public sealed class FileSystemEnumerator : IDisposable - { - /// - /// Information that's kept in our stack for simulated recursion - /// - private struct SearchInfo - { - /// - /// Find handle returned by FindFirstFile - /// - public readonly SafeFindHandle Handle; - - /// - /// Path that was searched to yield the find handle. - /// - public readonly string Path; - - /// - /// Constructor - /// - /// Find handle returned by FindFirstFile. - /// Path corresponding to find handle. - public SearchInfo(SafeFindHandle h, string p) - { - Handle = h; - Path = p; - } - } - - /// - /// Stack of open scopes. This is a member (instead of a local variable) - /// to allow Dispose to close any open find handles if the object is disposed - /// before the enumeration is completed. - /// - private readonly Stack m_scopes; - - /// - /// Array of paths to be searched. - /// - private readonly string[] m_paths; - - /// - /// Array of regular expressions that will detect matching files. - /// - private readonly List m_fileSpecs; - - /// - /// If true, sub-directories are searched. - /// - private readonly bool m_includeSubDirs; - - #region IDisposable implementation - - /// - /// IDisposable.Dispose - /// - public void Dispose() - { - while (m_scopes.Count > 0) { - SearchInfo si = m_scopes.Pop(); - si.Handle.Close(); - } - } - - #endregion - - /// - /// Constructor. - /// - /// Semicolon- or comma-delimitted list of paths to search. - /// Semicolon- or comma-delimitted list of wildcard filespecs to match. - /// If true, subdirectories are searched. - public FileSystemEnumerator(string pathsToSearch, string fileTypesToMatch, bool includeSubDirs) - { - m_scopes = new Stack(); - - // check for nulls - if (null == pathsToSearch) throw new ArgumentNullException("pathsToSearch"); - if (null == fileTypesToMatch) throw new ArgumentNullException("fileTypesToMatch"); - - // make sure spec doesn't contain invalid characters - if (fileTypesToMatch.IndexOfAny(new[] { ':', '<', '>', '/', '\\' }) >= 0) throw new ArgumentException("invalid cahracters in wildcard pattern", "fileTypesToMatch"); - - m_includeSubDirs = includeSubDirs; - m_paths = pathsToSearch.Split(';', ','); - - string[] specs = fileTypesToMatch.Split(';', ','); - m_fileSpecs = new List(specs.Length); - foreach (string spec in specs) { - // trim whitespace off file spec and convert Win32 wildcards to regular expressions - string pattern = spec.Trim().Replace(".", @"\.").Replace("*", @".*").Replace("?", @".?"); - m_fileSpecs.Add(new Regex("^" + pattern + "$", RegexOptions.IgnoreCase)); - } - } - - /// - /// Get an enumerator that returns all of the files that match the wildcards that - /// are in any of the directories to be searched. - /// - /// An IEnumerable that returns all matching files one by one. - /// - /// The enumerator that is returned finds files using a lazy algorithm that - /// searches directories incrementally as matches are consumed. - /// - public IEnumerable Matches() - { - foreach (string rootPath in m_paths) { - string path = rootPath.Trim(); - - // we "recurse" into a new directory by jumping to this spot - top: - - // check security - ensure that caller has rights to read this directory - new FileIOPermission(FileIOPermissionAccess.PathDiscovery, Path.Combine(path, ".")).Demand(); - - // now that security is checked, go read the directory - FindData findData = new FindData(); - SafeFindHandle handle = SafeNativeMethods.FindFirstFile(Path.Combine(path, "*"), findData); - m_scopes.Push(new SearchInfo(handle, path)); - bool restart = false; - - // we "return" from a sub-directory by jumping to this spot - restart: -// ReSharper disable InvertIf - if (!handle.IsInvalid) { -// ReSharper restore InvertIf - do { - // if we restarted the loop (unwound a recursion), fetch the next match - if (restart) { - restart = false; - continue; - } - - // don't match . or .. - if (findData.fileName.Equals(@".") || findData.fileName.Equals(@"..")) continue; - - if ((findData.fileAttributes & (int)FileAttributes.Directory) != 0) { - if (m_includeSubDirs) { - // it's a directory - recurse into it - path = Path.Combine(path, findData.fileName); - goto top; - } - } else { - // it's a file, see if any of the filespecs matches it - foreach (Regex fileSpec in m_fileSpecs) { - // if this spec matches, return this file's info - if (fileSpec.IsMatch(findData.fileName)) yield return new FileInfo(Path.Combine(path, findData.fileName)); - } - } - } while (SafeNativeMethods.FindNextFile(handle, findData)); - - // close this find handle - handle.Close(); - - // unwind the stack - are we still in a recursion? - m_scopes.Pop(); - if (m_scopes.Count > 0) { - SearchInfo si = m_scopes.Peek(); - handle = si.Handle; - path = si.Path; - restart = true; - goto restart; - } - } - } - } - } -} diff --git a/Wox.UpdateFeedGenerator/Generator.cs b/Wox.UpdateFeedGenerator/Generator.cs deleted file mode 100644 index 9444254895..0000000000 --- a/Wox.UpdateFeedGenerator/Generator.cs +++ /dev/null @@ -1,179 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Threading; -using System.Xml; - -namespace Wox.UpdateFeedGenerator -{ - public class Generator - { - private string OutputDirectory; - private string SourceDirectory; - private string BaseURL = ConfigStorage.Instance.BaseURL; - private string feedXMLPath; - private bool checkVersion = ConfigStorage.Instance.CheckVersion; - private bool checkSize = ConfigStorage.Instance.CheckSize; - private bool checkDate = ConfigStorage.Instance.CheckDate; - private bool checkHash = ConfigStorage.Instance.CheckHash; - - public Generator() - { - OutputDirectory = Path.GetFullPath(ConfigStorage.Instance.OutputDirectory); - SourceDirectory = Path.GetFullPath(ConfigStorage.Instance.SourceDirectory); - feedXMLPath = Path.Combine(ConfigStorage.Instance.OutputDirectory, ConfigStorage.Instance.FeedXMLName); - } - - private List ReadSourceFiles() - { - List files = new List(); - FileSystemEnumerator enumerator = new FileSystemEnumerator(SourceDirectory, "*.*", true); - foreach (FileInfo fi in enumerator.Matches()) - { - string file = fi.FullName; - if ((IsIgnorable(file))) continue; - FileInfoEx thisInfo = new FileInfoEx(file, SourceDirectory.Length); - files.Add(thisInfo); - } - return files; - } - - private bool IsIgnorable(string thisFile) - { - return false; - } - - public void Build() - { - Console.WriteLine("Building Wox update feed"); - if (!Directory.Exists(OutputDirectory)) - { - Directory.CreateDirectory(OutputDirectory); - } - - XmlDocument doc = new XmlDocument(); - XmlDeclaration dec = doc.CreateXmlDeclaration("1.0", "utf-8", null); - - doc.AppendChild(dec); - XmlElement feed = doc.CreateElement("Feed"); - feed.SetAttribute("BaseUrl", BaseURL.Trim()); - doc.AppendChild(feed); - - XmlElement tasks = doc.CreateElement("Tasks"); - - foreach (FileInfoEx file in ReadSourceFiles()) - { - Console.WriteLine("adding {0} to feed xml.", file.FileInfo.FullName); - XmlElement task = doc.CreateElement("FileUpdateTask"); - task.SetAttribute("localPath", file.RelativeName); - - // generate FileUpdateTask metadata items - task.SetAttribute("lastModified", file.FileInfo.LastWriteTime.ToFileTime().ToString(CultureInfo.InvariantCulture)); - task.SetAttribute("fileSize", file.FileInfo.Length.ToString(CultureInfo.InvariantCulture)); - if (!string.IsNullOrEmpty(file.FileVersion)) task.SetAttribute("version", file.FileVersion); - - XmlElement conds = doc.CreateElement("Conditions"); - XmlElement cond; - bool hasFirstCondition = false; - - //File Exists - cond = doc.CreateElement("FileExistsCondition"); - cond.SetAttribute("type", "or"); - conds.AppendChild(cond); - - //Version - if (checkVersion && !string.IsNullOrEmpty(file.FileVersion)) - { - cond = doc.CreateElement("FileVersionCondition"); - cond.SetAttribute("what", "below"); - cond.SetAttribute("version", file.FileVersion); - conds.AppendChild(cond); - hasFirstCondition = true; - } - - //Size - if (checkSize) - { - cond = doc.CreateElement("FileSizeCondition"); - cond.SetAttribute("type", hasFirstCondition ? "or-not" : "not"); - cond.SetAttribute("what", "is"); - cond.SetAttribute("size", file.FileInfo.Length.ToString(CultureInfo.InvariantCulture)); - conds.AppendChild(cond); - } - - //Date - if (checkDate) - { - cond = doc.CreateElement("FileDateCondition"); - if (hasFirstCondition) cond.SetAttribute("type", "or"); - cond.SetAttribute("what", "older"); - // local timestamp, not UTC - cond.SetAttribute("timestamp", file.FileInfo.LastWriteTime.ToFileTime().ToString(CultureInfo.InvariantCulture)); - conds.AppendChild(cond); - } - - //Hash - if (checkHash) - { - cond = doc.CreateElement("FileChecksumCondition"); - cond.SetAttribute("type", hasFirstCondition ? "or-not" : "not"); - cond.SetAttribute("checksumType", "sha256"); - cond.SetAttribute("checksum", file.Hash); - conds.AppendChild(cond); - } - - task.AppendChild(conds); - tasks.AppendChild(task); - string destFile = Path.Combine(OutputDirectory, file.RelativeName); - CopyFile(file.FileInfo.FullName, destFile); - } - feed.AppendChild(tasks); - doc.Save(feedXMLPath); - } - - private bool CopyFile(string sourceFile, string destFile) - { - // If the target folder doesn't exist, create the path to it - var fi = new FileInfo(destFile); - var d = Directory.GetParent(fi.FullName); - if (!Directory.Exists(d.FullName)) CreateDirectoryPath(d.FullName); - - // Copy with delayed retry - int retries = 3; - while (retries > 0) - { - try - { - if (File.Exists(destFile)) File.Delete(destFile); - File.Copy(sourceFile, destFile); - retries = 0; // success - return true; - } - catch (IOException) - { - // Failed... let's try sleeping a bit (slow disk maybe) - if (retries-- > 0) Thread.Sleep(200); - } - catch (UnauthorizedAccessException) - { - // same handling as IOException - if (retries-- > 0) Thread.Sleep(200); - } - } - return false; - } - - private void CreateDirectoryPath(string directoryPath) - { - // Create the folder/path if it doesn't exist, with delayed retry - int retries = 3; - while (retries > 0 && !Directory.Exists(directoryPath)) - { - Directory.CreateDirectory(directoryPath); - if (retries-- < 3) Thread.Sleep(200); - } - } - - } -} diff --git a/Wox.UpdateFeedGenerator/Program.cs b/Wox.UpdateFeedGenerator/Program.cs deleted file mode 100644 index d2b3f274e6..0000000000 --- a/Wox.UpdateFeedGenerator/Program.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Wox.UpdateFeedGenerator -{ - class Program - { - static void Main(string[] args) - { - new Generator().Build(); - } - } -} diff --git a/Wox.UpdateFeedGenerator/Properties/AssemblyInfo.cs b/Wox.UpdateFeedGenerator/Properties/AssemblyInfo.cs deleted file mode 100644 index 33c0c07f30..0000000000 --- a/Wox.UpdateFeedGenerator/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,5 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("Wox.UpdateFeedGenerator")] -[assembly: Guid("2f3420c0-2c21-4f71-a45d-a47b5305fe20")] \ No newline at end of file diff --git a/Wox.UpdateFeedGenerator/README.md b/Wox.UpdateFeedGenerator/README.md deleted file mode 100644 index 00741d2ac0..0000000000 --- a/Wox.UpdateFeedGenerator/README.md +++ /dev/null @@ -1 +0,0 @@ -NAppUpdate feed generator for Wox. It's something like [FeedBuilder](https://github.com/synhershko/NAppUpdate/tree/master/FeedBuilder) \ No newline at end of file diff --git a/Wox.UpdateFeedGenerator/Wox.UpdateFeedGenerator.csproj b/Wox.UpdateFeedGenerator/Wox.UpdateFeedGenerator.csproj deleted file mode 100644 index b4f7c27f2d..0000000000 --- a/Wox.UpdateFeedGenerator/Wox.UpdateFeedGenerator.csproj +++ /dev/null @@ -1,86 +0,0 @@ - - - - - Debug - AnyCPU - {D120E62B-EC59-4FB4-8129-EFDD4C446A5F} - Exe - Properties - Wox.UpdateFeedGenerator - Wox.UpdateFeedGenerator - v4.5.2 - 512 - ..\ - - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - - ..\packages\NAppUpdate.Framework.0.3.2.0\lib\net20\NAppUpdate.Framework.dll - True - - - ..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll - True - - - - - - - - - - - Properties\SolutionAssemblyInfo.cs - - - - - - - - - - - - Designer - - - - - - {4fd29318-a8ab-4d8f-aa47-60bc241b8da3} - Wox.Infrastructure - - - - - \ No newline at end of file diff --git a/Wox.UpdateFeedGenerator/app.config b/Wox.UpdateFeedGenerator/app.config deleted file mode 100644 index ff99501038..0000000000 --- a/Wox.UpdateFeedGenerator/app.config +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/Wox.UpdateFeedGenerator/packages.config b/Wox.UpdateFeedGenerator/packages.config deleted file mode 100644 index aba1c6d1b0..0000000000 --- a/Wox.UpdateFeedGenerator/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/Wox.sln b/Wox.sln index 9bbdd00d60..7fb7e702ba 100644 --- a/Wox.sln +++ b/Wox.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.25029.0 +VisualStudioVersion = 14.0.25123.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Test", "Wox.Test\Wox.Test.csproj", "{FF742965-9A80-41A5-B042-D6C7D3A21708}" ProjectSection(ProjectDependencies) = postProject @@ -18,7 +18,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugins", "Plugins", "{3A73 EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox", "Wox\Wox.csproj", "{DB90F671-D861-46BB-93A3-F1304F5BA1C5}" ProjectSection(ProjectDependencies) = postProject - {D120E62B-EC59-4FB4-8129-EFDD4C446A5F} = {D120E62B-EC59-4FB4-8129-EFDD4C446A5F} {230AE83F-E92E-4E69-8355-426B305DA9C0} = {230AE83F-E92E-4E69-8355-426B305DA9C0} {1EE20B48-82FB-48A2-8086-675D6DDAB4F0} = {1EE20B48-82FB-48A2-8086-675D6DDAB4F0} {0B9DE348-9361-4940-ADB6-F5953BFFCCEC} = {0B9DE348-9361-4940-ADB6-F5953BFFCCEC} @@ -71,8 +70,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.CrashReporter", "Wox.Cr {88731DA8-C020-476E-B79A-3ADEF65ACA9F} = {88731DA8-C020-476E-B79A-3ADEF65ACA9F} EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.UpdateFeedGenerator", "Wox.UpdateFeedGenerator\Wox.UpdateFeedGenerator.csproj", "{D120E62B-EC59-4FB4-8129-EFDD4C446A5F}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Plugin.Everything", "Plugins\Wox.Plugin.Everything\Wox.Plugin.Everything.csproj", "{230AE83F-E92E-4E69-8355-426B305DA9C0}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{FFD651C7-0546-441F-BC8C-D4EE8FD01EA7}" @@ -301,14 +298,6 @@ Global {2FEB2298-7653-4009-B1EA-FFFB1A768BCC}.Release|x64.Build.0 = Release|Any CPU {2FEB2298-7653-4009-B1EA-FFFB1A768BCC}.Release|x86.ActiveCfg = Release|Any CPU {2FEB2298-7653-4009-B1EA-FFFB1A768BCC}.Release|x86.Build.0 = Release|Any CPU - {D120E62B-EC59-4FB4-8129-EFDD4C446A5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D120E62B-EC59-4FB4-8129-EFDD4C446A5F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D120E62B-EC59-4FB4-8129-EFDD4C446A5F}.Debug|x64.ActiveCfg = Debug|Any CPU - {D120E62B-EC59-4FB4-8129-EFDD4C446A5F}.Debug|x86.ActiveCfg = Debug|Any CPU - {D120E62B-EC59-4FB4-8129-EFDD4C446A5F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D120E62B-EC59-4FB4-8129-EFDD4C446A5F}.Release|Any CPU.Build.0 = Release|Any CPU - {D120E62B-EC59-4FB4-8129-EFDD4C446A5F}.Release|x64.ActiveCfg = Release|Any CPU - {D120E62B-EC59-4FB4-8129-EFDD4C446A5F}.Release|x86.ActiveCfg = Release|Any CPU {230AE83F-E92E-4E69-8355-426B305DA9C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {230AE83F-E92E-4E69-8355-426B305DA9C0}.Debug|Any CPU.Build.0 = Debug|Any CPU {230AE83F-E92E-4E69-8355-426B305DA9C0}.Debug|x64.ActiveCfg = Debug|Any CPU