Check standalone version?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 346
- Joined: Mon Mar 01, 2010 7:13 pm
- Location: London, UK
- Contact:
Check standalone version?
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
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
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
Re: Check standalone version?
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
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
-
- VIP Livecode Opensource Backer
- Posts: 346
- Joined: Mon Mar 01, 2010 7:13 pm
- Location: London, UK
- Contact:
Re: Check standalone version?
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. :-/
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
Re: Check standalone version?
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
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
-
- VIP Livecode Opensource Backer
- Posts: 346
- Joined: Mon Mar 01, 2010 7:13 pm
- Location: London, UK
- Contact:
Re: Check standalone version?
Fantastic! I’ll check that out, it sounds perfect.
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
-
- VIP Livecode Opensource Backer
- Posts: 9834
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Check standalone version?
Unless something has changed, I believe the IDE's standalone settings are removed from the stack in the resulting build.Klaus wrote: ↑Thu Nov 30, 2017 7:49 pmHi 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
...
I use a custom prop for version info.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Check standalone version?
I think they are talking about these settings, Richard -
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 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
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 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
-
- VIP Livecode Opensource Backer
- Posts: 9834
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Check standalone version?
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.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Check standalone version?
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.FourthWorld wrote: ↑Fri Dec 01, 2017 12:44 amYep, those are the ones. The IDE uses them to build standalones. Last time I check those properties are not present in the standalones built.
I wonder if it might actually be storing this info in the standalone somewhere. The win standalone looks like a similar (but monolithic) structure -
I didn't bother trying to sort through that mess
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.
-
- VIP Livecode Opensource Backer
- Posts: 346
- Joined: Mon Mar 01, 2010 7:13 pm
- Location: London, UK
- Contact:
Re: Check standalone version?
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
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
-
- VIP Livecode Opensource Backer
- Posts: 7233
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Check standalone version?
@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.
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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 346
- Joined: Mon Mar 01, 2010 7:13 pm
- Location: London, UK
- Contact:
Re: Check standalone version?
Ah, thanks everyone. I'm now using a custom prop as advised.
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
Re: Check standalone version?
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:
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.
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>
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.
-
- VIP Livecode Opensource Backer
- Posts: 7233
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Check standalone version?
The plist you need is inside the app bundle, inside the Contents folder.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Check standalone version?
OK, thank you Jacqueline.
I think I will continue to manage version in a custom property!
I think I will continue to manage version in a custom property!