Skip to content

Commit ab1a003

Browse files
committed
Fixed update check
1 parent 7b33afb commit ab1a003

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

OpenXR-Runtime-Switcher/MainForm.cs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ private void checkForUpdateToolStripMenuItem_Click(object sender, EventArgs e)
273273
{
274274
CheckForUpdate(true);
275275
}
276-
public async void CheckForUpdate(bool showError)
276+
public async void CheckForUpdate(bool showInfoMessages)
277277
{
278278
try
279279
{
@@ -298,20 +298,30 @@ public async void CheckForUpdate(bool showError)
298298

299299
bool needUpdate = ver.CompareTo(appVer) > 0;
300300

301-
if (MessageBox.Show($"There is an Update available!\n\n\nNew Version: {ver}\n\nYour Version: {appVer}\n\n\nDo you want to visit the Download Page?", "Update available!", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
301+
if (needUpdate)
302302
{
303-
Process.Start("https://github.com/WaGi-Coding/OpenXR-Runtime-Switcher/releases/latest");
303+
if (MessageBox.Show($"There is an Update available!\n\n\nNew Version: {ver}\n\nYour Version: {appVer}\n\n\nDo you want to visit the Download Page?", "Update available!", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
304+
{
305+
Process.Start("https://github.com/WaGi-Coding/OpenXR-Runtime-Switcher/releases/latest");
306+
}
307+
else
308+
{
309+
return;
310+
}
304311
}
305312
else
306313
{
307-
return;
314+
if (showInfoMessages)
315+
{
316+
MessageBox.Show("You are using the newest Version!\n\nNo Update needed...");
317+
}
308318
}
309319
}
310320
}
311321
}
312322
catch (Exception)
313323
{
314-
if (showError)
324+
if (showInfoMessages)
315325
{
316326
MessageBox.Show("Error when checking for Update!");
317327
}

0 commit comments

Comments
 (0)