This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: setup


> 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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]