Get app version info

Does anyone know how to retrieve the version information for a Firemonkey iOS app, i.e. the Firemonkey or iOS equivalent to the GetFileVersionInfo Windows API call?
0
Jason
11/12/2011 12:02:35 PM
embarcadero.delphi.ios 412 articles. 0 followers. Follow

5 Replies
2108 Views

Similar Articles

[PageSpeed] 30
Get it on Google Play
Get it on Apple App Store

> {quote:title=Jason Sweby wrote:}{quote}
> Does anyone know how to retrieve the version information for a Firemonkey iOS app, i.e. the Firemonkey or iOS equivalent to the GetFileVersionInfo Windows API call?

Use this code:

{code}
Uses
  Macapi.ObjCRuntime,
  Macapi.ObjectiveC,
  IOSApi.Foundation,
  IOSApi.UIKit,
  IOSApi.QuartzCore,
  IOSApi.CocoaTypes
{code}


{code}
Function GetAppVersion: String;
Var
  NSB  : NSBundle;
  NSDic: NSDictionary;
  NS   : NSString;
Begin
  NSB    := TNSBundle.Wrap( TNSBundle.OCClass.MainBundle );
  NSDic  := NSB.InfoDictionary;
  NS     := TNSString.Wrap( NSDic.ValueForKey( NSStr( 'CFBundleVersion' ) ) );
  Result := Format('%s', [NS.UTF8String]);
  NS.release;
  NSB.Release;

  NS := Nil;
  NSB := Nil;
End;
{code}
0
Babak
6/2/2013 1:46:26 PM
> {quote:title=Babak Yaghoobi wrote:}{quote}
> Use this code:

Perfect Babak, thank you. :)
0
Jason
6/3/2013 12:07:51 PM
> {quote:title=Babak Yaghoobi wrote:}{quote}
> Use this code:

Well almost perfect. Ever since I added this code, I've been getting an Access Violation on the device (but not the simulator) whenever I tap in an Edit box and the keyboard displays. The app then locks up. It took me a while to figure out what was causing it, but when I removed the line that calls your GetAppVersion function, the problem went away. I added the line back in, the problem reappeared.

Any ideas what, in that function, might be causing this issue?
0
Jason
6/7/2013 7:45:33 AM
For me is working.
Try new project only with this function and Edit box.

Best Regards,
Cristian Peta
0
Cristian
6/7/2013 10:12:13 AM
> {quote:title=Jason Sweby wrote:}{quote}
> > {quote:title=Babak Yaghoobi wrote:}{quote}
> > Use this code:
> 
> Well almost perfect. Ever since I added this code, I've been getting an Access Violation on the device (but not the simulator) whenever I tap in an Edit box and the keyboard displays. The app then locks up. It took me a while to figure out what was causing it, but when I removed the line that calls your GetAppVersion function, the problem went away. I added the line back in, the problem reappeared.
> 
> Any ideas what, in that function, might be causing this issue?

I test on iPhone 4 and worked for me.
But you can remove this lines and check it again :
{code}
  NS.release;
  NSB.Release;
 
  NS := Nil;
  NSB := Nil;
{code}
0
Babak
6/7/2013 8:17:10 PM
Reply:

Similar Artilces:

XE8
I give up.... I can't figure out how to get the version number to be included in my add-hoc builds. After some playing around I have it working for debug versions but I can't get it to be included in the adhoc build. I have set Project/Options/Version Info to 1.0.2 and checked "Include version information in project" for the IOS Device 32 Bit, 64bit and Simulator Release configurations (I've noticed that the cfBundleVersion setting changes to match my version info) but when I deploy it the ipa ends up always showing ver 1.0.0 Can anyone tell me what I am doing wr...

Delphi app in Apple App Store for iOS
Have you guys with iPhones and iPads seen that there is a Delphi produced app, running Interbase To Go, approved for download on the Apple App Store? I can't find a link on the web, but search "Embarcadero" on the app store and it shows up. (My daughter showed me. ;-) ) -- Nick > I can't find a link on the web, but search "Embarcadero" on the app > store and it shows up. (My daughter showed me. ;-) ) There are 6 apps that shows up... which one is it? - Palo Alto - Embarcadero (Fom Scott James, mapping software or something..) - Heart of...

Can I do this with iOS apps developed in Delphi XE4 Pro + iOS?
I still don't have XE4/iOS as I have some questions first. Do I have access to iOS "native" library/system? What do I use for internet (downloading files etc.) - Indy? *If my research is correct, Google maps is available for iOS? Can I use Google maps or Apple's maps solutions in Delphi iOS apps?* If I have XE4 Pro, can I still use database functionality? Any restrictions? (Am I allowed to use what iOS offers or connect with a database on a webserver?) Anyone here developed demo apps I can see available in Apple iTunes store? (Even simple apps is okay as I onl...

IOS App version?
How can I get the App version info in an IOS app? in OSX I use.. TNSString.Wrap(CFBundleGetValueForInfoDictionaryKey(CFBundleGetMainBundle, kCFBundleVersionKey)); but this doesn't work in IOS, I think due to no IOSAPI.CoreFoundation? Jason Coley wrote: > TNSString.Wrap(CFBundleGetValueForInfoDictionaryKey(CFBundleGetMainBundle, kCFBundleVersionKey)); > > but this doesn't work in IOS, I think due to no IOSAPI.CoreFoundation? It works on iOS (at least in the simulator) for me: uses Macapi.CoreFoundation, iOSApi.Foundation; procedure TfrmMain.Button1C...

XE4 iOS: How to get filename if my app was called from mail app or dropbox [Edit]
How to get filename if my app was called via my registered fileextension e.g. from mail app or dropbox. The file should be copied into myDocuments/Inbox-Folder. ok. My app starts or became active. ok. To get the filename I tried this to hope to get the openURL: function TForm1.AppEvent(AAppEvent: TApplicationEvent; AContext: TObject): Boolean; begin case AAppEvent of aeFinishedLaunching : Memo1.Lines.Add('aeFinishedLaunching'); aeBecameActive : Memo1.Lines.Add('aeBecameActive'); aeWillBecomeInactive : Memo1.Lines.Add('...

Getting Version Info
Hi, I am trying to figure out how to include The version information about my app in the "AboutBox" I would like the information to be updated each time I compile or build the project. (Short of writing the information in manually) It's easy enough to create the About Box I think it would be a nice tough to have the latest information about the program listed. I am using BCPPB Version 6 Thanks for any help you can send my way. Pat Pat Clancy wrote: > Hi, > > I am trying to figure out how to include The version information about my app in the "...

How do I get Version info of an executable
I have a requirement in which I need to get the version of Winword.exe. I have used the following API calls ls_path = 'd:\Program Files\Microsoft Office\Office\winword.exe' ll_size = GetFIleVersionInfoSizeA(ls_path, ll_return) ll_return = GetFileVersionInfoA(ls_path, 0, ll_size, lstr) Here lstr is a structure with the following members: unsignedLong wLength; unsignedLong wValueLength; unsignedLong wType; String[] szKey; unsignedLong[] Padding1; VS_FIXEDFILEINFO Value; unsignedLong[] Padding2; unsignedLong Children; Here VS_FIXEDFILEI...

How to get Version infos of an OCX?
I'm developing an OCX (using ActiveForm in BDS2006). I need to find a way to retrieve the Version number (and the compile date, if possible) to show it and expose it as a property. Using GetFileVersion(Application->ExeName) does not work 'cause the ExeName returns the filename of exe that contains my OCX. I don't know (at runtime) the path of my OCX (my customer may want to place it in whatever directory he wants), and so i'm unable to get them. Hello Parduz, > I need to find a way to retrieve the Version number (and the compile date, > if possible) to sho...

How to get info about crashing app?
Hi all, I've installed quantum GIS on opensuse 11.3 gnome, so far so good. I run the app and it opens fine. To get the app to use data on the HD you get a dialogue box with a browse button. It should just be a case of clicking browse and selecting the required data file. Unfortunately when I click on browse the app crashes. I've no idea how to get info about the crash in an attempt to solve the problem. Had a similar problem with gimp in suse 11 kde could only fix it by updating the os to 11.3. It may be a lib issue but no idea what's the next move. Any help greatly ...

How to get versioning info into consumer
I would like my consumer application to automatically reflect its version number from its deployed setup which has the version property.  From what I recall it would be similar to extracting FileVersionInfo in Windows - anyone know how to do this ASP.NET? I believe you are looking for Assembly.GetExecutingAssembly().GetName().Version.ToString();Jon GallantSenior Development Lead, MSDN/TechNethttp://blogs.msdn.com/jongallant/This posting is provided "AS IS" with no warranties, and confers no rights. Well, I tried [Assembly].GetExe... but it's not picking up t...

Web App unable to get same data that a sibling WinForm App gets
 Working in VS08/3.5 on project based very closely off EntLib's DataAccess QuickStart.The sln has 3 projects -   1. VB Class Library (CMS) to provide db access to the other UI projects   2. Winform (WinFormUI) - references CMS to show output to conventional WinForm (bascially I just broke the QuickStart's Winform to a seperate project and then referenced CMS)   3. WebServices app to provide SOAP output of the same db WinForm works correctly so at least I've gotten that far.The WebService app is calling the correct function in CommonData breakpoi...

What would get you to buy a newer Delphi version?
Running a small community poll. This is intended as a practical question, about what would you like to see most and foremost, would most have a use for, and would be ready to part your hard-earned cash for. http://bit.ly/12McgpB http://delphitools.info/2013/04/26/what-would-get-you-to-buy-a-newer-delphi-version/ Eric Hi Eric. "To force you to choose, you can only pick two items!" Clicking on two items, I get: "Maximum number of choices allowed: 1" Edmund > Clicking on two items, I get: Should be fixed now. Got mistakenly reset when I ad...

Getting App from Ios Simulator to Ipad
Hello I have my Delphi XE5 firemonkey app and I have an Apple developer ID. My app runs in the MacInCloud Simulator all that is good, BUT how do I get it onto my iPad. Research has suggested I use XCode but cant see how to connect the app running in simulator to XCode, I cant find the Export To XCode menu option. Other research suggested TestFlightApp.com but I cand find the required IPA file Help! Please! there seems to be little documentation that links these technologies together! ...

Delphi XE2
Hi, I have just recompiled a Delphi 2010 project to Delphi XE2. When I do a build of the project the build number is not incremented even though the project options settings are to "include version information in project" and to "auto generate build numbers". Another problem is that if I use the TMS ExeInfo component to retrieve the version number from the compiled exe I get the correct number but if I use the Windows GetFileVersionInfo function then the minor version and build number is not correct. For example, version number 1.3.0.63 will show up as 1.3.61173.2...

Web resources about - Get app version info - embarcadero.delphi.ios

Authorized King James Version - Wikipedia, the free encyclopedia
The title page to the 1611 first edition of the Authorized Version Bible by Cornelis Boel shows the Apostles Peter and Paul seated centrally ...

Amazon will reportedly release a smaller, less expensive version of its Echo speaker
... to grow. According to a new report from The Wall Street Journal , the Internet retailer is planning to unveil a smaller, less expensive version ...

2017 Ford F-150 Raptor adds SuperCrew version
Filed under: 2016 Detroit Auto Show , Ford , Truck , Off-Road , Performance Ford has upsized its 2017 F-150 Raptor with a new SuperCrew model ...

Adobe preparing fixes for the Windows and OS X versions of Acrobat and Reader
... Adobe products then you likely know the inherent perils of some of the company's platforms. Adobe has gone as far as to instigate its own version ...

CBS, Warner Bros. Said to Consider Online Version of CW Network
CBS Corp. and Time Warner Inc.’s Warner Bros. have discussed creating a paid streaming service for their jointly owned CW network to generate ...

Dilly Dally release studio version of Drake cover
by Andrew Sacher photo: Dilly Dally at Baby's All Right in 2015 (more by Amanda Hatfield) As you probably know if you've seen them live lately, ...

Microsoft is killing support for old versions of Internet Explorer and Windows 8 today
... or security updates from Microsoft, leaving users out in the cold if it ever became compromised. According to Netmarketshare , the three versions ...

Clark Gregg Thinks Inhumans Movie Will Be Its Own Cinematic Version
The Inhumans movie may be the final film on the current Marvel Studios schedule, but that hasn’t [...]

Ridley Scott Captivated By ‘The Prisoner,’ Film Version Of Patrick McGoohan TV Series?
... and now he has even more. I hear that Scott is in early negotiations on a deal to come aboard and direct The Prisoner , the screen version of ...

The old version of Runescape has a new expansion
Adding new content to Runescape Old School, the server which aims to recreate when the game was in its glory days, seems kind of weird to me. ...

Resources last updated: 1/13/2016 7:42:28 AM