mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Return asset from pending restart check
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.ComponentModel;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
@@ -27,13 +28,18 @@ namespace Velopack
|
|||||||
/// <inheritdoc cref="IVelopackLocator.IsPortable" />
|
/// <inheritdoc cref="IVelopackLocator.IsPortable" />
|
||||||
public virtual bool IsPortable => Locator.IsPortable;
|
public virtual bool IsPortable => Locator.IsPortable;
|
||||||
|
|
||||||
/// <summary> True if there is a local update prepared that requires a call to <see cref="ApplyUpdatesAndRestart(VelopackAsset, string[])"/> to be applied. </summary>
|
/// <summary> OBSOLETE: Use <see cref="UpdatePendingRestart"/> instead. </summary>
|
||||||
public virtual bool IsUpdatePendingRestart {
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
|
[Obsolete("Use UpdatePendingRestart instead.")]
|
||||||
|
public virtual bool IsUpdatePendingRestart => UpdatePendingRestart != null;
|
||||||
|
|
||||||
|
/// <summary> Returns a VelopackAsset if there is a local update prepared that requires a call to <see cref="ApplyUpdatesAndRestart(VelopackAsset, string[])"/> to be applied. </summary>
|
||||||
|
public virtual VelopackAsset? UpdatePendingRestart {
|
||||||
get {
|
get {
|
||||||
var latestLocal = Locator.GetLatestLocalFullPackage();
|
var latestLocal = Locator.GetLatestLocalFullPackage();
|
||||||
if (latestLocal != null && CurrentVersion != null && latestLocal.Version > CurrentVersion)
|
if (latestLocal != null && CurrentVersion != null && latestLocal.Version > CurrentVersion)
|
||||||
return true;
|
return latestLocal;
|
||||||
return false;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user