Online Auto-Updater

Want to talk about something that isn't covered by another category?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
andres
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 68
Joined: Thu Jan 04, 2007 2:24 am

Online Auto-Updater

Post by andres » Thu May 17, 2007 6:44 pm

Hello

I read it is possible to build an application that updates itself over the internet.

I guess by downloading just the stack and storing it as a reference file.

Is there any sample code I can start from?

If not, how would you suggest me to start this project?

Regards,
Andres

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Post by BvG » Fri May 18, 2007 2:00 am

Try this:

Code: Select all

on mouseUp
  put url "http://some.url.to.a.stack.on.the.web" into x
  put x into url "binfile:stack.rev" 
  go stack "stack.rev"
end mouseUp
Alternatively you can start the stack directly from the Web:

Code: Select all

on mouseUp
  go stack url "http://some.url.to.a.stack.on.the.web"
end mouseUp
Another nice thing is, that you can start a stack from a custom property:

Code: Select all

on mouseUp
  set the downloadedStack of this stack to url "http://some.url.to.a.stack.on.the.web"
save this stack
Then later, you can start the stack from the custom property, even when shutting the program down inbetween:

Code: Select all

  go stack the downloadedStack of this stack
end mouseUp
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

andres
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 68
Joined: Thu Jan 04, 2007 2:24 am

Post by andres » Fri May 18, 2007 2:10 am

Thanks

Now I understand the different ways to load a stack from the Internet.

Then how can I save it automtically on the user's disk in order to make it part of the new updated application, so the user can run it when offline?

Regards,
Andres

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Contact:

Post by malte » Fri May 18, 2007 7:03 am

Hi Andres,

you define a path that is save to write to, like the application support folder.

see specialfolderpath in the docs. Then you use the method bvg mentioned first. (put into url "binfile:pathICanWriteTo"). On launch of your ap you check for existance of the stack on the HD:

if there is a file "pathIHaveStoredTheStack/myStack.rev" then
go stack "pathIHaveStoredTheStack/myStack.rev"
else
doDownloadMyStack
end if

All the best,

Malte

bsouthuk
Posts: 261
Joined: Fri Dec 05, 2008 7:25 pm

Re: Online Auto-Updater

Post by bsouthuk » Tue Sep 21, 2010 6:20 pm

The scripts work for me and get my stacks from the internet fine but the stack that is downloaded has database/mySQL integration which does not work even though when saving the standalone I ticked all the right boxes in the standalone settings.

Why is this?

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Re: Online Auto-Updater

Post by Janschenkel » Tue Sep 21, 2010 8:27 pm

It depends on where the MySQL server is located, and if the client IP-address is allowed direct access to the database.
Most administrators prevent remote access to database servers, to avoid security issues.

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

bsouthuk
Posts: 261
Joined: Fri Dec 05, 2008 7:25 pm

Re: Online Auto-Updater

Post by bsouthuk » Wed Sep 22, 2010 9:45 am

Hi Jan

This isnt the issue - its just when I have a splash screen which downloads my stack from the internet, the mySQL parts to the stack do not work. I was thinking I had to download the Database externals along with the stack. Or should it work when the externals are in the splash screen folder?

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Re: Online Auto-Updater

Post by Janschenkel » Wed Sep 22, 2010 11:13 am

For your 'splash' applicaion, you should switch to manually setting the inclusions in the standalone application settings, and picking the features that your other stacks will use (Dialogs, XML external, Database external with appropriate drivers, etc.) as the standalone builder will not be able to predict all the features that your non-splash stacks will need.

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

bsouthuk
Posts: 261
Joined: Fri Dec 05, 2008 7:25 pm

Re: Online Auto-Updater

Post by bsouthuk » Wed Sep 22, 2010 11:46 am

Jan - thanks for your quick response.

I have got it wrong - my stack is connecting to my database fine but the problem is that the datagrids do not respond when clicking on the rows/columns. The scroll bar moves up and down but the content inside the datagrid does not move.

This is only when I donwload the stack using a splash screen.

If I build the stack that I download as a standalone I do not have any problems with the datagrids.

Any ideas?

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

Re: Online Auto-Updater

Post by Klaus » Wed Sep 22, 2010 12:29 pm

Daniel,

please check your thread with the same name under "Talking Revolution".
Seems to be same problem here!


Best

Klaus

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Re: Online Auto-Updater

Post by Janschenkel » Wed Sep 22, 2010 1:11 pm

See this lesson entitled 'What Do I Need to Do To Deploy a Standalone With A Data Grid?'

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

Post Reply