mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2025-01-25 22:41:16 +01:00
Move version check to a different thread
This commit is contained in:
parent
e18eead25c
commit
97110bad5a
@ -333,7 +333,7 @@ namespace DS4Windows
|
|||||||
if (checkwhen > 0 && DateTime.Now >= LastChecked + TimeSpan.FromHours(checkwhen))
|
if (checkwhen > 0 && DateTime.Now >= LastChecked + TimeSpan.FromHours(checkwhen))
|
||||||
{
|
{
|
||||||
wc.DownloadFileAsync(url, appdatapath + "\\version.txt");
|
wc.DownloadFileAsync(url, appdatapath + "\\version.txt");
|
||||||
wc.DownloadFileCompleted += Check_Version;
|
wc.DownloadFileCompleted += (sender, e) => { TaskRunner.Run(() => Check_Version(sender, e)); };
|
||||||
LastChecked = DateTime.Now;
|
LastChecked = DateTime.Now;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -690,8 +690,9 @@ namespace DS4Windows
|
|||||||
string newversion = File.ReadAllText(appdatapath + "\\version.txt").Trim();
|
string newversion = File.ReadAllText(appdatapath + "\\version.txt").Trim();
|
||||||
if (version.Replace(',', '.').CompareTo(newversion) == -1)
|
if (version.Replace(',', '.').CompareTo(newversion) == -1)
|
||||||
{
|
{
|
||||||
if (MessageBox.Show(Properties.Resources.DownloadVersion.Replace("*number*", newversion),
|
if ((DialogResult)this.Invoke(new Func<DialogResult>(() => {
|
||||||
Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
|
return MessageBox.Show(Properties.Resources.DownloadVersion.Replace("*number*", newversion),
|
||||||
|
Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question); })) == DialogResult.Yes)
|
||||||
{
|
{
|
||||||
if (!File.Exists(exepath + "\\DS4Updater.exe") || (File.Exists(exepath + "\\DS4Updater.exe")
|
if (!File.Exists(exepath + "\\DS4Updater.exe") || (File.Exists(exepath + "\\DS4Updater.exe")
|
||||||
&& (FileVersionInfo.GetVersionInfo(exepath + "\\DS4Updater.exe").FileVersion.CompareTo("1.1.0.0") == -1)))
|
&& (FileVersionInfo.GetVersionInfo(exepath + "\\DS4Updater.exe").FileVersion.CompareTo("1.1.0.0") == -1)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user