Bugfix: bundle identifier

This commit is contained in:
relikd
2019-02-11 23:40:03 +01:00
parent d226912e5b
commit c4e2f9615c

View File

@@ -25,7 +25,10 @@
int main(int argc, const char * argv[]) { int main(int argc, const char * argv[]) {
@autoreleasepool { @autoreleasepool {
// see: http://martiancraft.com/blog/2015/01/login-items/ // 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 if (arr.count == 0) { // if not already running
NSArray *pathComponents = [[[NSBundle mainBundle] bundlePath] pathComponents]; NSArray *pathComponents = [[[NSBundle mainBundle] bundlePath] pathComponents];
pathComponents = [pathComponents subarrayWithRange:NSMakeRange(0, [pathComponents count] - 4)]; pathComponents = [pathComponents subarrayWithRange:NSMakeRange(0, [pathComponents count] - 4)];