Dynamic assembly version

master v0.1.5
Inga 🏳‍🌈 4 years ago
parent d77c78f3ca
commit 52c113af8f
  1. 10
      RadeonResetBugFixService/EnvironmentHelper.cs
  2. 2
      RadeonResetBugFixService/MainHandler.cs
  3. 2
      RadeonResetBugFixService/Program.cs
  4. 3
      RadeonResetBugFixService/Properties/AssemblyInfo.cs
  5. 40
      RadeonResetBugFixService/RadeonResetBugFixService.csproj

@ -1,6 +1,7 @@
namespace RadeonResetBugFixService namespace RadeonResetBugFixService
{ {
using System; using System;
using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Security.Principal; using System.Security.Principal;
@ -35,5 +36,14 @@
public static bool IsWindows8OrNewer() => IsWindows() && Environment.OSVersion.Version >= Windows8Version; public static bool IsWindows8OrNewer() => IsWindows() && Environment.OSVersion.Version >= Windows8Version;
public static bool IsVistaOrNewer() => IsWindows() && Environment.OSVersion.Version >= VistaVersion; public static bool IsVistaOrNewer() => IsWindows() && Environment.OSVersion.Version >= VistaVersion;
// Code taken from https://stackoverflow.com/a/826850
public static DateTime GetServiceBuildDate()
{
var version = Assembly.GetExecutingAssembly().GetName().Version;
return new DateTime(2000, 1, 1, 0, 0, 0, DateTimeKind.Unspecified)
.AddDays(version.Build)
.AddSeconds(version.Revision * 2);
}
} }
} }

@ -30,6 +30,8 @@
{ {
using (ILogger logger = new TaskLoggerWrapper(fileLogger, name)) using (ILogger logger = new TaskLoggerWrapper(fileLogger, name))
{ {
logger.Log($"Build date: {EnvironmentHelper.GetServiceBuildDate()}");
try try
{ {
lock (this.Mutex) lock (this.Mutex)

@ -52,6 +52,8 @@
private static void MainConsole(string[] args) private static void MainConsole(string[] args)
{ {
Console.WriteLine($"Build date: {EnvironmentHelper.GetServiceBuildDate()}");
var command = args.Length == 1 ? args[0] : string.Empty; var command = args.Length == 1 ? args[0] : string.Empty;
if (command.Equals("install", StringComparison.OrdinalIgnoreCase)) { if (command.Equals("install", StringComparison.OrdinalIgnoreCase)) {

@ -32,5 +32,4 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("1.0.0.0")]

@ -16,7 +16,7 @@
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic> <Deterministic>false</Deterministic>
<NuGetPackageImportStamp> <NuGetPackageImportStamp>
</NuGetPackageImportStamp> </NuGetPackageImportStamp>
</PropertyGroup> </PropertyGroup>
@ -51,63 +51,63 @@
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration.Install" /> <Reference Include="System.Configuration.Install" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Management" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Management" />
<Reference Include="System.Net.Http" /> <Reference Include="System.Net.Http" />
<Reference Include="System.ServiceProcess" /> <Reference Include="System.ServiceProcess" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Devices\DeviceHelper.cs" />
<Compile Include="EnvironmentHelper.cs" /> <Compile Include="EnvironmentHelper.cs" />
<Compile Include="Constants.cs" /> <Compile Include="Constants.cs" />
<Compile Include="Contracts\DeviceInfo.cs" /> <Compile Include="Contracts\DeviceInfo.cs" />
<Compile Include="Contracts\DevicesStatus.cs" /> <Compile Include="Contracts\DevicesStatus.cs" />
<Compile Include="Contracts\ILogger.cs" />
<Compile Include="Devices\KnownDevices.cs" /> <Compile Include="Devices\KnownDevices.cs" />
<Compile Include="Logging\FileLogger.cs" /> <Compile Include="Logging\FileLogger.cs" />
<Compile Include="Contracts\ILogger.cs" /> <Compile Include="Logging\TaskLoggerWrapper.cs" />
<Compile Include="MainHandler.cs" /> <Compile Include="MainHandler.cs" />
<Compile Include="Program.cs" />
<Compile Include="ProjectInstaller.cs"> <Compile Include="ProjectInstaller.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
</Compile> </Compile>
<Compile Include="ProjectInstaller.Designer.cs"> <Compile Include="ProjectInstaller.Designer.cs">
<DependentUpon>ProjectInstaller.cs</DependentUpon> <DependentUpon>ProjectInstaller.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RadeonResetBugFixService.cs"> <Compile Include="RadeonResetBugFixService.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
</Compile> </Compile>
<Compile Include="RadeonResetBugFixService.Designer.cs"> <Compile Include="RadeonResetBugFixService.Designer.cs">
<DependentUpon>RadeonResetBugFixService.cs</DependentUpon> <DependentUpon>RadeonResetBugFixService.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Logging\TaskLoggerWrapper.cs" />
<Compile Include="RegistryHelper.cs" /> <Compile Include="RegistryHelper.cs" />
<Compile Include="Tasks\ITask.cs" />
<Compile Include="Tasks\BasicTasks\AbstractDevicesTask.cs" />
<Compile Include="Tasks\BasicTasks\AbstractServiceTask.cs" />
<Compile Include="Tasks\BasicTasks\DisableAmdVideoTask.cs" />
<Compile Include="Tasks\BasicTasks\DisableBasicDisplayStartupTask.cs" /> <Compile Include="Tasks\BasicTasks\DisableBasicDisplayStartupTask.cs" />
<Compile Include="Tasks\BasicTasks\DisableVirtualVideoTask.cs" />
<Compile Include="Tasks\BasicTasks\EnableAmdVideoTask.cs" />
<Compile Include="Tasks\BasicTasks\EnableBasicDisplayStartupTask.cs" /> <Compile Include="Tasks\BasicTasks\EnableBasicDisplayStartupTask.cs" />
<Compile Include="Tasks\BasicTasks\EnableVirtualVideoTask.cs" />
<Compile Include="Tasks\BasicTasks\FixMonitorTask.cs" /> <Compile Include="Tasks\BasicTasks\FixMonitorTask.cs" />
<Compile Include="Tasks\BasicTasks\LastResortDevicesRestoreTask.cs" /> <Compile Include="Tasks\BasicTasks\LastResortDevicesRestoreTask.cs" />
<Compile Include="Tasks\BasicTasks\ListDevicesTask.cs" /> <Compile Include="Tasks\BasicTasks\ListDevicesTask.cs" />
<Compile Include="Tasks\BasicTasks\SleepTask.cs" /> <Compile Include="Tasks\BasicTasks\SleepTask.cs" />
<Compile Include="Tasks\BasicTasks\StopAudioServiceTask.cs" />
<Compile Include="Tasks\ComplexTasks\AbstractSequentialTask.cs" /> <Compile Include="Tasks\ComplexTasks\AbstractSequentialTask.cs" />
<Compile Include="Tasks\ComplexTasks\DiagnoseTask.cs" /> <Compile Include="Tasks\ComplexTasks\DiagnoseTask.cs" />
<Compile Include="Tasks\ComplexTasks\ShutdownTask.cs" /> <Compile Include="Tasks\ComplexTasks\ShutdownTask.cs" />
<Compile Include="Tasks\ComplexTasks\StartupTask.cs" /> <Compile Include="Tasks\ComplexTasks\StartupTask.cs" />
<Compile Include="ThirdParty\MonitorChanger.cs" />
<Compile Include="ThirdParty\ServiceHelpers.cs" />
<Compile Include="TasksProcessor.cs" /> <Compile Include="TasksProcessor.cs" />
<Compile Include="Tasks\BasicTasks\AbstractDevicesTask.cs" />
<Compile Include="Tasks\BasicTasks\AbstractServiceTask.cs" />
<Compile Include="Tasks\BasicTasks\DisableAmdVideoTask.cs" />
<Compile Include="Tasks\BasicTasks\DisableVirtualVideoTask.cs" />
<Compile Include="Tasks\BasicTasks\EnableAmdVideoTask.cs" />
<Compile Include="Tasks\BasicTasks\EnableVirtualVideoTask.cs" />
<Compile Include="Tasks\ITask.cs" />
<Compile Include="Tasks\BasicTasks\StopAudioServiceTask.cs" />
<Compile Include="ThirdParty\DisableDevice.cs" /> <Compile Include="ThirdParty\DisableDevice.cs" />
<Compile Include="Devices\DeviceHelper.cs" /> <Compile Include="ThirdParty\MonitorChanger.cs" />
<Compile Include="ThirdParty\ServiceHelpers.cs" />
<Compile Include="ThirdParty\ServicePreshutdownHelpers.cs" /> <Compile Include="ThirdParty\ServicePreshutdownHelpers.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

Loading…
Cancel
Save