[Hackage] #291: cabal-install cannot re-install itself on windows

Hackage trac at galois.com
Tue Aug 12 18:13:54 EDT 2008

#291: cabal-install cannot re-install itself on windows
  Reporter:  duncan              |        Owner:           
      Type:  defect              |       Status:  closed   
  Priority:  normal              |    Milestone:  Cabal-1.4
 Component:  cabal-install tool  |      Version:  HEAD     
  Severity:  normal              |   Resolution:  fixed    
  Keywords:                      |   Difficulty:  normal   
Ghcversion:  6.8.2               |     Platform:  Windows  
Changes (by duncan):

  * status:  new => closed
  * resolution:  => fixed


 Tue Aug 12 22:51:38 BST 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.

Ticket URL: <http://hackage.haskell.org/trac/hackage/ticket/291#comment:5>
Hackage <http://haskell.org/cabal/>
Hackage: Cabal and related projects

More information about the cabal-devel mailing list