1. Updating Software
- Posted by euphoric (admin) Dec 07, 2011
- 1079 views
What strategy is used to keep programs automagically up-to-date? I'm talking about programs like Chrome, Firefox, etc., that can notify you if there is an update available and then install the new update for you.
My guess:
The program, once started, checks an Internet resource and simply compares its version ID with the latest version ID as published at the Internet resource. If they're different, notify the user or perform the update.
How are patches automagically applied in cases like this where the program to be patched is running? Does it close itself after spawning a separate updater program?
Thanks!
3. Re: Updating Software
- Posted by petelomax Dec 08, 2011
- 1057 views
How are patches automagically applied in cases like this where the program to be patched is running? Does it close itself after spawning a separate updater program?
That would be my guess too. When Phix self-hosts, ignoring the first four safety-check rounds, p.exe builds pw.exe and then invokes pw.exe (-pmkr5) which waits until p.exe is closed before overwriting it. A simple handshake, the relevant code is quite trivial:
procedure Retry(sequence msg) puts(1,msg) sleep(1) if find(get_key(),"nN") then abort(1) end if puts(1,"\n") end procedure procedure DoOther(sequence ppw) -- ppw is either "p.exe" or "pw.exe". integer fn, fin while 1 do fn = open(ppw,"wb") if fn!=-1 then exit end if Retry(ppw&" in use - retry?") end while while 1 do fin = open("pnew.exe","rb") if fin!=-1 then exit end if Retry("pnew.exe in use - retry?") end while OverWrite(ppw,fn,fin,0) -- -- finally, try to delete pnew.exe and pnew2.exe: -- Delete("pnew.exe") Delete("pnew2.exe") abort(0) end procedure
Regards, Pete