mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
WIP Restart
This commit is contained in:
@@ -345,6 +345,7 @@ namespace Squirrel
|
||||
/// <param name="path">The path of the file system entity to delete.</param>
|
||||
/// <param name="throwOnFailure">Whether this function should throw if the delete fails.</param>
|
||||
/// <param name="renameFirst">Try to rename this object first before deleting. Can help prevent partial delete of folders.</param>
|
||||
/// <param name="logger">Logger for diagnostic messages.</param>
|
||||
/// <returns>True if the file system object was deleted, false otherwise.</returns>
|
||||
public static bool DeleteFileOrDirectoryHard(string path, bool throwOnFailure = true, bool renameFirst = false, ILogger logger = null)
|
||||
{
|
||||
|
||||
@@ -21,6 +21,15 @@ namespace Squirrel
|
||||
|
||||
public virtual bool IsInstalled => Locator.CurrentlyInstalledVersion != null;
|
||||
|
||||
public virtual bool IsPendingRestart {
|
||||
get {
|
||||
var latestLocal = Locator.GetLatestLocalPackage();
|
||||
if (latestLocal != null && latestLocal.Version > CurrentVersion)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual SemanticVersion CurrentVersion => Locator.CurrentlyInstalledVersion;
|
||||
|
||||
protected IUpdateSource Source { get; }
|
||||
@@ -189,11 +198,22 @@ namespace Squirrel
|
||||
File.Delete(completeFile);
|
||||
File.Move(incompleteFile, completeFile);
|
||||
Log.Info("Full release download complete. Package moved to: " + completeFile);
|
||||
progress(100);
|
||||
} finally {
|
||||
CleanIncompleteAndDeltaPackages();
|
||||
}
|
||||
}
|
||||
|
||||
public void ExitAndApplyUpdates()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void WaitForExitAndApplyUpdates(bool restart, string[] arguments = null)
|
||||
{
|
||||
var updateArgs = new string[]{ "--update" };
|
||||
}
|
||||
|
||||
protected virtual async Task DownloadAndApplyDeltaUpdates(string extractedBasePackage, UpdateInfo updates, Action<int> progress)
|
||||
{
|
||||
var packagesDirectory = Locator.PackagesDir;
|
||||
|
||||
Reference in New Issue
Block a user