From a9e5cf75d1d4bdee3c4469f815ecc75fe0dc0510 Mon Sep 17 00:00:00 2001 From: Paul Betts Date: Fri, 8 Aug 2014 15:24:59 +0200 Subject: [PATCH] Add an explicit FullInstall method This doesn't do everything we want yet like run the application, but it's a start. --- src/Squirrel/IUpdateManager.cs | 6 ++++++ src/Squirrel/UpdateManager.cs | 7 +++++++ test/UpdateManagerTests.cs | 4 +--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/Squirrel/IUpdateManager.cs b/src/Squirrel/IUpdateManager.cs index 96bd7509..9f580cee 100644 --- a/src/Squirrel/IUpdateManager.cs +++ b/src/Squirrel/IUpdateManager.cs @@ -44,6 +44,12 @@ namespace Squirrel /// will return values from 0-100 and Complete, or Throw Task ApplyReleases(UpdateInfo updateInfo, Action progress = null); + /// + /// Completely Installs a targeted app + /// + /// Completion + Task FullInstall(); + /// /// Completely uninstalls the targeted app /// diff --git a/src/Squirrel/UpdateManager.cs b/src/Squirrel/UpdateManager.cs index f01f219f..a83e3aa2 100644 --- a/src/Squirrel/UpdateManager.cs +++ b/src/Squirrel/UpdateManager.cs @@ -65,6 +65,13 @@ namespace Squirrel await applyReleases.ApplyReleases(updateInfo, progress); } + public async Task FullInstall() + { + var updateInfo = await CheckForUpdate(); + await DownloadReleases(updateInfo.ReleasesToApply); + await ApplyReleases(updateInfo); + } + public async Task FullUninstall() { var applyReleases = new ApplyReleasesImpl(rootAppDirectory); diff --git a/test/UpdateManagerTests.cs b/test/UpdateManagerTests.cs index b2832679..f85dc88e 100644 --- a/test/UpdateManagerTests.cs +++ b/test/UpdateManagerTests.cs @@ -53,9 +53,7 @@ namespace Squirrel.Tests }.ForEach(x => File.Copy(IntegrationTestHelper.GetPath("fixtures", x), Path.Combine(remotePackageDir.FullName, x))); using (var fixture = new UpdateManager(remotePackageDir.FullName, "theApp", FrameworkVersion.Net45, tempDir)) { - var updateInfo = await fixture.CheckForUpdate(); - await fixture.DownloadReleases(updateInfo.ReleasesToApply); - await fixture.ApplyReleases(updateInfo); + await fixture.FullInstall(); } var releasePath = Path.Combine(localAppDir, "packages", "RELEASES");