You could try SET USERPROFILE=%~dp0
while making sure that the folder structure supports what Cabal expects. It is probably attempting to go to %USERPROFILE%AppData\Roaming
or something similar.
How to change path of ghc?
-
09-03-2022 - |
Question
I'm using HaskellPlatform-2012.4.0.0 on Win7. It's installed as portable. Paths are managed through .bat file so ghci and ghc works. Cabal config and folder are made semi-portable with this.
The problem is ghc
folder. It installs itself in C:\Users\name\AppData\Roaming\ghc\i386-mingw32-7.4.1.
How to change it's default path? So I can have really portable Haskell on windows :)
EDIT: There are 3 new system variables that do nothing. Here are results:
SET APPDATA=%~dp0AppData -- has no effect. ghc is still made in roaming
SET USERPROFILE=%~dp0 -- kills cabal
SET LOCALAPPDATA=%~dp0Local --not sure if this is ever used.
Solution
OTHER TIPS
You can use symbolic links mklink /D linkName target
/D means directory symlink. This command available since Windows Vista/2008+
cd C:\Users\myself\AppData\Roaming
mklink /D cabal C:\installed\cabal
mklink /D ghc C:\installed\ghc
More info on symlinks http://en.wikipedia.org/wiki/NTFS_symbolic_link
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow