LykosAI/StabilityMatrix · error · NotSupportedException

.dmg is only supported on macOS

Error message

.dmg is only supported on macOS

What it means

UpdateHelper.DownloadUpdate branches on the downloaded file's extension. A .dmg download is only handled on macOS; on any other OS the helper throws NotSupportedException because it has no routine to mount/extract a macOS disk image.

Solutions

  1. Check the update feed/manifest so each platform is served its own asset (.zip/.exe for Windows, .dmg for macOS).
  2. Verify the app was built/downloaded for the correct OS and re-download from the correct channel.
  3. On macOS, ensure Compat detects macOS correctly (no forced platform overrides).
  4. As a workaround, update manually with the platform-correct installer.

Example fix

// before: manifest gives every platform the .dmg asset
"asset": "StabilityMatrix.dmg"
// after: platform-specific assets
"asset-windows": "StabilityMatrix-win-x64.zip", "asset-macos": "StabilityMatrix.dmg"
Defensive patterns

Strategy: type-guard

Validate before calling

if (downloadFile.Extension == ".dmg" && !Compat.IsMacOS)
    throw new InvalidOperationException("macOS .dmg update offered on non-macOS platform; check update feed");

Type guard

bool CanHandleUpdateAsset(string extension) =>
    extension != ".dmg" || Compat.IsMacOS;

Try / catch

try { await updateHelper.DownloadUpdate(...); }
catch (NotSupportedException ex) when (ex.Message.Contains(".dmg"))
{
    logger.Warning(ex, "Wrong-platform update asset served; skipping auto-update");
    // notify user to update manually with the correct installer
}

Prevention

When it happens

Trigger: Calling DownloadUpdate when the update channel served a .dmg package but the process is running on Windows or Linux (Compat.IsMacOS is false).

Common situations: A misconfigured update feed or version manifest points a Windows/Linux client at the macOS asset; an auto-update metadata bug downloads the wrong platform artifact; a user manually forces a macOS update URL.

Understand the failure class

Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.

Related errors


AI-assisted analysis of LykosAI/StabilityMatrix@af93d6ef57 (2026-09-12). Data as JSON: /api/errors/62bb744d4a2bb3e6. Report an issue: GitHub.

Appendix: source

Thrown at StabilityMatrix.Core/Updater/UpdateHelper.cs:138

                extractDir.Create();

                progress.Report(new ProgressReport(-1, isIndeterminate: true, type: ProgressType.Extract));

                await ArchiveHelper.Extract(downloadFile, extractDir).ConfigureAwait(false);

                progress.Report(new ProgressReport(1, isIndeterminate: true, type: ProgressType.Extract));

                // Find binary and move it up to the root
                var binaryFile = extractDir
                    .EnumerateFiles("*", EnumerationOptionConstants.AllDirectories)
                    .First(f => f.Extension.ToLowerInvariant() is ".exe" or ".appimage");

                await binaryFile.MoveToAsync((FilePath)ExecutablePath).ConfigureAwait(false);
            }
            else if (downloadFile.Extension == ".dmg")
            {
                if (!Compat.IsMacOS)
                    throw new NotSupportedException(".dmg is only supported on macOS");

                if (extractDir.Exists)
                {
                    await extractDir.DeleteAsync(true).ConfigureAwait(false);
                }
                extractDir.Create();

                // Extract dmg contents
                await ArchiveHelper.ExtractDmg(downloadFile, extractDir).ConfigureAwait(false);

                // Find app dir and move it up to the root
                var appBundle = extractDir.EnumerateDirectories("*.app").First();

                await appBundle.MoveToAsync((DirectoryPath)ExecutablePath).ConfigureAwait(false);
            }
            // Otherwise just rename
            else
            {

View on GitHub (pinned to af93d6ef57)