Szenográdi Norbert Péter ha scritto: > Hi All, > > Can I create a simple project with automatic update option? > Well, when user starting a program, program will checking a new version > from a portal etc. > If new version possible change itself and restart a new version. > > This is possible? > I think it is possible, althought it can be better to do it through a shell script. Not sure about this, but you could do something like that:
' some code to determine if a new version is available shell "cd /tmp; wget http://your.server/updates/your-program.gambas" WAIT shell "mv /tmp/your-program.gambas /usr/local/bin/" ' this rewrite the old executable shell "/usr/local/bin/your-program.gambas &" ' two instances of the same program... quit This snippet relies on a possibility that only *nix has - to [re]write a file while it is still in use (if it is). Don't know if gambas interpreter keeps the file open while executing, but this should be ininfluent. With the "shell ....&" you launch a second instance of the same program, which will be the updated file (bytecode). Then the current application terminates. There is a moment where two instances of the same application run concurrently, so open files, or other system-wide resources, must be closed before doing that. This is an overall idea - but it should work. Regards ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user