Re: Updating application info plist
Am 10.10.2009 um 01:05 Uhr schrieb Rob Keniger: To do this, surely they must be rewriting the LSUIElement key in the app's own Info.plist while the app is running, right? Or is there another way to do this? I did this once, because there was no other way to switch between UIElement and normal application mode. Obviously this was only possible if the user had write access to the application bundle. Fortunately since 10.5 there's now an working API. See Kyle's comment and this page: http://www.cocoadev.com/index.pl?TransformProcessType Andreas ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Updating application info plist
On Fri, Oct 9, 2009 at 4:05 PM, Rob Keniger wrote: > To do this, surely they must be rewriting the LSUIElement key in the app's > own Info.plist while the app is running, right? Or is there another way to do > this? I don't know how LittleSnapper is implemented, but you can use TransformProcessType to bring yourself from LSUIElement-ness into Dock-icon-having, full blown app status. I imagine LittleSnapper checks user defaults at launch and calls this function if necessary—this would be the only way to implement this feature for non-admin users who can't write to the app bundle. http://developer.apple.com/mac/library/documentation/Carbon/Reference/Process_Manager/Reference/reference.html#//apple_ref/c/func/TransformProcessType (Also, don't forget about code signing.) --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Updating application info plist
On 10/10/2009, at 1:19 AM, Kyle Sluder wrote: > Sorry, you cannot do this. Changing an app's Info.plist is not supported, > especially while the app is running. I've noticed that some apps (LittleSnapper is the first example I can think of), have a "hide the app icon in the dock after relaunch" option. To do this, surely they must be rewriting the LSUIElement key in the app's own Info.plist while the app is running, right? Or is there another way to do this? -- Rob Keniger ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Updating application info plist
On Oct 9, 2009, at 8:19 AM, Kyle Sluder wrote: Sorry, you cannot do this. Changing an app's Info.plist is not supported, especially while the app is running. As well, it is likely that the .app directory is installed in some place where the current user does not have write access or the app might be on a machine with multiple users and, thus, that single copy is run by multiple people. All of this begs the question: "What are you really trying to do?" b.bum ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Updating application info plist
On Oct 9, 2009, at 2:55 AM, Zephyroth Akash wrote: After the update of some resources I want to write the new version of these resources in the Info.plist. Sorry, you cannot do this. Changing an app's Info.plist is not supported, especially while the app is running. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Updating application info plist
On Oct 9, 2009, at 3:55 AM, Zephyroth Akash wrote: I get the Info.plist of the app like this. NSMutableDictionary *infoPlist = [[NSBundle mainbundle] infoDictionary]; After the update of some resources I want to write the new version of these resources in the Info.plist. No problem. But when the app execute : [infoPlist writeToFile:pathToInfoPlistOfTheApp atomically:YES]; Nothing happens even if I change the path to my desktop, the dictionary is not written. Are there some limitations ? There are limitations on what types of objects you can put in a dictionary such that it can be written out to a property list file. Specifically, only NSData, NSDate, NSNumber, NSString, NSArray, and/or NSDictionary objects. Any other type of object in the dictionary will cause the write to fail. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Updating application info plist
On 9 Oct 2009, at 10:55, Zephyroth Akash wrote: Hi, I'm facing a weird issue. I get the Info.plist of the app like this. NSMutableDictionary *infoPlist = [[NSBundle mainbundle] infoDictionary]; Warning lights should be going off here. -infoDictionary is defined as returning an NSDictionary so there is no guarantee it will be mutable. At the very least do: NSMutableDictionary *infoPlist = [[[NSBundle mainBundle] infoDictionary] mutableCopy]; But considering the documentation of -infoDictionary, I'd say this isn't a particularly good idea anyhow. As the docs say: "The NSBundle class may add extra keys to this dictionary for its own use." Instead, I think you're better off loading the plist manually yourself. After the update of some resources I want to write the new version of these resources in the Info.plist. No problem. But when the app execute : [infoPlist writeToFile:pathToInfoPlistOfTheApp atomically:YES]; Nothing happens even if I change the path to my desktop, the dictionary is not written. Are there some limitations ? Can I write the Info.plist while the application is running ? Zephyroth ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net This email sent to cocoa...@mikeabdullah.net ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Updating application info plist
Hi, I'm facing a weird issue. I get the Info.plist of the app like this. NSMutableDictionary *infoPlist = [[NSBundle mainbundle] infoDictionary]; After the update of some resources I want to write the new version of these resources in the Info.plist. No problem. But when the app execute : [infoPlist writeToFile:pathToInfoPlistOfTheApp atomically:YES]; Nothing happens even if I change the path to my desktop, the dictionary is not written. Are there some limitations ? Can I write the Info.plist while the application is running ? Zephyroth ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com