Page 1 of 1

Online Auto-Updater

Posted: Thu May 17, 2007 6:44 pm
by andres
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

Posted: Fri May 18, 2007 2:00 am
by BvG
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

Posted: Fri May 18, 2007 2:10 am
by andres
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

Posted: Fri May 18, 2007 7:03 am
by malte
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

Re: Online Auto-Updater

Posted: Tue Sep 21, 2010 6:20 pm
by bsouthuk
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?

Re: Online Auto-Updater

Posted: Tue Sep 21, 2010 8:27 pm
by Janschenkel
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.

Re: Online Auto-Updater

Posted: Wed Sep 22, 2010 9:45 am
by bsouthuk
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?

Re: Online Auto-Updater

Posted: Wed Sep 22, 2010 11:13 am
by Janschenkel
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.

Re: Online Auto-Updater

Posted: Wed Sep 22, 2010 11:46 am
by bsouthuk
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?

Re: Online Auto-Updater

Posted: Wed Sep 22, 2010 12:29 pm
by Klaus
Daniel,

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


Best

Klaus

Re: Online Auto-Updater

Posted: Wed Sep 22, 2010 1:11 pm
by Janschenkel
See this lesson entitled 'What Do I Need to Do To Deploy a Standalone With A Data Grid?'

Jan Schenkel.