Minor fix for update check when offline

Related to issue #568
This commit is contained in:
Travis Nickles 2019-02-07 11:52:28 -06:00
parent ce87d8c212
commit 255fc8f8fc

View File

@ -786,7 +786,7 @@ namespace DS4Windows
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location); FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
string version = fvi.FileVersion; string version = fvi.FileVersion;
string newversion = File.ReadAllText(appdatapath + "\\version.txt").Trim(); string newversion = File.ReadAllText(appdatapath + "\\version.txt").Trim();
if (version.Replace(',', '.').CompareTo(newversion) != 0) if (!string.IsNullOrWhiteSpace(newversion) && version.Replace(',', '.').CompareTo(newversion) != 0)
{ {
if ((DialogResult)this.Invoke(new Func<DialogResult>(() => { if ((DialogResult)this.Invoke(new Func<DialogResult>(() => {
return MessageBox.Show(Properties.Resources.DownloadVersion.Replace("*number*", newversion), return MessageBox.Show(Properties.Resources.DownloadVersion.Replace("*number*", newversion),
@ -2097,7 +2097,7 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location); FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
string version2 = fvi.FileVersion; string version2 = fvi.FileVersion;
string newversion2 = File.ReadAllText(appdatapath + "\\version.txt").Trim(); string newversion2 = File.ReadAllText(appdatapath + "\\version.txt").Trim();
if (version2.Replace(',', '.').CompareTo(newversion2) != 0) if (!string.IsNullOrWhiteSpace(newversion2) && version2.Replace(',', '.').CompareTo(newversion2) != 0)
{ {
if ((DialogResult)this.Invoke(new Func<DialogResult>(() => if ((DialogResult)this.Invoke(new Func<DialogResult>(() =>
{ {