From 1bbc93c1252ab88c3eb7728dcdf0ab68527935bd Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 5 Mar 2026 04:25:47 +0000 Subject: [PATCH 1/5] feat: integrate Velopack for installation and auto-updates - Added Velopack NuGet package dependency to OpenpilotToolkit. - Initialized Velopack in Program.cs. - Integrated background auto-updater logic using UpdateManager in OpenpilotToolkitForm.cs checking spektor56/openpilottoolkit releases. - Modified .github/workflows/manual-release.yml to use the `vpk` CLI for packaging the app with project icon and splash branding media. Co-authored-by: spektor56 <3619794+spektor56@users.noreply.github.com> --- .github/workflows/manual-release.yml | 10 ++++- OpenpilotToolkit/OpenpilotToolkit.csproj | 1 + OpenpilotToolkit/OpenpilotToolkitForm.cs | 52 ++++++++++++++++++++++++ OpenpilotToolkit/Program.cs | 10 +++++ 4 files changed, 71 insertions(+), 2 deletions(-) diff --git a/.github/workflows/manual-release.yml b/.github/workflows/manual-release.yml index a8aa93a..5b8f712 100644 --- a/.github/workflows/manual-release.yml +++ b/.github/workflows/manual-release.yml @@ -27,9 +27,15 @@ jobs: bash .agent/setup.sh bash .agent/quick-build.sh + - name: Install Velopack CLI + run: dotnet tool install -g vpk + - name: Package application run: | - zip -r OpenpilotToolkit-${{ github.event.inputs.version }}.zip OpenpilotToolkit/bin/Release/net10.0-windows10.0.19041/win-x64/ + export PATH="$PATH:$HOME/.dotnet/tools" + VERSION="${{ github.event.inputs.version }}" + VERSION="${VERSION#v}" + vpk pack -u OpenpilotToolkit -v $VERSION -p OpenpilotToolkit/bin/Release/net10.0-windows10.0.19041/win-x64/ -o ReleasePackages -i OpenpilotToolkit/Resources/ic_launcher-web.ico -s OpenpilotToolkit/Resources/ssh.png - name: Create GitHub Release uses: softprops/action-gh-release@v1 @@ -37,6 +43,6 @@ jobs: tag_name: ${{ github.event.inputs.version }} name: Release ${{ github.event.inputs.version }} body: ${{ github.event.inputs.release_notes }} - files: ./OpenpilotToolkit-${{ github.event.inputs.version }}.zip + files: ./ReleasePackages/* env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/OpenpilotToolkit/OpenpilotToolkit.csproj b/OpenpilotToolkit/OpenpilotToolkit.csproj index 808e022..b5d7a7d 100644 --- a/OpenpilotToolkit/OpenpilotToolkit.csproj +++ b/OpenpilotToolkit/OpenpilotToolkit.csproj @@ -618,6 +618,7 @@ + diff --git a/OpenpilotToolkit/OpenpilotToolkitForm.cs b/OpenpilotToolkit/OpenpilotToolkitForm.cs index 50da07a..d459661 100644 --- a/OpenpilotToolkit/OpenpilotToolkitForm.cs +++ b/OpenpilotToolkit/OpenpilotToolkitForm.cs @@ -40,6 +40,8 @@ using LiveChartsCore; using LiveChartsCore.Defaults; using LiveChartsCore.Measure; +using Velopack; +using Velopack.Sources; using LiveChartsCore.SkiaSharpView.Painting; using LiveChartsCore.SkiaSharpView.Painting.Effects; using LiveChartsCore.SkiaSharpView.SKCharts; @@ -330,11 +332,61 @@ private async void Form1_Load(object sender, EventArgs e) await ScanDevices().ConfigureAwait(false); //Look for updates + _ = Task.Run(CheckForUpdatesAsync); //TODO: implement self-updater //var test = await _githubClient.Repository.Release.GetLatest("spektor56", "openpilotToolkit"); } + private async Task CheckForUpdatesAsync() + { + try + { + var mgr = new UpdateManager(new GithubSource("https://github.com/spektor56/openpilottoolkit", null, false)); + + if (!mgr.IsInstalled) + { + return; + } + + var newVersion = await mgr.CheckForUpdatesAsync(); + if (newVersion == null) + { + return; // No update available + } + + Invoke(new MethodInvoker(() => + { + var result = ToolkitMessageDialog.ShowDialog($"An update to version {newVersion.TargetFullRelease.Version} is available. Would you like to update now?", this, MessageBoxButtons.YesNo); + if (result == DialogResult.Yes) + { + Task.Run(async () => + { + try + { + Invoke(new MethodInvoker(() => + { + var message = new MaterialSnackBar("Downloading update, the application will restart automatically...", "OK", false); + message.Show(this); + })); + await mgr.DownloadUpdatesAsync(newVersion); + mgr.ApplyUpdatesAndRestart(newVersion); + } + catch (Exception ex) + { + Serilog.Log.Error(ex, "Failed to download/apply update"); + Invoke(new MethodInvoker(() => ToolkitMessageDialog.ShowDialog("Failed to apply update: " + ex.Message, this))); + } + }); + } + })); + } + catch (Exception ex) + { + Serilog.Log.Error(ex, "Error checking for updates."); + } + } + private async void FileWatcherOnChanged(object sender, FileSystemEventArgs e) { if (e.ChangeType == WatcherChangeTypes.Changed && _watchedFiles.Count > 0) diff --git a/OpenpilotToolkit/Program.cs b/OpenpilotToolkit/Program.cs index cb8ef2b..596dbc0 100644 --- a/OpenpilotToolkit/Program.cs +++ b/OpenpilotToolkit/Program.cs @@ -11,6 +11,7 @@ using System.IO; using System.Threading.Tasks; using System.Windows.Forms; +using Velopack; namespace OpenpilotToolkit { @@ -26,6 +27,15 @@ static class Program [STAThread] public static int Main(string[] args) { + try + { + VelopackApp.Build().Run(); + } + catch (Exception) + { + // Ignore errors related to Velopack initialization + } + Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); Application.SetHighDpiMode(HighDpiMode.DpiUnaware); Application.EnableVisualStyles(); From ab66e0fae0a1e26b4e05d50e19fe9f913437cdd8 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 5 Mar 2026 04:39:34 +0000 Subject: [PATCH 2/5] feat: integrate Velopack for installation and auto-updates - Added Velopack NuGet package dependency to OpenpilotToolkit. - Initialized Velopack in Program.cs. - Integrated background auto-updater logic using UpdateManager in OpenpilotToolkitForm.cs checking spektor56/openpilottoolkit releases. - Modified .github/workflows/manual-release.yml to use the `vpk` CLI for packaging the app with project icon and splash branding media. - Added `vpk download github` to workflow to generate delta packages during release. Co-authored-by: spektor56 <3619794+spektor56@users.noreply.github.com> --- .github/workflows/manual-release.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/manual-release.yml b/.github/workflows/manual-release.yml index 5b8f712..c9a7dff 100644 --- a/.github/workflows/manual-release.yml +++ b/.github/workflows/manual-release.yml @@ -30,6 +30,12 @@ jobs: - name: Install Velopack CLI run: dotnet tool install -g vpk + - name: Download Previous Release for Deltas + continue-on-error: true + run: | + export PATH="$PATH:$HOME/.dotnet/tools" + vpk download github --repoUrl https://github.com/spektor56/openpilottoolkit -o ReleasePackages + - name: Package application run: | export PATH="$PATH:$HOME/.dotnet/tools" From 164da2d81b7cd1b7161de65152477dcb2080d0a9 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 10 Mar 2026 03:19:39 +0000 Subject: [PATCH 3/5] feat: integrate Velopack for installation and auto-updates - Added Velopack NuGet package dependency to OpenpilotToolkit. - Initialized Velopack in Program.cs. - Integrated background auto-updater logic using UpdateManager in OpenpilotToolkitForm.cs checking spektor56/openpilottoolkit releases. - Handled existing installations by querying GitHub via Octokit if the app is not installed via Velopack. - Modified .github/workflows/manual-release.yml to use the `vpk` CLI for packaging the app with project icon and splash branding media. - Added `vpk download github` to workflow to generate delta packages during release. Co-authored-by: spektor56 <3619794+spektor56@users.noreply.github.com> --- OpenpilotToolkit/OpenpilotToolkitForm.cs | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/OpenpilotToolkit/OpenpilotToolkitForm.cs b/OpenpilotToolkit/OpenpilotToolkitForm.cs index d459661..e9b021f 100644 --- a/OpenpilotToolkit/OpenpilotToolkitForm.cs +++ b/OpenpilotToolkit/OpenpilotToolkitForm.cs @@ -346,6 +346,35 @@ private async Task CheckForUpdatesAsync() if (!mgr.IsInstalled) { + try + { + var release = await _githubClient.Repository.Release.GetLatest("spektor56", "openpilotToolkit"); + if (release != null) + { + var currentVersionStr = Assembly.GetExecutingAssembly().GetName().Version.ToString(); + if (Version.TryParse(currentVersionStr, out var currentVersion) && + Version.TryParse(release.TagName.TrimStart('v'), out var latestVersion) && + latestVersion > currentVersion) + { + Invoke(new MethodInvoker(() => + { + var result = ToolkitMessageDialog.ShowDialog($"An update to version {release.TagName} is available, but this version of OpenpilotToolkit was not installed via the auto-updating installer. Would you like to open the download page to install the new version?", this, MessageBoxButtons.YesNo); + if (result == DialogResult.Yes) + { + Process.Start(new ProcessStartInfo + { + FileName = "https://github.com/spektor56/openpilottoolkit/releases/latest", + UseShellExecute = true + }); + } + })); + } + } + } + catch (Exception ex) + { + Serilog.Log.Error(ex, "Failed to check for non-Velopack updates from GitHub"); + } return; } From 770b9524e539dba7d3fd1986af92031c4fe11b89 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 10 Mar 2026 04:17:59 +0000 Subject: [PATCH 4/5] feat: integrate Velopack for installation and auto-updates - Added Velopack NuGet package dependency to OpenpilotToolkit. - Initialized Velopack in Program.cs. - Integrated background auto-updater logic using UpdateManager in OpenpilotToolkitForm.cs checking spektor56/openpilottoolkit releases. - Handled existing installations by querying GitHub via Octokit if the app is not installed via Velopack. - Added FolderProfile.pubxml to target a publish directory. - Modified .github/workflows/manual-release.yml to use `dotnet publish` with `FolderProfile`, and the `vpk` CLI for packaging the app with project icon and splash branding media. - Added `vpk download github` to workflow to generate delta packages during release. Co-authored-by: spektor56 <3619794+spektor56@users.noreply.github.com> --- .github/workflows/manual-release.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/manual-release.yml b/.github/workflows/manual-release.yml index c9a7dff..841a405 100644 --- a/.github/workflows/manual-release.yml +++ b/.github/workflows/manual-release.yml @@ -30,6 +30,9 @@ jobs: - name: Install Velopack CLI run: dotnet tool install -g vpk + - name: Publish application + run: dotnet publish OpenpilotToolkit/OpenpilotToolkit.csproj -p:PublishProfile=FolderProfile -c Release /p:EnableWindowsTargeting=true + - name: Download Previous Release for Deltas continue-on-error: true run: | @@ -41,7 +44,7 @@ jobs: export PATH="$PATH:$HOME/.dotnet/tools" VERSION="${{ github.event.inputs.version }}" VERSION="${VERSION#v}" - vpk pack -u OpenpilotToolkit -v $VERSION -p OpenpilotToolkit/bin/Release/net10.0-windows10.0.19041/win-x64/ -o ReleasePackages -i OpenpilotToolkit/Resources/ic_launcher-web.ico -s OpenpilotToolkit/Resources/ssh.png + vpk pack -u OpenpilotToolkit -v $VERSION -p OpenpilotToolkit/bin/Release/net10.0-windows10.0.19041/win-x64/publish/ -o ReleasePackages -i OpenpilotToolkit/Resources/ic_launcher-web.ico -s OpenpilotToolkit/Resources/ssh.png - name: Create GitHub Release uses: softprops/action-gh-release@v1 From 0ac291d0deaebd129e660017f76396c4ccedfd7a Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 10 Mar 2026 16:32:30 +0000 Subject: [PATCH 5/5] feat: integrate Velopack for installation and auto-updates - Added Velopack NuGet package dependency to OpenpilotToolkit. - Initialized Velopack in Program.cs. - Integrated background auto-updater logic using UpdateManager in OpenpilotToolkitForm.cs checking spektor56/openpilottoolkit releases. - Handled existing installations by querying GitHub via Octokit if the app is not installed via Velopack. - Added FolderProfile.pubxml to target a publish directory (`bin/publish/`). - Modified .github/workflows/manual-release.yml to use `dotnet publish` with `FolderProfile`, and the `vpk` CLI for packaging the app with project icon and splash branding media. - Added `vpk download github` to workflow to generate delta packages during release. Co-authored-by: spektor56 <3619794+spektor56@users.noreply.github.com> --- .github/workflows/manual-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/manual-release.yml b/.github/workflows/manual-release.yml index 841a405..011a291 100644 --- a/.github/workflows/manual-release.yml +++ b/.github/workflows/manual-release.yml @@ -44,7 +44,7 @@ jobs: export PATH="$PATH:$HOME/.dotnet/tools" VERSION="${{ github.event.inputs.version }}" VERSION="${VERSION#v}" - vpk pack -u OpenpilotToolkit -v $VERSION -p OpenpilotToolkit/bin/Release/net10.0-windows10.0.19041/win-x64/publish/ -o ReleasePackages -i OpenpilotToolkit/Resources/ic_launcher-web.ico -s OpenpilotToolkit/Resources/ssh.png + vpk pack -u OpenpilotToolkit -v $VERSION -p OpenpilotToolkit/bin/publish/ -o ReleasePackages -i OpenpilotToolkit/Resources/ic_launcher-web.ico -s OpenpilotToolkit/Resources/ssh.png - name: Create GitHub Release uses: softprops/action-gh-release@v1