[Haskell-cafe] Cabal install on Windows 7
duncan.coutts at worc.ox.ac.uk
Mon Sep 14 14:38:03 EDT 2009
On Thu, 2009-09-10 at 15:18 +0200, Regis Saint-Paul wrote:
> One way in which cabal can be made UAC aware (and therefore request for
> elevation privileges instead of just failing) would be to embed a manifest
> in the cabal.exe. This can be done by changing the default manifest (an XML
> file) that is embedded at link time by GHC.
> However, a problem with this approach is that cabal.exe as a whole would be
> seen as needing administrator privilege, regardless of whether the setting
> is global or user. If we want to request admin privileges only when actually
> needed (i.e., when writing in a protected folder). To address this, there
> are several options:
> - have two distinct executables for cabal, cabal-global and cabal-user with
> different manifest
> - use windows API for requesting elevation during the process (ugly)
If it really has to be done, then this seems like the best approach. In
principle there's no problem with calling funky win32 functions in
Cabal, it's mostly a matter of working out what bahaviour we want and
what UAC lets us do.
> Also, the AppData folder is for application data, not for the application
> itself. I'm not sure how far one needs to go in terms of well-behaving for
> windows when it comes to multi-platform applications. I'd like to point out
> the "Application Compatibility Toolkit" which allows testing if an
> application is well behaved for vista and 7 and provides guidelines for that
> (it's a free download):
> You can use also on XP to test for vista and 7. I tried running it with
> cabal install somepackage and it points out a number of privilege errors.
Thanks for that.
> Note that if cabal was writing packages in AppData instead of "program
> files", then the problem would only surface when cabal install moves
> executable in the bin directory.
> It seems to me that the cygwin/mingw and, more generally, the GNU way of
> dealing with windows is to mainly ignore the directory structure of windows
> and install things in a separate directory chosen by the user (possibly in
> program files or elsewhere), requesting the user to manually change the path
> accordingly. That could be a solution to consider too.
Our aim is really to do things the proper way on each platform. We
follow FSH/autoconf conventions on Unix and we aim to do the right thing
on Windows and OSX. The main issue is that there's not many of us who
are familiar with what the "right thing" is on the other platforms.
More information about the Haskell-Cafe