From 139013c35f49e40bc605b799f2a61354fc930bf5 Mon Sep 17 00:00:00 2001 From: Caelan Date: Fri, 20 Sep 2024 22:57:28 -0600 Subject: [PATCH] Return asset from pending restart check --- src/lib-csharp/UpdateManager.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/lib-csharp/UpdateManager.cs b/src/lib-csharp/UpdateManager.cs index b24d5d17..769ed0b6 100644 --- a/src/lib-csharp/UpdateManager.cs +++ b/src/lib-csharp/UpdateManager.cs @@ -1,4 +1,5 @@ using System; +using System.ComponentModel; using System.IO; using System.Linq; using System.Threading; @@ -27,13 +28,18 @@ namespace Velopack /// public virtual bool IsPortable => Locator.IsPortable; - /// True if there is a local update prepared that requires a call to to be applied. - public virtual bool IsUpdatePendingRestart { + /// OBSOLETE: Use instead. + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Use UpdatePendingRestart instead.")] + public virtual bool IsUpdatePendingRestart => UpdatePendingRestart != null; + + /// Returns a VelopackAsset if there is a local update prepared that requires a call to to be applied. + public virtual VelopackAsset? UpdatePendingRestart { get { var latestLocal = Locator.GetLatestLocalFullPackage(); if (latestLocal != null && CurrentVersion != null && latestLocal.Version > CurrentVersion) - return true; - return false; + return latestLocal; + return null; } }