setup

Corinna Vinschen corinna-cygwin@cygwin.com
Tue Aug 11 07:48:00 GMT 2015


On Aug 10 09:02, Warren Young wrote:
> > 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.

That was the idea.

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

Setup is not called multiple times per second.  Copy and restart take
not much time, and the restart part is done already anyway as soon as
setup elevates itself.  Why not simply elevate (or just start if already
elevated) the copy called .setup-${arch}.exe?  Note the leading dot.
This copy never has the problem to be overwritten by unpacking, and the
rest of setup does not need any changes.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-apps/attachments/20150811/916d6f28/attachment.sig>


More information about the Cygwin-apps mailing list