• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [Newbie] read version number from installed package
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Newbie] read version number from installed package


  • Subject: Re: [Newbie] read version number from installed package
  • From: Alex Rice <email@hidden>
  • Date: Tue, 3 Jun 2003 09:55:21 -0600

On Tuesday, June 3, 2003, at 08:49 AM, Jens Frederich wrote:

Hi,

I've follow problem.
With this message I readout the version number from my current
application.
[ gVersion setStringValue: [ NSString stringWithFormat: [ gVersion
stringValue ],
[[ self bundle ] objectForInfoDictionaryKey:
@"CFBundleShortVersionString" ],
[[[ self bundle ] objectForInfoDictionaryKey:
@"CFBundleVersion" ] intValue ]]];

Not really relating to your question: but isn't the first parameter to stringWithFormat: a format string. The above would work if gVersion already has a format string in it, but subsequent calls would fail because gVersion would no longer have a valid format string in it. Just confirming you aren't calling that code more than once.

How can I determine / read the version number from an installed
package? For example, a package located at
/Library/Receipts/Sample.pkg/Contents... . Thank you!

Maybe replace [self bundle] with [NSBundle bundleWithPath: @"/Library/Receipts/Sample.pkg"]?

Alex Rice <email@hidden> | Mindlube Software | http://mindlube.com

what a waste of thumbs that are opposable
to make machines that are disposable -Ani DiFranco
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >[Newbie] read version number from installed package (From: Jens Frederich <email@hidden>)

  • Prev by Date: Re: Book: Mac OS X Advanced Development Techniques
  • Next by Date: Re: Reading bytes from a file and using them
  • Previous by thread: [Newbie] read version number from installed package
  • Next by thread: Default NSButton over NSImageView shows ugly "halo"
  • Index(es):
    • Date
    • Thread