Developing cabal2wix - building Windows installers automatically

Esa Ilari Vuokko eivuokko at gmail.com
Sun Aug 5 18:05:21 EDT 2007


Hi,

I decided to try to build a cabal -> wix converter, cabal2wix, to make
it easier to generate Windows installers for cabal-packages.  My main
target is ghc-compiled libraries.  There are few issues I've ran into
and I'd appreciate any comments on them.

I'll try to publish the darcs repo somewhere if there's interest.

Some of the issues are gray, as I don't understand all the details
myself, and reading Cabal's code isn't very enlightening.

Issue 1:
 Cabal puts (at least) docs under Program Files\Common Files - this
separates docs from other parts of the program by logical placing,
which is pretty annoying if you need to offer way to relocate
installation (say to user's home directory).  I am considering moving
docs next to library files in installers cabal2wix generates.

Issue 2:
 setup copy --destdir=foo is confusing in Windows.  If my prefix is
c:\Program Files (like it is if I run configure without options),
the directory structure after copy is foo\Program Files - ie. unsuable
locally because drive letter is missing, and unusable at remote
locations, because Program Files is not localized.
 I'd like not to use all possible directory flags at configure time,
because it is impossible to know how different packages react to them.
(currently cabal2wix assumes no directories were changed.)

Suggestion: Make copy-hook unable to copy random files on their own,
this way there could be setup copy --list-links, which would be
nicer, IMHO.  As the list could also differentiate between different
types of files.  Profiling lib, shared libs (dev and end-user
installer in one.)

Issue 3:
 Currently cabal2wix reads dist\setup-config to find out package and
compiler information.  This is pretty stupid, as LocalBuildInfo
structure might not be that stable, and cabal2wix can only guarantee
working with the same Cabal it was built with.
 cabal2wix could read installed-pkg-config (and maybe .cabal) to get
package name and version.  But I can't see how to get compiler
information from any other place than setup-config.

It'd also make sense to read solved build-depends info, but I currently
don't have plans to do that.

Issue 4:
 There is no proper registry keys for finding compiler installation.
Neil's installer adds HKCU\Software\Haskell\GHC\InstallDir.  I'd much
prefer if the registry key path contained ghc version in it, and
HKLM might be preferable on some multi-user machines.  It'd be great
if we could find recommended location for this info.  (And use it for
ghc 6.8 releases)

My tentative proposal:  Use HKLM if "all users" install, HKCU otherwise.
Use \Software\Haskell\COMPILER\VERSION\InstallDir for storing path to
base location of installed compiler.  (i.e. it shouldn't point to
bin-directory.)

Small issues:
 * License file is not installed.
 * Docs need relinking at install location, that's a bit annoying.

Big thank you for Duncan and Ian for useful comments at irc.  Issue list
is shorter now ;-)

Thanks,
Esa


More information about the cabal-devel mailing list