How to update a standalone

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
D4vidrim
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 61
Joined: Fri May 31, 2013 9:32 am

How to update a standalone

Post by D4vidrim » Wed Jan 21, 2015 11:59 am

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!

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: How to update a standalone

Post by Klaus » Thu Jan 22, 2015 4:18 pm

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

Post Reply