Add an explicit FullInstall method

This doesn't do everything we want yet like run the application, but it's a
start.
This commit is contained in:
Paul Betts
2014-08-08 15:24:59 +02:00
parent 98da7e789e
commit a9e5cf75d1
3 changed files with 14 additions and 3 deletions

View File

@@ -44,6 +44,12 @@ namespace Squirrel
/// will return values from 0-100 and Complete, or Throw</param>
Task ApplyReleases(UpdateInfo updateInfo, Action<int> progress = null);
/// <summary>
/// Completely Installs a targeted app
/// </summary>
/// <returns>Completion</returns>
Task FullInstall();
/// <summary>
/// Completely uninstalls the targeted app
/// </summary>

View File

@@ -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);

View File

@@ -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");