Page 1 of 1

How to update a standalone

Posted: Wed Jan 21, 2015 11:59 am
by D4vidrim
Hi,
I'm looking for some tips in order to create an app with a "check for update" function.

I've read I could use the "splash screen" method described here:
http://lessons.runrev.com/s/lessons/m/4 ... pplication

What I cannot find a way to get the version of the current standalone file and compare it to the file I saved on our LAN (I'm going to save the "Main Application file" there): is there a function or a property to use?

Thanks!

Re: How to update a standalone

Posted: Thu Jan 22, 2015 4:18 pm
by Klaus
Hi David,

are we talking about the version of the engine that standalone was built with?

If we are talking about separate stack files, then there are no functions etc.
you need to manage that by yourself! :D

Add a custom property to your stack(s) -> cVersion or whatever, then you can always check this property
and decide to download a newer version or not.

You can check any property of a CLOSED stack file by:
...
## Example:
## Get latest available version number from server
put url"http:///www.yourserver.com/newestversion.txt") into tNewerVersion

## Get version number of current stack on users hd
put specialfolderpath("documents") & "/myupdatablestack.livecode" into tCurrentStack
put the cVersion of stack tCurrenstack into tCurrentVersion

## IMPORTANT: To avoid having 2 stacks with the same name after updating (LC does NOT like that!)
close stack tCurrentStack

## Now do your comparison and act accordingly :D
if tNewerVersion > tCurrentVersion then
## download new stack and put it into users documents folder!
...


Best

Klaus