• Welcome to Valhalla Legends Archive.
 

New Version Download

Started by Grok, September 08, 2004, 04:40 PM

Previous topic - Next topic

Grok

What mechanisms are any of you using to download a new version of your program and launch it for the user, replacing the running version?

Grok1.exe launches, checks \\server1\Grok1.exe for version number.
Grok1.exe downloads new version,
  closes itself,
  overwrites old version with new one,
  then launches Grok1.exe again.

Is anyone doing something similar with your bots?

Skywing

#1
The easiest way is to rename whatever executables and then copy in the new versions.

Executables are opened for FILE_SHARE_DELETE on NT, so you can rename them while they are in use.  Delete them after starting the new process.

Yoni

BNLS does something approximately the same (except it updates itself manually - on admin command, and not automatically).

On real (NT based) Windows, an exe can be renamed while it's running. So when an admin requests an update, BNLS renames BNLS.exe to "BNLS <current date and time>.exe" (without closing). Then it copies the new BNLS.exe to the BNLS directory. Then it spawns a new process that stops and restarts the BNLS service.

iago

On Linux, I have a shellscript that can be executed indepdantly of the program, which downloads/compiles from source/stops/starts the "service".  It's not the best way of doing it, in my opinion, but it works well for me, since I have the script do a lot of other things (update downloads page, update documentation, etc.)
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*