Right, the problem is that under windows 7 and vista the Program Files folder if not “yours” as in you don’t have direct permission to write there without elevation.

You could go to the Haskell folder, and grand your current user full rights, but any new tools installed will inherit the original and not modified permission (I believe).

 

The other approach I like much better is instead of doing global installs, do user installs. In fact, I made it my default. Which solves any permission error, but means every user on that machine has to install the libs separately which shouldn’t be a problem if you’re the only one.

 

To do this go to C:\Users\<username>\AppData\Roaming\cabal\ and open the file “config” in a text editor and inside that, uncomment the bit that says “user-install: True”

 

That should do it.

 

From: haskell-cafe-bounces@haskell.org [mailto:haskell-cafe-bounces@haskell.org] On Behalf Of Ralph Hodgson
Sent: Monday, May 17, 2010 09:51
To: haskell-cafe@haskell.org
Subject: RE: [Haskell-cafe] Windows 7 Permission Denied Problem on Cabal

 

Providing more evidence of the issue by running cabal with -v flag:

 

...

...

Linking...

C:\Program Files (x86)\Haskell Platform\2009.2.0.2\bin\ar.exe -r dist\build\libHSCabal-1.8.0.4.a dist\build\Distribution\Compiler.o dist\build\Distribution\InstalledPackageInfo.o

...

...

...

Registering Cabal-1.8.0.4...

C:\Program Files (x86)\Haskell Platform\2009.2.0.2\bin\ghc-pkg.exe update - --global --no-user-package-conf --package-conf=dist\package.conf.inplace

Creating C:\Users\Ralph\AppData\Local\Temp\Cabal-1.8.0.411920\Cabal-1.8.0.4\dist\setup(and its parents)

C:\Users\Ralph\AppData\Local\Temp\Cabal-1.8.0.411920\Cabal-1.8.0.4\dist\setup\setup.exe install --verbose=2

directory dist\doc\html\Cabal does exist: False

Creating C:\Program Files (x86)\Haskell\doc\Cabal-1.8.0.4 (and its parents)

setup.exe: permission denied

cabal: Error: some packages failed to install:

Cabal-1.8.0.4 failed during the final install step. The exception was:

exit: ExitFailure 1

cabal-install-0.8.2 depends on Cabal-1.8.0.4 which failed to install.

 

C:\Users\Ralph>

 

From: haskell-cafe-bounces@haskell.org [mailto:haskell-cafe-bounces@haskell.org] On Behalf Of Ralph Hodgson
Sent: Monday, May 17, 2010 12:18 AM
To: haskell-cafe@haskell.org
Subject: [Haskell-cafe] Windows 7 Permission Denied Problem on Cabal

 

Following a successful install of the Haskell Platform on MAC OSX,  I proceed to update my Windows PC.

 

Frustration followed. I am blocked by a "Permission Denied" error when I do a "Setup install":

 

>ghc --make Setup

[58 of 58] Compiling Main             ( Setup.hs, Setup.o )

Linking Setup.exe ...

 

>Setup configure

Configuring Cabal-1.8.0.4...

 

>Setup build

Preprocessing library Cabal-1.8.0.4...

Building Cabal-1.8.0.4...

Registering Cabal-1.8.0.4...

 

>Setup install

Setup: permission denied

 

> 

 

I changed the permission on folders in the "Haskell Platform" directories to "full control", without any effect.

 

I have searched the web for help but  could not find my problem. Can't help but think it is something trivial but what?

 

Help appreciated.

 

Ralph Hodgson, @ralphtq