Skip to content

Commit

Permalink
Skipping update when checked
Browse files Browse the repository at this point in the history
  • Loading branch information
marona42 committed Mar 2, 2021
1 parent c62a38e commit d1eae1c
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions SCTools/SCTool_Redesigned/Pages/updatePatcher.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ public updatePatcher()
{
InitializeComponent();
//Progressbar_demo();
if(!ChkUpdated())
if (!ChkUpdated())
TryUpdate();
else
CleanUpdate();
}
private DispatcherTimer timer1;
private void Progressbar_demo()
Expand All @@ -55,15 +57,12 @@ private void timer1_Tick(object sender, EventArgs e)
}
}

private bool ChkUpdated() //checks if this program launched by updater
private bool ChkUpdated() => _updater.ChkUpdateScript(); //checks if this program launched by updater

private void CleanUpdate()
{
if (_updater.ChkUpdateScript())
{
_updater.RemoveUpdateScript();
return true;
}
else
return false;
_updater.RemoveUpdateScript();
Windows.MainWindow.UI.Phase++;
}
private async void TryUpdate()
{
Expand Down Expand Up @@ -99,7 +98,7 @@ private async void TryUpdate()
}
finally
{
((Windows.MainWindow)Application.Current.MainWindow).Phase++;
Windows.MainWindow.UI.Phase++;
}
}

Expand Down

0 comments on commit d1eae1c

Please sign in to comment.