patch applied (cabal-install): Allow cabal-install to re-install itself on Windows

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Tue Aug 12 18:16:55 EDT 2008


Tue Aug 12 14:51:38 PDT 2008  Duncan Coutts <duncan at haskell.org>
  * Allow cabal-install to re-install itself on Windows
  This is a fairly heavyweight solution, but then it's quite
  a nasty problem. What we do is when we notice that we're
  about to install something in place of our own .exe file,
  we move our exe file out of the way (but in the same dir).
  Then after we've installed the new exe we call it and ask
  it to delete the old file (so we do not litter the bin dir
  with lots of old versions). That requires synchronising
  between the old and new programs and for the new program
  to understand a command to do the syncing and deleting of
  the old program. Lots of Win32 FFI imports. :-(
  On the plus side it seems to work and is transparent to
  the user and the rest of cabal-install. In particular the
  actual file-installation code (which is burried deep
  within Cabal) does not need to know about the special case
  of installing over our own exe file.

    M ./Distribution/Client/Install.hs -10 +55
    A ./Distribution/Client/Win32SelfUpgrade.hs
    M ./Main.hs -2 +16
    M ./cabal-install.cabal +1

View patch online:
http://darcs.haskell.org/cabal-install/_darcs/patches/20080812215138-adfee-c679215fe52e97e13c5b96d5f0a5f310355bb682.gz



More information about the cabal-devel mailing list