From 238fd42bb39583f180ee47010bafd6bda4e236a0 Mon Sep 17 00:00:00 2001 From: Charles Srstka Date: Sat, 5 Dec 2020 19:15:22 -0600 Subject: [PATCH] Support getting app icon from asset catalog --- Sparkle/SUApplicationInfo.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sparkle/SUApplicationInfo.m b/Sparkle/SUApplicationInfo.m index eb349af3..4b32dfa8 100644 --- a/Sparkle/SUApplicationInfo.m +++ b/Sparkle/SUApplicationInfo.m @@ -22,6 +22,12 @@ NSURL *iconURL = [SUBundleIcon iconURLForHost:host]; NSImage *icon = (iconURL == nil) ? nil : [[NSImage alloc] initWithContentsOfURL:iconURL]; + + // Get icon from asset catalog if no explicit filename is provided. + if (!icon) { + icon = [host.bundle imageForResource:@SPARKLE_ICON_NAME]; + } + // Use a default icon if none is defined. if (!icon) { // this asumption may not be correct (eg. even though we're not the main bundle, it could be still be a regular app)