GPC: check to see if there is an executable file in the bundle first, if there is then check its architectures, if not then its either a growlStyle or something else. either way it fulfills the architecture requirements
authorRudy Richter
Wed Sep 23 22:45:59 2009 -0400 (2009-09-23)
changeset 4423051a29104de7
parent 4422 1eb3bf585a00
child 4424 d91553192992
GPC: check to see if there is an executable file in the bundle first, if there is then check its architectures, if not then its either a growlStyle or something else. either way it fulfills the architecture requirements
Core/Source/GrowlPluginController.m
     1.1 --- a/Core/Source/GrowlPluginController.m	Mon Sep 21 10:34:00 2009 -0700
     1.2 +++ b/Core/Source/GrowlPluginController.m	Wed Sep 23 22:45:59 2009 -0400
     1.3 @@ -887,9 +887,17 @@
     1.4  	#error unsupported architecture
     1.5  #endif
     1.6  	NSBundle *pluginBundle = [NSBundle bundleWithPath:filename];
     1.7 -	NSArray *pluginArchitectures = [pluginBundle executableArchitectures];
     1.8 -	if([pluginArchitectures containsObject:[NSNumber numberWithInteger:currentArchitecture]])
     1.9 +	NSString *executablePath = [pluginBundle executablePath];
    1.10 +	//we check to see if there is actually an executable in this plugin, it could be a growlStyle, under which we accept it as valid.
    1.11 +	if(executablePath && [[NSFileManager defaultManager] fileExistsAtPath:executablePath]) {
    1.12 +		NSArray *pluginArchitectures = [pluginBundle executableArchitectures];
    1.13 +		if([pluginArchitectures containsObject:[NSNumber numberWithInteger:currentArchitecture]])
    1.14 +			result = YES;
    1.15 +	}
    1.16 +	else {
    1.17  		result = YES;
    1.18 +	}
    1.19 +
    1.20  	return result;
    1.21  }
    1.22