{"record":{"id":"62bb744d4a2bb3e6","repo":"LykosAI/StabilityMatrix","slug":"dmg-is-only-supported-on-macos","errorCode":null,"errorMessage":".dmg is only supported on macOS","messagePattern":"\\.dmg is only supported on macOS","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"StabilityMatrix.Core/Updater/UpdateHelper.cs","lineNumber":138,"sourceCode":"                extractDir.Create();\n\n                progress.Report(new ProgressReport(-1, isIndeterminate: true, type: ProgressType.Extract));\n\n                await ArchiveHelper.Extract(downloadFile, extractDir).ConfigureAwait(false);\n\n                progress.Report(new ProgressReport(1, isIndeterminate: true, type: ProgressType.Extract));\n\n                // Find binary and move it up to the root\n                var binaryFile = extractDir\n                    .EnumerateFiles(\"*\", EnumerationOptionConstants.AllDirectories)\n                    .First(f => f.Extension.ToLowerInvariant() is \".exe\" or \".appimage\");\n\n                await binaryFile.MoveToAsync((FilePath)ExecutablePath).ConfigureAwait(false);\n            }\n            else if (downloadFile.Extension == \".dmg\")\n            {\n                if (!Compat.IsMacOS)\n                    throw new NotSupportedException(\".dmg is only supported on macOS\");\n\n                if (extractDir.Exists)\n                {\n                    await extractDir.DeleteAsync(true).ConfigureAwait(false);\n                }\n                extractDir.Create();\n\n                // Extract dmg contents\n                await ArchiveHelper.ExtractDmg(downloadFile, extractDir).ConfigureAwait(false);\n\n                // Find app dir and move it up to the root\n                var appBundle = extractDir.EnumerateDirectories(\"*.app\").First();\n\n                await appBundle.MoveToAsync((DirectoryPath)ExecutablePath).ConfigureAwait(false);\n            }\n            // Otherwise just rename\n            else\n            {","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/LykosAI/StabilityMatrix/blob/af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002/StabilityMatrix.Core/Updater/UpdateHelper.cs#L120-L156","documentation":"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.","triggerScenarios":"Calling DownloadUpdate when the update channel served a .dmg package but the process is running on Windows or Linux (Compat.IsMacOS is false).","commonSituations":"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.","solutions":["Check the update feed/manifest so each platform is served its own asset (.zip/.exe for Windows, .dmg for macOS).","Verify the app was built/downloaded for the correct OS and re-download from the correct channel.","On macOS, ensure Compat detects macOS correctly (no forced platform overrides).","As a workaround, update manually with the platform-correct installer."],"exampleFix":"// before: manifest gives every platform the .dmg asset\n\"asset\": \"StabilityMatrix.dmg\"\n// after: platform-specific assets\n\"asset-windows\": \"StabilityMatrix-win-x64.zip\", \"asset-macos\": \"StabilityMatrix.dmg\"","handlingStrategy":"type-guard","validationCode":"if (downloadFile.Extension == \".dmg\" && !Compat.IsMacOS)\n    throw new InvalidOperationException(\"macOS .dmg update offered on non-macOS platform; check update feed\");","typeGuard":"bool CanHandleUpdateAsset(string extension) =>\n    extension != \".dmg\" || Compat.IsMacOS;","tryCatchPattern":"try { await updateHelper.DownloadUpdate(...); }\ncatch (NotSupportedException ex) when (ex.Message.Contains(\".dmg\"))\n{\n    logger.Warning(ex, \"Wrong-platform update asset served; skipping auto-update\");\n    // notify user to update manually with the correct installer\n}","preventionTips":["Keep platform-specific assets correctly mapped in the update manifest.","Validate the downloaded asset extension against the current OS before processing.","Test update feeds per-platform before publishing a release.","Never point a client at another platform's channel URL."],"tags":["updater","macos","platform"],"backgroundTag":"unsupported-platform","analyzedSha":"af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002","analyzedAt":"2026-09-12T19:02:43.389Z","contentChangedAt":"2026-09-12T19:02:43.389Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}