setup

Warren Young wyml@etr-usa.com
Mon Aug 10 15:02:00 GMT 2015


> On Aug  7 15:05, Warren Young wrote:
>> 
>> You’d have to couple this either with a MoveFileEx(…,
>> MOVEFILE_DELAY_UNTIL_REBOOT) call or a background task that replaces
>> /bin/setup.exe with %LOCALAPPDATA%/Temp/setup-v$next.exe.
> 
> Why?

I was assuming a world where setup.exe lives in /bin and you can call it from Bash.  (In such a world, I hope it gets renamed to something less generic, like cygpkg.)  I was further assuming that setup-*.tar.xz would be packaged the same as any other Cygwin package, unpacking directly into /bin.

Thus, the MoveFileEx() call would be the one setup.exe normally offers, where it sees you’re trying to replace an in-use executable.

I was offering the background task alternative as a way around that.  However, the rest of your reply gives me a different idea.

> The idea is that setup is called, performs a CopyFile of itself
> and then exec's its copy.

If you mean that it always copies itself to some kind of temp space and execs it from there, that feels kind of wasteful, since you’re trading my design that copies only when required for one that copies every time.

But what if we invert it?  Why couldn't setup-*.tar.xz package unpack into /tmp?  The running setup.exe would exec it there with a flag that causes the second setup.exe instance to copy itself back into /bin.  Then there is only a copy made when setup.exe is actually being replaced, and /bin/setup.exe is kept up-to-date.


More information about the Cygwin-apps mailing list