private static bool IsUpdated(FileInfo file) { var currentFile = file.Directory + file.Name; return(!File.Exists(currentFile) || !file.Version.HasVersion || file.Version.CompareTo(FileInfo.GetFileVersion(currentFile)) > 0); }
private static void WriteFile(FileInfo fileInfo, FileData fileData) { var filePath = fileInfo.GetFullPath(); var fileDir = Path.GetDirectoryName(filePath); if (!Directory.Exists(fileDir)) { Directory.CreateDirectory(fileDir); } File.WriteAllBytes(filePath, fileData.Data); }