Skip to content

Commit

Permalink
fix(AutoUpdate): Show a message box when can't validate signature of …
Browse files Browse the repository at this point in the history
…file.
  • Loading branch information
Belphemur committed Sep 4, 2021
1 parent 7c933d8 commit 2406d6c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions SoundSwitch/Framework/Updater/AutoUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using System.Windows.Forms;
using Serilog;
using SoundSwitch.Framework.Updater.Installer;
using SoundSwitch.Localization;

namespace SoundSwitch.Framework.Updater
{
Expand Down Expand Up @@ -51,6 +52,10 @@ public void Update(Release release, bool closeApp)
if (!SignatureChecker.IsValid(file.FilePath))
{
Log.Error("The file has the wrong signature. Update cancelled.");
_context.Send(state =>
{
MessageBox.Show(string.Format(UpdateDownloadStrings.wrongSignature, "https://soundswitch.aaflalo.me"), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}, null);
return;
}

Expand Down
9 changes: 9 additions & 0 deletions SoundSwitch/Localization/UpdateDownloadStrings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions SoundSwitch/Localization/UpdateDownloadStrings.fr.resx
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,7 @@
<data name="remindMe" xml:space="preserve">
<value>Plus tard</value>
</data>
<data name="wrongSignature" xml:space="preserve">
<value>Il y a un problème avec la dernière MàJ de SoundSwitch. Il va falloir la télécharger manuellement à {0}.</value>
</data>
</root>
3 changes: 3 additions & 0 deletions SoundSwitch/Localization/UpdateDownloadStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,7 @@
<data name="remindMe" xml:space="preserve">
<value>Later</value>
</data>
<data name="wrongSignature" xml:space="preserve">
<value>There is a problem with the last SoundSwitch update. You'll need to manually download the new version at {0}</value>
</data>
</root>

0 comments on commit 2406d6c

Please sign in to comment.