Orbmu2k/nvidiaProfileInspector · error · InvalidOperationException

No update release was selected.

Error message

No update release was selected.

What it means

InvalidOperationException thrown by InplaceUpdateInstaller.PrepareAndRunAsync when the release argument is null. A distinct message from the not-installable case, indicating the caller passed no release at all to the in-place self-update routine.

Solutions

  1. Null-check the release before invoking the installer (or make the command's CanExecute depend on Release != null)
  2. Ensure update-check completes and assigns the release before enabling install
  3. Catch the InvalidOperationException and no-op or prompt the user to re-check for updates
  4. Return early in the caller when the selected release is null

Example fix

// before
await installer.PrepareAndRunAsync(selectedRelease);
// after
if (selectedRelease != null)
    await installer.PrepareAndRunAsync(selectedRelease);
Defensive patterns

Strategy: validation

Validate before calling

if (release is null) return; // or disable the command

Type guard

bool HasRelease(UpdateRelease release) => release is not null;

Try / catch

try { await installer.PrepareAndRunAsync(release); }
catch (InvalidOperationException) { /* no release selected — re-check for updates */ }

Prevention

When it happens

Trigger: Passing a null UpdateRelease to PrepareAndRunAsync, e.g. a UI field not yet bound, an async update-check that returned null, or an IUpdateInstaller invoked with default(T).

Common situations: Race where the user clicks Install before the release download/check completes; DI wiring invoking the installer with a missing release; filtering removed all releases but the install command stayed enabled.

Related errors


AI-assisted analysis of Orbmu2k/nvidiaProfileInspector@2f50c388b3 (2026-09-15). Data as JSON: /api/errors/08204989b5c4b5be. Report an issue: GitHub.

Appendix: source

Thrown at nvidiaProfileInspector/Common/Updates/InplaceUpdateInstaller.cs:17

using System;
using System.Diagnostics;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Net.Http;
using System.Reflection;
using System.Threading.Tasks;

namespace nvidiaProfileInspector.Common.Updates
{
    public sealed class InplaceUpdateInstaller : IUpdateInstaller
    {
        public async Task PrepareAndRunAsync(UpdateRelease release)
        {
            if (release == null)
                throw new InvalidOperationException("No update release was selected.");

            if (!release.IsInstallable)
                throw new InvalidOperationException("The selected release does not contain a downloadable update package.");

            var tempRoot = Path.Combine(Path.GetTempPath(), "nvidiaProfileInspector-update-" + Guid.NewGuid().ToString("N"));
            Directory.CreateDirectory(tempRoot);

            var assetPath = Path.Combine(tempRoot, SanitizeFileName(release.Asset.Name ?? "update.zip"));
            await DownloadFileAsync(release.Asset.DownloadUrl, assetPath);

            var sourcePath = PrepareUpdateSource(tempRoot, assetPath, release.Asset.PackageType);
            var appDirectory = AppContext.BaseDirectory.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
            var executablePath = Assembly.GetEntryAssembly()?.Location ?? Process.GetCurrentProcess().MainModule.FileName;
            var scriptPath = Path.Combine(tempRoot, "apply-update.cmd");

            File.WriteAllText(scriptPath, CreateUpdateScript(Process.GetCurrentProcess().Id, tempRoot, sourcePath, appDirectory, executablePath));

            Process.Start(new ProcessStartInfo

View on GitHub (pinned to 2f50c388b3)