|
|
@ -7,13 +7,16 @@ namespace DiscordChatExporter.Core.Services
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public class UpdateService : IUpdateService
|
|
|
|
public class UpdateService : IUpdateService
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
private readonly ISettingsService _settingsService;
|
|
|
|
private readonly UpdateManager _updateManager;
|
|
|
|
private readonly UpdateManager _updateManager;
|
|
|
|
|
|
|
|
|
|
|
|
private Version _lastVersion;
|
|
|
|
private Version _lastVersion;
|
|
|
|
private bool _applied;
|
|
|
|
private bool _applied;
|
|
|
|
|
|
|
|
|
|
|
|
public UpdateService()
|
|
|
|
public UpdateService(ISettingsService settingsService)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
_settingsService = settingsService;
|
|
|
|
|
|
|
|
|
|
|
|
_updateManager = new UpdateManager(
|
|
|
|
_updateManager = new UpdateManager(
|
|
|
|
new GithubPackageResolver("Tyrrrz", "DiscordChatExporter", "DiscordChatExporter.zip"),
|
|
|
|
new GithubPackageResolver("Tyrrrz", "DiscordChatExporter", "DiscordChatExporter.zip"),
|
|
|
|
new ZipPackageExtractor());
|
|
|
|
new ZipPackageExtractor());
|
|
|
@ -26,6 +29,10 @@ namespace DiscordChatExporter.Core.Services
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Don't update if user disabled it
|
|
|
|
|
|
|
|
if (!_settingsService.IsAutoUpdateEnabled)
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Remove some junk left over from last update
|
|
|
|
// Remove some junk left over from last update
|
|
|
|