mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Update ApplicationVersion to use GetInformationalVersion across multiple files
This commit is contained in:
@@ -45,6 +45,13 @@ namespace Aaru.CommonTypes.Interop;
|
|||||||
/// <summary>Gets our own, or the runtime's version</summary>
|
/// <summary>Gets our own, or the runtime's version</summary>
|
||||||
public static class Version
|
public static class Version
|
||||||
{
|
{
|
||||||
|
/// <summary>Gets version string</summary>
|
||||||
|
/// <returns>Version</returns>
|
||||||
|
public static string GetInformationalVersion() => typeof(Version).Assembly
|
||||||
|
.GetCustomAttribute<
|
||||||
|
AssemblyInformationalVersionAttribute>()
|
||||||
|
?.InformationalVersion.Split('+')[0];
|
||||||
|
|
||||||
/// <summary>Gets version string</summary>
|
/// <summary>Gets version string</summary>
|
||||||
/// <returns>Version</returns>
|
/// <returns>Version</returns>
|
||||||
public static string GetVersion() => typeof(Version).Assembly.GetName().Version?.ToString();
|
public static string GetVersion() => typeof(Version).Assembly.GetName().Version?.ToString();
|
||||||
|
|||||||
@@ -686,7 +686,7 @@ public partial class Dump
|
|||||||
var metadata = new CommonTypes.Structs.ImageInfo
|
var metadata = new CommonTypes.Structs.ImageInfo
|
||||||
{
|
{
|
||||||
Application = "Aaru",
|
Application = "Aaru",
|
||||||
ApplicationVersion = Version.GetVersion()
|
ApplicationVersion = Version.GetInformationalVersion()
|
||||||
};
|
};
|
||||||
|
|
||||||
if(!outputFormat.SetImageInfo(metadata))
|
if(!outputFormat.SetImageInfo(metadata))
|
||||||
|
|||||||
@@ -1079,9 +1079,8 @@ sealed partial class Dump
|
|||||||
foreach(int sub in _resume.BadSubchannels) subchannelExtents.Add(sub);
|
foreach(int sub in _resume.BadSubchannels) subchannelExtents.Add(sub);
|
||||||
|
|
||||||
if(_resume.NextBlock < blocks)
|
if(_resume.NextBlock < blocks)
|
||||||
{
|
for(ulong i = _resume.NextBlock; i < blocks; i++)
|
||||||
for(ulong i = _resume.NextBlock; i < blocks; i++) subchannelExtents.Add((int)i);
|
subchannelExtents.Add((int)i);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_resume.NextBlock > 0)
|
if(_resume.NextBlock > 0)
|
||||||
@@ -1496,9 +1495,8 @@ sealed partial class Dump
|
|||||||
supportsLongSectors);
|
supportsLongSectors);
|
||||||
|
|
||||||
foreach(Tuple<ulong, ulong> leadoutExtent in leadOutExtents.ToArray())
|
foreach(Tuple<ulong, ulong> leadoutExtent in leadOutExtents.ToArray())
|
||||||
{
|
for(ulong e = leadoutExtent.Item1; e <= leadoutExtent.Item2; e++)
|
||||||
for(ulong e = leadoutExtent.Item1; e <= leadoutExtent.Item2; e++) subchannelExtents.Remove((int)e);
|
subchannelExtents.Remove((int)e);
|
||||||
}
|
|
||||||
|
|
||||||
if(subchannelExtents.Count > 0 && _retryPasses > 0 && _retrySubchannel)
|
if(subchannelExtents.Count > 0 && _retryPasses > 0 && _retrySubchannel)
|
||||||
{
|
{
|
||||||
@@ -1568,7 +1566,7 @@ sealed partial class Dump
|
|||||||
var metadata = new CommonTypes.Structs.ImageInfo
|
var metadata = new CommonTypes.Structs.ImageInfo
|
||||||
{
|
{
|
||||||
Application = "Aaru",
|
Application = "Aaru",
|
||||||
ApplicationVersion = Version.GetVersion()
|
ApplicationVersion = Version.GetInformationalVersion()
|
||||||
};
|
};
|
||||||
|
|
||||||
if(!outputOptical.SetImageInfo(metadata))
|
if(!outputOptical.SetImageInfo(metadata))
|
||||||
|
|||||||
@@ -401,7 +401,7 @@ public partial class Dump
|
|||||||
var metadata = new CommonTypes.Structs.ImageInfo
|
var metadata = new CommonTypes.Structs.ImageInfo
|
||||||
{
|
{
|
||||||
Application = "Aaru",
|
Application = "Aaru",
|
||||||
ApplicationVersion = Version.GetVersion()
|
ApplicationVersion = Version.GetInformationalVersion()
|
||||||
};
|
};
|
||||||
|
|
||||||
if(!outputBai.SetImageInfo(metadata))
|
if(!outputBai.SetImageInfo(metadata))
|
||||||
|
|||||||
@@ -689,7 +689,7 @@ partial class Dump
|
|||||||
var metadata = new CommonTypes.Structs.ImageInfo
|
var metadata = new CommonTypes.Structs.ImageInfo
|
||||||
{
|
{
|
||||||
Application = "Aaru",
|
Application = "Aaru",
|
||||||
ApplicationVersion = Version.GetVersion()
|
ApplicationVersion = Version.GetInformationalVersion()
|
||||||
};
|
};
|
||||||
|
|
||||||
if(!outputFormat.SetImageInfo(metadata))
|
if(!outputFormat.SetImageInfo(metadata))
|
||||||
|
|||||||
@@ -612,7 +612,7 @@ public partial class Dump
|
|||||||
var metadata = new CommonTypes.Structs.ImageInfo
|
var metadata = new CommonTypes.Structs.ImageInfo
|
||||||
{
|
{
|
||||||
Application = "Aaru",
|
Application = "Aaru",
|
||||||
ApplicationVersion = Version.GetVersion()
|
ApplicationVersion = Version.GetInformationalVersion()
|
||||||
};
|
};
|
||||||
|
|
||||||
if(!outputFormat.SetImageInfo(metadata))
|
if(!outputFormat.SetImageInfo(metadata))
|
||||||
|
|||||||
@@ -627,7 +627,7 @@ public partial class Dump
|
|||||||
var metadata = new CommonTypes.Structs.ImageInfo
|
var metadata = new CommonTypes.Structs.ImageInfo
|
||||||
{
|
{
|
||||||
Application = "Aaru",
|
Application = "Aaru",
|
||||||
ApplicationVersion = Version.GetVersion(),
|
ApplicationVersion = Version.GetInformationalVersion(),
|
||||||
MediaPartNumber = mediaPartNumber
|
MediaPartNumber = mediaPartNumber
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ static class ResumeSupport
|
|||||||
|
|
||||||
if(oldTry.Software.Name != "Aaru" ||
|
if(oldTry.Software.Name != "Aaru" ||
|
||||||
oldTry.Software.OperatingSystem != platform.ToString() ||
|
oldTry.Software.OperatingSystem != platform.ToString() ||
|
||||||
oldTry.Software.Version != Version.GetVersion())
|
oldTry.Software.Version != Version.GetInformationalVersion())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(removable &&
|
if(removable &&
|
||||||
|
|||||||
@@ -285,8 +285,9 @@ partial class Dump
|
|||||||
Modes.DecodedMode? decMode = null;
|
Modes.DecodedMode? decMode = null;
|
||||||
|
|
||||||
if(!sense && !_dev.Error)
|
if(!sense && !_dev.Error)
|
||||||
if(Modes.DecodeMode10(cmdBuf, _dev.ScsiType).HasValue)
|
{
|
||||||
decMode = Modes.DecodeMode10(cmdBuf, _dev.ScsiType);
|
if(Modes.DecodeMode10(cmdBuf, _dev.ScsiType).HasValue) decMode = Modes.DecodeMode10(cmdBuf, _dev.ScsiType);
|
||||||
|
}
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Requesting_MODE_SENSE_6);
|
UpdateStatus?.Invoke(Localization.Core.Requesting_MODE_SENSE_6);
|
||||||
|
|
||||||
@@ -314,8 +315,9 @@ partial class Dump
|
|||||||
if(sense || _dev.Error) sense = _dev.ModeSense(out cmdBuf, out senseBuf, 5, out duration);
|
if(sense || _dev.Error) sense = _dev.ModeSense(out cmdBuf, out senseBuf, 5, out duration);
|
||||||
|
|
||||||
if(!sense && !_dev.Error)
|
if(!sense && !_dev.Error)
|
||||||
if(Modes.DecodeMode6(cmdBuf, _dev.ScsiType).HasValue)
|
{
|
||||||
decMode = Modes.DecodeMode6(cmdBuf, _dev.ScsiType);
|
if(Modes.DecodeMode6(cmdBuf, _dev.ScsiType).HasValue) decMode = Modes.DecodeMode6(cmdBuf, _dev.ScsiType);
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Check partitions page
|
// TODO: Check partitions page
|
||||||
if(decMode.HasValue)
|
if(decMode.HasValue)
|
||||||
@@ -1340,7 +1342,7 @@ partial class Dump
|
|||||||
var metadata = new CommonTypes.Structs.ImageInfo
|
var metadata = new CommonTypes.Structs.ImageInfo
|
||||||
{
|
{
|
||||||
Application = "Aaru",
|
Application = "Aaru",
|
||||||
ApplicationVersion = Version.GetVersion()
|
ApplicationVersion = Version.GetInformationalVersion()
|
||||||
};
|
};
|
||||||
|
|
||||||
if(!outputTape.SetImageInfo(metadata))
|
if(!outputTape.SetImageInfo(metadata))
|
||||||
|
|||||||
@@ -1056,7 +1056,7 @@ partial class Dump
|
|||||||
var metadata = new CommonTypes.Structs.ImageInfo
|
var metadata = new CommonTypes.Structs.ImageInfo
|
||||||
{
|
{
|
||||||
Application = "Aaru",
|
Application = "Aaru",
|
||||||
ApplicationVersion = Version.GetVersion()
|
ApplicationVersion = Version.GetInformationalVersion()
|
||||||
};
|
};
|
||||||
|
|
||||||
if(!outputFormat.SetImageInfo(metadata))
|
if(!outputFormat.SetImageInfo(metadata))
|
||||||
|
|||||||
@@ -864,7 +864,7 @@ public partial class Dump
|
|||||||
var metadata = new CommonTypes.Structs.ImageInfo
|
var metadata = new CommonTypes.Structs.ImageInfo
|
||||||
{
|
{
|
||||||
Application = "Aaru",
|
Application = "Aaru",
|
||||||
ApplicationVersion = Version.GetVersion()
|
ApplicationVersion = Version.GetInformationalVersion()
|
||||||
};
|
};
|
||||||
|
|
||||||
if(!outputFormat.SetImageInfo(metadata))
|
if(!outputFormat.SetImageInfo(metadata))
|
||||||
|
|||||||
@@ -1050,9 +1050,8 @@ partial class Dump
|
|||||||
List<ulong> tmpList = [];
|
List<ulong> tmpList = [];
|
||||||
|
|
||||||
foreach(ulong ur in _resume.BadBlocks)
|
foreach(ulong ur in _resume.BadBlocks)
|
||||||
{
|
for(ulong i = ur; i < ur + blocksToRead; i++)
|
||||||
for(ulong i = ur; i < ur + blocksToRead; i++) tmpList.Add(i);
|
tmpList.Add(i);
|
||||||
}
|
|
||||||
|
|
||||||
tmpList.Sort();
|
tmpList.Sort();
|
||||||
|
|
||||||
@@ -1310,7 +1309,7 @@ partial class Dump
|
|||||||
var metadata = new CommonTypes.Structs.ImageInfo
|
var metadata = new CommonTypes.Structs.ImageInfo
|
||||||
{
|
{
|
||||||
Application = "Aaru",
|
Application = "Aaru",
|
||||||
ApplicationVersion = Version.GetVersion()
|
ApplicationVersion = Version.GetInformationalVersion()
|
||||||
};
|
};
|
||||||
|
|
||||||
if(!outputFormat.SetImageInfo(metadata))
|
if(!outputFormat.SetImageInfo(metadata))
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ public static class Statistics
|
|||||||
|
|
||||||
ctx.Versions.Add(new Version
|
ctx.Versions.Add(new Version
|
||||||
{
|
{
|
||||||
Name = CommonTypes.Interop.Version.GetVersion(),
|
Name = CommonTypes.Interop.Version.GetInformationalVersion(),
|
||||||
Synchronized = false,
|
Synchronized = false,
|
||||||
Count = 1
|
Count = 1
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ public class Remote : IDisposable
|
|||||||
var clientHello = new AaruPacketHello
|
var clientHello = new AaruPacketHello
|
||||||
{
|
{
|
||||||
application = "Aaru",
|
application = "Aaru",
|
||||||
version = Version.GetVersion(),
|
version = Version.GetInformationalVersion(),
|
||||||
maxProtocol = Consts.MAX_PROTOCOL,
|
maxProtocol = Consts.MAX_PROTOCOL,
|
||||||
sysname = DetectOS.GetPlatformName(DetectOS.GetRealPlatformID(), DetectOS.GetVersion()),
|
sysname = DetectOS.GetPlatformName(DetectOS.GetRealPlatformID(), DetectOS.GetVersion()),
|
||||||
release = DetectOS.GetVersion(),
|
release = DetectOS.GetVersion(),
|
||||||
|
|||||||
@@ -545,7 +545,7 @@ public sealed partial class ImageConvertViewModel : ViewModelBase
|
|||||||
var metadata = new ImageInfo
|
var metadata = new ImageInfo
|
||||||
{
|
{
|
||||||
Application = "Aaru",
|
Application = "Aaru",
|
||||||
ApplicationVersion = Version.GetVersion(),
|
ApplicationVersion = Version.GetInformationalVersion(),
|
||||||
Comments = CommentsText,
|
Comments = CommentsText,
|
||||||
Creator = CreatorText,
|
Creator = CreatorText,
|
||||||
DriveFirmwareRevision = DriveFirmwareRevisionText,
|
DriveFirmwareRevision = DriveFirmwareRevisionText,
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ public abstract class OpticalImageConvertIssueTest
|
|||||||
var metadata = new ImageInfo
|
var metadata = new ImageInfo
|
||||||
{
|
{
|
||||||
Application = "Aaru",
|
Application = "Aaru",
|
||||||
ApplicationVersion = Version.GetVersion(),
|
ApplicationVersion = Version.GetInformationalVersion(),
|
||||||
Comments = inputFormat.Info.Comments,
|
Comments = inputFormat.Info.Comments,
|
||||||
Creator = inputFormat.Info.Creator,
|
Creator = inputFormat.Info.Creator,
|
||||||
DriveFirmwareRevision = inputFormat.Info.DriveFirmwareRevision,
|
DriveFirmwareRevision = inputFormat.Info.DriveFirmwareRevision,
|
||||||
|
|||||||
@@ -567,7 +567,7 @@ sealed class ConvertImageCommand : Command<ConvertImageCommand.Settings>
|
|||||||
var imageInfo = new ImageInfo
|
var imageInfo = new ImageInfo
|
||||||
{
|
{
|
||||||
Application = "Aaru",
|
Application = "Aaru",
|
||||||
ApplicationVersion = Version.GetVersion(),
|
ApplicationVersion = Version.GetInformationalVersion(),
|
||||||
Comments = settings.Comments ?? inputFormat.Info.Comments,
|
Comments = settings.Comments ?? inputFormat.Info.Comments,
|
||||||
Creator = settings.Creator ?? inputFormat.Info.Creator,
|
Creator = settings.Creator ?? inputFormat.Info.Creator,
|
||||||
DriveFirmwareRevision = settings.DriveFirmwareRevision ?? inputFormat.Info.DriveFirmwareRevision,
|
DriveFirmwareRevision = settings.DriveFirmwareRevision ?? inputFormat.Info.DriveFirmwareRevision,
|
||||||
|
|||||||
Reference in New Issue
Block a user