mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 20:27:36 +02:00
Add Wox.UpdateFeedGenerator
This commit is contained in:
38
Wox.UpdateFeedGenerator/FileInfoEx.cs
Normal file
38
Wox.UpdateFeedGenerator/FileInfoEx.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
|
||||
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 = NAppUpdate.Framework.Utils.FileChecksum.GetSHA256Checksum(fileName);
|
||||
RelativeName = fileName.Substring(rootDirectoryLength + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user