Haskell Platform - changing the global install dir

I've installed the Haskell Platform to a non-default location (D:\Apps\Haskell) to avoid some of the Win7 funniness over writing to C:\Program Files. However, even though I've done this, the cabal global install directory is still C:\Program Files\haskell. This has been added to my PATH and is used by default. Is there a way I could have specified that I want the global install directory in D:\Apps\Haskell? I guess I could hack my cabal\config file (and presumably change PATH) but that seems a bit ugly. Is the use of Program Files even when the install was to somewhere else a bug? It's not a big deal - I can easily stick to user installs for now. Thanks, Paul.

Hi Paul, Paul Moore
Is there a way I could have specified that I want the global install directory in D:\Apps\Haskell? I guess I could hack my cabal\config file (and presumably change PATH) but that seems a bit ugly.
A bit ugly? Why? That's precisely what the config files are for.
Is the use of Program Files even when the install was to somewhere else a bug?
Not really, the Windows installer just doesn't tinker with the default cabal-install install location. There are plans, though, to implement an "install only for the current user" mode for the next release.

2009/10/6 Mikhail Glushenkov
Hi Paul,
Paul Moore
writes: Is there a way I could have specified that I want the global install directory in D:\Apps\Haskell? I guess I could hack my cabal\config file (and presumably change PATH) but that seems a bit ugly.
A bit ugly? Why? That's precisely what the config files are for.
The "ugliness" (a bad word, I agree) was the need to change multiple items - (at least) 2 places in the config file and (presumably) the PATH entry. Is that all I need to change? Actually, on a related note, is there documentation on cabal I should have found which contains the information on how to do this?
Is the use of Program Files even when the install was to somewhere else a bug?
Not really, the Windows installer just doesn't tinker with the default cabal-install install location. There are plans, though, to implement an "install only for the current user" mode for the next release.
OK. But given that I said "install Haskell" in *this* location, I sort of expected all my Haskell stuff to go there. But thanks for the information, I can fix this now. Paul.

Hi Paul, On Tue, Oct 6, 2009 at 9:11 AM, Paul Moore
The "ugliness" (a bad word, I agree) was the need to change multiple items - (at least) 2 places in the config file and (presumably) the PATH entry.
Is that all I need to change?
I'm not a Cabal expert, but it looks like you could just change the "user-install" setting to True (and alter the PATH variable accordingly) to achieve what you want.
OK. But given that I said "install Haskell" in *this* location, I sort of expected all my Haskell stuff to go there.
You have a point, maybe we'll change this in the next release. I've filed a ticket [1]. [1] http://trac.haskell.org/haskell-platform/ticket/97 -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments

2009/10/6 Mikhail Glushenkov
Hi Paul,
On Tue, Oct 6, 2009 at 9:11 AM, Paul Moore
The "ugliness" (a bad word, I agree) was the need to change multiple items - (at least) 2 places in the config file and (presumably) the PATH entry.
Is that all I need to change?
I'm not a Cabal expert, but it looks like you could just change the "user-install" setting to True (and alter the PATH variable accordingly) to achieve what you want.
I can do a user install using cabal install --user and that works fine. It's just the global one that hits the permission issue. As I'm the only user on the PC, it doesn't make much difference which I use in practice :-)
OK. But given that I said "install Haskell" in *this* location, I sort of expected all my Haskell stuff to go there.
You have a point, maybe we'll change this in the next release. I've filed a ticket [1].
Thanks - I hadn't realised there was a bug tracker for the Haskell Platform. Paul.

2009/10/6 Mikhail Glushenkov
Hi Paul,
Paul Moore
writes: Is there a way I could have specified that I want the global install directory in D:\Apps\Haskell? I guess I could hack my cabal\config file (and presumably change PATH) but that seems a bit ugly.
A bit ugly? Why? That's precisely what the config files are for.
Looks like it also doesn't work :-(
grep global -A7 "D:\Documents and Settings\uk03306\Application Data\cabal\config" install-dirs global -- prefix: "D:\\Apps\\Haskell\\Cabal" -- bindir: $prefix\bin -- libdir: $prefix -- libsubdir: $pkgid\$compiler -- libexecdir: $prefix\$pkgid -- datadir: "D:\\Apps\\Haskell\\Cabal" -- datasubdir: $pkgid
cabal install mersenne-random -fuse_sse2 Resolving dependencies... Downloading mersenne-random-1.0... Configuring mersenne-random-1.0... Preprocessing library mersenne-random-1.0... Building mersenne-random-1.0... [1 of 1] Compiling System.Random.Mersenne ( System\Random\Mersenne.hs, dist\build\System\Random\Mersenne.o ) D:\Utils\Mingw\bin\ar.exe: creating dist\build\libHSmersenne-random-1.0.a Installing library in C:\Program Files\Haskell\mersenne-random-1.0\ghc-6.10.4 Registering mersenne-random-1.0... Reading package info from "dist\\installed-pkg-config" ... done. Writing new package config file... done.
Note - "Installing library in C:\Program Files\Haskell\mersenne-random-1.0\ghc-6.10.4"
cabal --version cabal-install version 0.6.2 using version 1.6.0.3 of the Cabal library
http://hackage.haskell.org/trac/hackage/ticket/365 may be relevant, but it says it's fixed :-( Paul

Paul Moore wrote:
grep global -A7 "D:\Documents and Settings\uk03306\Application Data\cabal\config" install-dirs global -- prefix: "D:\\Apps\\Haskell\\Cabal" ^^^ You should remove the '-- '. Lines beginning with '--' are comments. So this line has no effect.
HTH, Bertram

2009/10/6 Bertram Felgenhauer
Paul Moore wrote:
grep global -A7 "D:\Documents and Settings\uk03306\Application Data\cabal\config" install-dirs global -- prefix: "D:\\Apps\\Haskell\\Cabal" ^^^ You should remove the '-- '. Lines beginning with '--' are comments. So this line has no effect.
Ah, that worked. Thanks. Paul.
participants (3)
-
Bertram Felgenhauer
-
Mikhail Glushenkov
-
Paul Moore