Skip to content

Commit

Permalink
minor change to self-udpate checker, a folder naming change
Browse files Browse the repository at this point in the history
  • Loading branch information
fmmmlee committed Aug 31, 2019
1 parent 5c96c35 commit bd99a2c
Show file tree
Hide file tree
Showing 32 changed files with 21 additions and 7 deletions.
12 changes: 6 additions & 6 deletions application/GW2 Addon Manager.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29201.188
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GW2 Addon Manager", "GW2 Addon Updater\GW2 Addon Manager.csproj", "{DC700BA9-FA6A-4991-BE06-5FBD43FA8EEA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UOAOM Updater", "UOAOM Updater\UOAOM Updater.csproj", "{2A0B5916-4069-43F0-8067-8C4203539CB1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GW2 Addon Manager", "GW2 Addon Manager\GW2 Addon Manager.csproj", "{DC700BA9-FA6A-4991-BE06-5FBD43FA8EEA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DC700BA9-FA6A-4991-BE06-5FBD43FA8EEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DC700BA9-FA6A-4991-BE06-5FBD43FA8EEA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DC700BA9-FA6A-4991-BE06-5FBD43FA8EEA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DC700BA9-FA6A-4991-BE06-5FBD43FA8EEA}.Release|Any CPU.Build.0 = Release|Any CPU
{2A0B5916-4069-43F0-8067-8C4203539CB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2A0B5916-4069-43F0-8067-8C4203539CB1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2A0B5916-4069-43F0-8067-8C4203539CB1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2A0B5916-4069-43F0-8067-8C4203539CB1}.Release|Any CPU.Build.0 = Release|Any CPU
{DC700BA9-FA6A-4991-BE06-5FBD43FA8EEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DC700BA9-FA6A-4991-BE06-5FBD43FA8EEA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DC700BA9-FA6A-4991-BE06-5FBD43FA8EEA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DC700BA9-FA6A-4991-BE06-5FBD43FA8EEA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ class SelfUpdate

OpeningViewModel viewModel;

/// <summary>
/// Sets the viewmodel and starts the download of the latest release.
/// </summary>
/// <param name="appViewModel"></param>
public SelfUpdate(OpeningViewModel appViewModel)
{
viewModel = appViewModel;
Expand All @@ -26,6 +30,10 @@ public SelfUpdate(OpeningViewModel appViewModel)
Task.Run(() => downloadLatestRelease());
}

/// <summary>
/// Downloads the latest application release.
/// </summary>
/// <returns></returns>
public async Task downloadLatestRelease()
{
//perhaps change this to check if downloaded update is latest or not
Expand All @@ -48,15 +56,21 @@ public async Task downloadLatestRelease()
void selfUpdate_DownloadCompleted(object sender, AsyncCompletedEventArgs e)
{
viewModel.UpdateAvailable = "Download complete!";
Application.Current.Properties["update_self"] = true;
}

void selfUpdate_DownloadProgress(object sender, DownloadProgressChangedEventArgs e)
{
viewModel.UpdateDownloadProgress = e.ProgressPercentage;
}

/// <summary>
/// Starts the self-updater if an application update has been downloaded.
/// </summary>
public static void startUpdater()
{
Process.Start("UOAOM Updater.exe");
if(Application.Current.Properties["update_self"] != null && (bool)Application.Current.Properties["update_self"])
Process.Start("UOAOM Updater.exe");
}
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit bd99a2c

Please sign in to comment.