Standalone App version

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

Standalone App version

Post by phaworth » Wed Feb 10, 2010 9:45 pm

How can I access the Standalone Application Version Information data in my standalone app?
Pete

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Standalone App version

Post by Mark » Sun Feb 14, 2010 12:01 am

Hi Pete,

You could write a savingStandalone handler in the stack script of your mainstack:

Code: Select all

on savingStandalone
  set the cAppVersion of me to the cRevstandaloneSettings["osx,shortversion"] of me
  pass savingStandalone
end savingStandalone
Now you can check the application version of your stack by checking the cAppversion.

I must say I rarely do this. I set another constant in the stack script of the mainstack, which consists of numbers and dots only. For example:

Code: Select all

constant kVersion = "2.1.0"
constant dot = "."
on foo
  set the itemDel to dot
  put url "http://www.domain.com/sql.php?v=" & \
    item 1 to 2 of kVersion into myLegalLicense
  -- et ceterea
end foo
Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

Re: Standalone App version

Post by phaworth » Sun Feb 14, 2010 8:26 pm

Thanks Mark.

Sounds like cRevStandalone is customproprty of some sort. I can find no mention of it in the dictionary. Is there any doc of it anywhere?

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Standalone App version

Post by Mark » Sun Feb 14, 2010 10:34 pm

phaworth,

No, this is not documented, but you can see a list of the cRevStandaloneSettings properties. First, set the standalone settings for a stack. Turn on "Show Revolution UI Elements in Lists" in the View menu. Now open the proeprty insector for your stack. Go to the Custom Properties pane and select the cRevStandaloneSettings property set. Now you will see all the properties in this set. For example, you can see which properties contains the version numbers for each platform.

Keep in mind that this property set is not copied to your standalone, when you create the standalone. You should not rely on it inside standalones. That's why you need to copy the values of the properties in this set to other properties in your stack.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

Re: Standalone App version

Post by phaworth » Sun Feb 14, 2010 11:00 pm

Thanks for this Mark. I was confused as to why you were creating your own co but now I understand.

phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

Re: Standalone App version

Post by phaworth » Tue Feb 16, 2010 12:39 am

Now I come to think about it, I'm not seeing why rev provides the ability to define version info for the standalone app and then doesn't make it available within the standalone app. Everyone wants to display what version of the standalone is being used, don't they?

I do have another related issue with this. I used the answer command in my savingStandalone event handler to prompt for what version was being created but I never got a dialog box. Is there some reason why answer dialogs don;t work within that event?

Thanks,
Pete

Post Reply