Page 1 of 1

Check standalone version?

Posted: Thu Nov 30, 2017 7:16 pm
by thatkeith
When I build a stand-alone I set the app version. Is there a way to check the version of a standalone (my app’s own version, not the version of the underlying engine) by script?
I’d like my app to make a simple check for a newer version of itself (by checking for a bit of data in an online file) so it can prompt the user to go get the latest build. Nothing fancy, no auto-update, just ‘is the app version of me a lower numeric value than x’

Any thoughts?

K

Re: Check standalone version?

Posted: Thu Nov 30, 2017 7:32 pm
by Klaus
Hi Keith,

since stacks do not have a version number or something, you will need to roll your own!
Simply create a custom property of your stack and put your version number into it.

Set CP:
...
set the cVersion of stack "your stack here..." to "1.00"
...
Get CP:
...
put the cVersion of stack "your stack here..." into tCurrentVersion
...
Then you can compare this one with your little "online file".


Best

Klaus

Re: Check standalone version?

Posted: Thu Nov 30, 2017 7:44 pm
by thatkeith
Heh. Good workaround! Also easy to use while in stack development mode. But is there no way for a *standalone* to find out its own version number? Given that it’s something stored internally in a plist (in a Mac app at least), it seems quite inelegant to have to roll my own. :-/

Re: Check standalone version?

Posted: Thu Nov 30, 2017 7:49 pm
by Klaus
Hi Keith,

looks like I misunderstood you, you mean the infos you entered in the "Standalone builder settings", right?

They are stored in a custom property set in your stack -> cRevStandaloneSettings
Check what is in there and then you can use e.g.:
...
put the cRevStandaloneSettings["OSX,shortVersion"] of stack "your stack here" into tCurrentVersion
...

Best

Klaus

Re: Check standalone version?

Posted: Thu Nov 30, 2017 7:56 pm
by thatkeith
Fantastic! I’ll check that out, it sounds perfect.

Re: Check standalone version?

Posted: Thu Nov 30, 2017 8:06 pm
by FourthWorld
Klaus wrote:
Thu Nov 30, 2017 7:49 pm
Hi Keith,

looks like I misunderstood you, you mean the infos you entered in the "Standalone builder settings", right?

They are stored in a custom property set in your stack -> cRevStandaloneSettings
Check what is in there and then you can use e.g.:
...
put the cRevStandaloneSettings["OSX,shortVersion"] of stack "your stack here" into tCurrentVersion
...
Unless something has changed, I believe the IDE's standalone settings are removed from the stack in the resulting build.

I use a custom prop for version info.

Re: Check standalone version?

Posted: Thu Nov 30, 2017 9:07 pm
by bogs
I think they are talking about these settings, Richard -

Image

Although I wouldn't mind being sure where to find the info you put there myself, as well as having it auto-increment the version for me :twisted: I think for ease on my part I'd also use a cprop for this, and setup a script to auto-increment it, possibly on save.

Of course, I'm usually far too lazy for that, I just wait till release and count up the number of 'built' folders :roll:

Re: Check standalone version?

Posted: Fri Dec 01, 2017 12:44 am
by FourthWorld
bogs wrote:
Thu Nov 30, 2017 9:07 pm
I think they are talking about these settings, Richard -

Image
Yep, those are the ones. The IDE uses them to build standalones. Last time I check those properties are not present in the standalones built.

Re: Check standalone version?

Posted: Fri Dec 01, 2017 4:37 am
by bogs
FourthWorld wrote:
Fri Dec 01, 2017 12:44 am
Yep, those are the ones. The IDE uses them to build standalones. Last time I check those properties are not present in the standalones built.
Hmm. I dunno, when I look at the standalone made (for mac, as that pictures settings showed), those settings are going into the plist, so the xml should be able to be parsed to retrieve the info you put in in standalone settings.
Image
I wonder if it might actually be storing this info in the standalone somewhere. The win standalone looks like a similar (but monolithic) structure -
Image
I didn't bother trying to sort through that mess :wink:

Whether it does or no, at least for the mac, you could pull that information from the plist file, thatkeith. But if you want consistency thats easy to code, either of Klaus's and Richard's answers, (cprop, anyway) work easier.

Re: Check standalone version?

Posted: Fri Dec 01, 2017 12:10 pm
by thatkeith
Klaus wrote:
Thu Nov 30, 2017 7:49 pm
put the cRevStandaloneSettings["OSX,shortVersion"] of stack "your stack here" into tCurrentVersion
Bingo! Thanks Klaus, that's it. I won't have to remember to keep my own custom record of the standalone version in sync with reality, I can check against the value stored in the standalone automatically.

k

Re: Check standalone version?

Posted: Fri Dec 01, 2017 6:21 pm
by jacque
@Keith, what Richard said is true. The standalone settings are used to build the standalone (and to create the plist file) but are not included in the standalone itself. The info you want will return empty in the app.

I also use a custom property to store the current version, which does get saved into the standalone. Or you could read the plist file. I have used the standalone settings in a "savingStandalone" handler sometimes to automatically update the version property during a build.

Re: Check standalone version?

Posted: Fri Dec 01, 2017 7:31 pm
by thatkeith
Ah, thanks everyone. I'm now using a custom prop as advised.

Re: Check standalone version?

Posted: Wed May 08, 2019 3:13 pm
by Zax
I used to use a custom property but, when building an update, I have to modify the standalone settings and the custom property.
I would be easier to retreive version number grom the .plist file, but ~/Library/Preferences/myStandalone.plist, built with Indy 9.03, looks like this:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>NSNavLastRootDirectory</key>
	<string>/Volumes/SSD/SOUK</string>
	<key>NSNavPanelExpandedSizeForOpenMode</key>
	<string>{712, 681}</string>
	<key>NSNavPanelExpandedSizeForSaveMode</key>
	<string>{712, 521}</string>
	<key>NSNavPanelExpandedStateForSaveMode</key>
	<true/>
</dict>
</plist>
There is no version node :(
But when I'm asking infos about myStandalone app from the Finder, its version is correctly displayed.

Maybe I'm looking into a "wrong" plist file? Is there another plist file?

Thank you.

Re: Check standalone version?

Posted: Wed May 08, 2019 6:54 pm
by jacque
The plist you need is inside the app bundle, inside the Contents folder.

Re: Check standalone version?

Posted: Thu May 09, 2019 8:43 am
by Zax
OK, thank you Jacqueline.
I think I will continue to manage version in a custom property!