Skip to content

Commit

Permalink
Bugfix: bundle identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
relikd committed Feb 11, 2019
1 parent d226912 commit c4e2f96
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion baRSS-Helper/main.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
int main(int argc, const char * argv[]) {
@autoreleasepool {
// see: http://martiancraft.com/blog/2015/01/login-items/
NSArray<NSRunningApplication*> *arr = [NSRunningApplication runningApplicationsWithBundleIdentifier:@"de.relikd.baRSS"];
NSURL *mainURL = [NSURL fileURLWithPath:@"../../../../" isDirectory:YES relativeToURL:NSBundle.mainBundle.bundleURL];
NSString *mainIdent = [[NSBundle bundleWithURL:mainURL] bundleIdentifier]; // de.relikd.baRSS

NSArray<NSRunningApplication*> *arr = [NSRunningApplication runningApplicationsWithBundleIdentifier:mainIdent];
if (arr.count == 0) { // if not already running
NSArray *pathComponents = [[[NSBundle mainBundle] bundlePath] pathComponents];
pathComponents = [pathComponents subarrayWithRange:NSMakeRange(0, [pathComponents count] - 4)];
Expand Down

0 comments on commit c4e2f96

Please sign in to comment.