TASK 10: Polar billing + Velopack auto-updates (steps 1-7)

This commit is contained in:
2026-08-21 08:18:52 -07:00
parent 2f135687cd
commit 8951141c65
10 changed files with 417 additions and 78 deletions
+16 -3
View File
@@ -1,5 +1,6 @@
using System.Windows;
using System.Windows.Threading;
using Velopack;
using ytLive.Helpers;
namespace ytLive;
@@ -16,9 +17,6 @@ public partial class App : Application
protected override void OnStartup(StartupEventArgs e)
{
// The app is a WinExe (no visible console) and is often debugged from
// WSL where it can't even run, so startup checkpoints and any unhandled
// exception are written to %APPDATA%\ytLlive\startup.log via AppLog.
AppDomain.CurrentDomain.UnhandledException += (_, args) =>
AppLog.Write(args.ExceptionObject is Exception ex
? "AppDomain unhandled exception: " + ex
@@ -28,6 +26,21 @@ public partial class App : Application
AppLog.Write(args.Exception, "Dispatcher unhandled exception");
AppLog.Write("App OnStartup begin");
// Velopack auto-update bootstrap — checks for updates on startup and
// applies them (the app restarts automatically if an update is found).
// Update URL is configured per-deployment (self-hosted on DO droplet);
// when no URL is set, the check is a no-op.
try
{
VelopackApp.Build()
.Run();
}
catch (Exception ex)
{
AppLog.Write($"Velopack bootstrap failed (non-fatal): {ex.Message}");
}
base.OnStartup(e);
AppLog.Write("App OnStartup end");
}