-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add version to settings in front end app, rename 'ComputerDrivesComma…
…nd' to 'GetComputerDrivesCommand' fixes GH-34
- Loading branch information
Showing
34 changed files
with
433 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
Spacearr.Common/Command/Implementations/Commands/GetWorkerServiceVersionCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using Newtonsoft.Json; | ||
using Spacearr.Common.Command.Interfaces; | ||
using Spacearr.Common.Models; | ||
using Spacearr.Common.Services.Interfaces; | ||
using System.IO; | ||
using System.Reflection; | ||
using System.Threading.Tasks; | ||
|
||
namespace Spacearr.Common.Command.Implementations.Commands | ||
{ | ||
public class GetWorkerServiceVersionCommand : ICommand | ||
{ | ||
private const string AppName = "Spacearr.WorkerService.Windows"; | ||
private readonly IFileService _fileService; | ||
|
||
public GetWorkerServiceVersionCommand(IFileService fileService) | ||
{ | ||
_fileService = fileService; | ||
} | ||
|
||
/// <summary> | ||
/// Returns the Worker Service version. | ||
/// </summary> | ||
/// <returns>Returns a WorkerServiceVersionModel</returns> | ||
public async Task<string> Execute() | ||
{ | ||
var parentDirectory = Directory.GetParent(_fileService.GetUpdateAppStorageFolderPath()); | ||
var currentAppPath = Path.GetFullPath(parentDirectory?.FullName ?? string.Empty); | ||
var currentApp = Path.Combine(currentAppPath, $"{AppName}.dll"); | ||
var assemblyName = AssemblyName.GetAssemblyName(currentApp); | ||
var workerServiceVersion = new WorkerServiceVersionModel { Version = assemblyName.Version}; | ||
|
||
return await Task.FromResult(JsonConvert.SerializeObject(workerServiceVersion)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ | |
public enum UpdateType | ||
{ | ||
Android, | ||
WindowsService, | ||
WorkerService, | ||
Uwp | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System; | ||
|
||
namespace Spacearr.Common.Models | ||
{ | ||
public class WorkerServiceVersionModel | ||
{ | ||
public Version Version { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.