From 1c91498166912b76b81fbe39466b7a1a3550d96d Mon Sep 17 00:00:00 2001 From: Lukhnos Liu Date: Sun, 9 Sep 2012 11:43:56 -0700 Subject: [PATCH] Restart SystemUIServer if upgrading from 0.9.4 or lower. --- Source/Installer/AppDelegate.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/Installer/AppDelegate.m b/Source/Installer/AppDelegate.m index 26b84b73..2abde5b2 100644 --- a/Source/Installer/AppDelegate.m +++ b/Source/Installer/AppDelegate.m @@ -103,6 +103,12 @@ static NSString *const kTargetFullBinPartialPath = @"~/Library/Input Methods/McB [NSApp terminate:self]; } + // alno need to restart SystemUIServer to reflect icon changes if the replaced version <= 0.9.4 + if (_currentVersion && [_currentVersion compare:@"0.9.4"] != NSOrderedDescending) { + NSTask *restartSystemUIServerTask = [NSTask launchedTaskWithLaunchPath:@"/usr/bin/killall" arguments:[NSArray arrayWithObjects: @"-9", @"SystemUIServer", nil]]; + [restartSystemUIServerTask waitUntilExit]; + } + NSRunAlertPanel(NSLocalizedString(@"Installation Successful", nil), NSLocalizedString(@"McBopomofo is ready to use.", nil), NSLocalizedString(@"OK", nil), nil, nil); [NSApp terminate:self]; }