Skip to content

Commit

Permalink
Distinguish between OSX PrefPane and macOS Menubar Item. More work ne…
Browse files Browse the repository at this point in the history
…eded to make auto update etc. work.
  • Loading branch information
michaelherger committed Aug 30, 2024
1 parent 2243821 commit 387cc37
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Slim/Utils/OS/OSX.pm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ use File::Spec::Functions qw(:ALL);
use FindBin qw($Bin);
use POSIX qw(LC_CTYPE LC_TIME);

# the new menubar item comes as an application in something like "Lyrion Music Server.app/Contents/Resources/server"
use constant IS_MENU_ITEM => $Bin =~ m|app/Contents/Resources/server| ? 1 : 0;

my $canFollowAlias;

sub name {
Expand Down Expand Up @@ -372,6 +375,10 @@ sub initUpdate {
return if $updateCheckInitialized;

my $log = Slim::Utils::Log::logger('server.update');
$log->error(IS_MENU_ITEM ? 'menu item' : 'nope');

return if IS_MENU_ITEM;

my $err = "Failed to install LaunchAgent for the update checker";

my $launcherPlist = catfile($ENV{HOME}, 'Library', 'LaunchAgents', $plistLabel . '.plist');
Expand Down Expand Up @@ -443,8 +450,8 @@ sub getUpdateParams {

sub canAutoUpdate { 1 }

sub installerExtension { 'pkg' };
sub installerOS { 'osx' }
sub installerExtension { IS_MENU_ITEM ? 'zip' : 'pkg' };
sub installerOS { IS_MENU_ITEM ? 'macos' : 'osx' }

sub canRestartServer { 1 }

Expand Down

0 comments on commit 387cc37

Please sign in to comment.