Restart SystemUIServer if upgrading from 0.9.4 or lower.

This commit is contained in:
Lukhnos Liu 2012-09-09 11:43:56 -07:00
parent 3247cbcdba
commit 1c91498166
1 changed files with 6 additions and 0 deletions

View File

@ -103,6 +103,12 @@ static NSString *const kTargetFullBinPartialPath = @"~/Library/Input Methods/McB
[NSApp terminate:self]; [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); NSRunAlertPanel(NSLocalizedString(@"Installation Successful", nil), NSLocalizedString(@"McBopomofo is ready to use.", nil), NSLocalizedString(@"OK", nil), nil, nil);
[NSApp terminate:self]; [NSApp terminate:self];
} }