Orbmu2k/nvidiaProfileInspector · error · InvalidOperationException
The selected update package format is not supported.
Error message
The selected update package format is not supported.
What it means
InvalidOperationException thrown at the end of InplaceUpdateInstaller.PrepareUpdateSource when the downloaded asset's package format matches none of the supported layouts (e.g. single portable exe vs zip with an executable tree). After extraction, FindUpdateRoot must locate the new executable; if the archive layout is unrecognized, the updater cannot determine the update source directory and throws. Called by the sourcePath property/flow.
Solutions
- Inspect the downloaded asset's actual archive layout and confirm the installer's FindUpdateRoot expectations match it
- Extract manually and verify an executable named like the current assembly exists; if the release renamed the exe, update the name-matching logic
- Make FindUpdateRoot match any executable instead of only the exact current exe name, then rethrow only when none is found
- Only ship assets in the layout the installer supports, and add an automated test that extracts the packaged release
- Add a guard that validates supported extensions before download to fail fast with a clearer message
Example fix
// before
throw new InvalidOperationException("The selected update package format is not supported.");
// after
var anyExe = Directory.EnumerateFiles(extractPath, "*.exe", SearchOption.AllDirectories).FirstOrDefault();
if (anyExe == null)
throw new InvalidOperationException($"No executable found in update package '{release.Asset.Name}'.");
return Path.GetDirectoryName(anyExe); Defensive patterns
Strategy: try-catch
Validate before calling
if (!string.Equals(Path.GetExtension(release.Asset?.Name), ".zip", StringComparison.OrdinalIgnoreCase))
throw new InvalidOperationException("Unsupported update package extension"); Try / catch
try { var source = PrepareUpdateSource(assetPath, tempRoot); }
catch (InvalidOperationException ex) { Log.Error(ex, "Unrecognized update package layout"); ShowError("Update package layout not recognized; please install manually."); } Prevention
- Ship release assets only in the layout the installer supports
- Add a CI test that extracts the packaged asset and runs FindUpdateRoot against it
- Make FindUpdateRoot match any *.exe instead of only the exact current exe name
- Fail fast on unsupported extensions before download/extraction
When it happens
Trigger: The release asset is a supported extension (e.g. .zip) but its inner layout changed (files nested differently, no exe at expected root); asset is a format the installer doesn't branch on (e.g. .7z, .msi, plain exe uploaded as zip); FindUpdateRoot can't find an executable named like the current entry assembly.
Common situations: CI packaging change in a new release renames or relocates the exe; a maintainer uploads a manually-built archive with an extra folder level; a portable single-file build where the copied asset bypasses the zip path but layout assumptions broke; renaming the exe so FindUpdateRoot's name match fails.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- The selected release does not contain a downloadable update…
- No update release was selected.
- The selected release does not contain a downloadable update…
AI-assisted analysis of Orbmu2k/nvidiaProfileInspector@2f50c388b3 (2026-09-15).
Data as JSON: /api/errors/2e144eefb489e032.
Report an issue: GitHub.
Appendix: source
Thrown at nvidiaProfileInspector/Common/Updates/InplaceUpdateInstaller.cs:74
private static string PrepareUpdateSource(string tempRoot, string assetPath, UpdatePackageType packageType)
{
if (packageType == UpdatePackageType.Zip)
{
var extractPath = Path.Combine(tempRoot, "extracted");
ZipFile.ExtractToDirectory(assetPath, extractPath);
return FindUpdateRoot(extractPath);
}
if (packageType == UpdatePackageType.Exe)
{
var sourcePath = Path.Combine(tempRoot, "extracted");
Directory.CreateDirectory(sourcePath);
File.Copy(assetPath, Path.Combine(sourcePath, Path.GetFileName(Assembly.GetEntryAssembly()?.Location ?? "nvidiaProfileInspector.exe")));
return sourcePath;
}
throw new InvalidOperationException("The selected update package format is not supported.");
}
private static string FindUpdateRoot(string extractPath)
{
var executableName = Path.GetFileName(Assembly.GetEntryAssembly()?.Location ?? "nvidiaProfileInspector.exe");
var executable = Directory
.GetFiles(extractPath, executableName, SearchOption.AllDirectories)
.OrderBy(path => path.Length)
.FirstOrDefault();
return executable == null ? extractPath : Path.GetDirectoryName(executable);
}
private static string CreateUpdateScript(int processId, string tempRoot, string sourcePath, string appDirectory, string executablePath)
{
return string.Join(Environment.NewLine, new[]
{
"@echo off",View on GitHub (pinned to 2f50c388b3)