Update tests

This commit is contained in:
Kevin Bost
2024-11-20 22:19:39 -08:00
committed by Caelan
parent a94f4911c1
commit d31d152485
5 changed files with 46 additions and 44 deletions

View File

@@ -1,8 +1,35 @@
using System.Windows;
using Velopack;
namespace CSharpWpf
{
public partial class App : Application
{
public static MemoryLogger Log { get; private set; }
// Since WPF has an "automatic" Program.Main, we need to create our own.
// In order for this to work, you must also add the following to your .csproj:
// <StartupObject>CSharpWpf.App</StartupObject>
[STAThread]
private static void Main(string[] args)
{
try {
// Logging is essential for debugging! Ideally you should write it to a file.
Log = new MemoryLogger();
// It's important to Run() the VelopackApp as early as possible in app startup.
VelopackApp.Build()
.WithFirstRun((v) => { /* Your first run code here */ })
.Run(Log);
// We can now launch the WPF application as normal.
var app = new App();
app.InitializeComponent();
app.Run();
} catch (Exception ex) {
MessageBox.Show("Unhandled exception: " + ex.ToString());
}
}
}
}