mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Don't run the app if an update did nothing and we're not initial installing. Fixes #60
This commit is contained in:
@@ -26,7 +26,7 @@ namespace Squirrel
|
||||
this.rootAppDirectory = rootAppDirectory;
|
||||
}
|
||||
|
||||
public async Task<string> ApplyReleases(UpdateInfo updateInfo, bool silentInstall, Action<int> progress = null)
|
||||
public async Task<string> ApplyReleases(UpdateInfo updateInfo, bool silentInstall, bool attemptingFullInstall, Action<int> progress = null)
|
||||
{
|
||||
progress = progress ?? (_ => { });
|
||||
|
||||
@@ -34,8 +34,11 @@ namespace Squirrel
|
||||
progress(10);
|
||||
|
||||
if (release == null) {
|
||||
this.Log().Info("No release to install, running the app");
|
||||
await invokePostInstall(updateInfo.CurrentlyInstalledVersion.Version, true, true);
|
||||
if (attemptingFullInstall) {
|
||||
this.Log().Info("No release to install, running the app");
|
||||
await invokePostInstall(updateInfo.CurrentlyInstalledVersion.Version, true, true);
|
||||
}
|
||||
|
||||
return getDirectoryForRelease(updateInfo.CurrentlyInstalledVersion.Version).FullName;
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace Squirrel
|
||||
var applyReleases = new ApplyReleasesImpl(rootAppDirectory);
|
||||
await acquireUpdateLock();
|
||||
|
||||
return await applyReleases.ApplyReleases(updateInfo, false, progress);
|
||||
return await applyReleases.ApplyReleases(updateInfo, false, false, progress);
|
||||
}
|
||||
|
||||
public async Task FullInstall(bool silentInstall = false)
|
||||
@@ -78,7 +78,7 @@ namespace Squirrel
|
||||
var applyReleases = new ApplyReleasesImpl(rootAppDirectory);
|
||||
await acquireUpdateLock();
|
||||
|
||||
await applyReleases.ApplyReleases(updateInfo, silentInstall);
|
||||
await applyReleases.ApplyReleases(updateInfo, silentInstall, true);
|
||||
}
|
||||
|
||||
public async Task FullUninstall()
|
||||
|
||||
@@ -205,7 +205,7 @@ namespace Squirrel.Tests
|
||||
|
||||
var progress = new List<int>();
|
||||
|
||||
await fixture.ApplyReleases(updateInfo, false, progress.Add);
|
||||
await fixture.ApplyReleases(updateInfo, false, false, progress.Add);
|
||||
this.Log().Info("Progress: [{0}]", String.Join(",", progress));
|
||||
|
||||
progress
|
||||
@@ -254,7 +254,7 @@ namespace Squirrel.Tests
|
||||
updateInfo.ReleasesToApply.Contains(latestFullEntry).ShouldBeTrue();
|
||||
|
||||
var progress = new List<int>();
|
||||
await fixture.ApplyReleases(updateInfo, false, progress.Add);
|
||||
await fixture.ApplyReleases(updateInfo, false, false, progress.Add);
|
||||
this.Log().Info("Progress: [{0}]", String.Join(",", progress));
|
||||
|
||||
progress
|
||||
@@ -303,7 +303,7 @@ namespace Squirrel.Tests
|
||||
updateInfo.ReleasesToApply.Contains(latestFullEntry).ShouldBeTrue();
|
||||
|
||||
var progress = new List<int>();
|
||||
await fixture.ApplyReleases(updateInfo, false, progress.Add);
|
||||
await fixture.ApplyReleases(updateInfo, false, false, progress.Add);
|
||||
this.Log().Info("Progress: [{0}]", String.Join(",", progress));
|
||||
|
||||
progress
|
||||
@@ -356,7 +356,7 @@ namespace Squirrel.Tests
|
||||
|
||||
var progress = new List<int>();
|
||||
|
||||
await fixture.ApplyReleases(updateInfo, false, progress.Add);
|
||||
await fixture.ApplyReleases(updateInfo, false, false, progress.Add);
|
||||
this.Log().Info("Progress: [{0}]", String.Join(",", progress));
|
||||
|
||||
progress
|
||||
|
||||
Reference in New Issue
Block a user