Software updater

Hello,

I’ve looked in this forum but couldn’t find an really good answer.

I would like to have an software update inside my applescript studio application.

The updater I now have is that it looks in an MySQL database and compares his own verion number with the latest in MySQL. If the number in MySQL is newer then it will look for the link to this file. I open this link with ‘do shell script open ’ And safari will startup and download the latstest version.

Now I would like to do something else.
After the programm has noticed that there is an newer version of himself then I would like to update the programm by itself.
Is it possible that I run an new application inside the package of the application that’s needed to be updated (same depth as the folder contents). this updater program close the big program, download the application by an unix tool and replace the contents folder. As last stap run the application again only this should be the latest version.

greetings bastiaan