Wednesday 26 November 2008

First shot at a couchdb installer on windows

Disclaimer: this is for the brave folks who wish to try things out. So far I've only tested the installer on my own machine and on a clean Windows XP vmware image.

Now for the running bits: here's a first try at getting a workable couchdb installer on Windows.

There were some instructions down at the wiki on how to get all the bits and bobs running together, but parts of it required a C compiler and some rather tedious setup on part of the user. It was also a bit frail, as noted by me trying for a couple of afternoons to get the unit tests to pass.

The biggest problem was that Spidermonkey must be compiled in a specific way (one that wasn't apparent to me at first), which I dismissed at first because the blog containing the steps was down. Also, one must use lowercase paths on the config file, otherwise erlang will choke when trying to open the database files.

The next step would be to create a shortcut on the start menu, get some sensical text on the installer, do some error checking to find out if the prerequisites are installed, and create an uninstaller.

For now, here's the installer for the world to try. Leave a comment if you find a problem or have a suggestion.

10 comments:

Anonymous said...

Thanks Bruno! This was the quickest way for me to get started evaluating CouchDB. I definitely appreciate your efforts. All test cases passed on Windows XP SP2.

Unknown said...

Thanks, I use this installer instead of building on windows now. Have you tried to build the trunk (0.9.x), I can't make it build due to a change in the driver using libCURL. Thanks again.

Unknown said...

ok, seems the couchdb trunk is using inline variables for js.c (or couch_js.c before the rename) as per http://andre.stechert.org/urwhatu/2006/01/error_c2143_syn.html

I will edit the file and see if this works.

Bruno said...

Hey Norm,
I haven't been following trunk, was waiting for a final release of 0.9 to look into another installer.
But if you do manage to build trunk, I can create an installer for it. With some luck it wouldn't be much work in adapting the one from .8.

Misko said...

I would love to get the latest version 0.9 of couchdb installer. Any plans on creating a new installer from head?

Bruno said...

Hey Misko,
I might give it a shot, but haven't touched couchdb in some time.
While I do plan on trying to build an installer for windows, I don't have any timeframe as to when I could do so, sorry.

Anonymous said...

Why is this so complicated, with so many 'non-standard' dependencies? Why should the install require any builds at all?
A proper release should just invlive copying some files over and doing minor configuration! I'd love to try CouchDB, but I don't want it to be an unrepeatable hit-and-miss affair.

jms said...

a few comments:

1) the version number shows up as 0.0.0

2) the configuration tab on Futon seems to be missing

3) It would be really really nice if this could be installed in a separate directory from Erlang. That's what I tried doing first and the install failed. The next time, I installed in the suggested directory and it worked OK. If the issue is that you need to know where the Erlang dir is at runtime, that seems solvable. (the installer figured it out! I have Erlang installed in a nonstandard location c:\appl\erlang)

4) is there a way to make this into a service that can be stopped/started? (rather than having an Erlang window running under a particular user's account)

I guess I am spoiled by how easy it was to install/run on Mac OS X. Thanks for porting!

Bruno said...

@Anonymous:
The biggest reason I haven't iet built a new version is that from what I can tell, the behaviour of erlang on windows isn't quite the same as on *nix platforms, so there may be some adaptations to be done.

The source code for the installer is on the page, so if anyone more knowledgable wants to try and build it, have at it.

Bruno said...

@jms:

1) Hum, oops :) Guess I forgot to set the version number on the installer. My bad.

2) really? I honestly thought it was the same as the linux version. No clue as to why that happens.

3) well, if you could tell erlang to load libs from another dir, it might work. I don't know enough about erlang to try and do such a thing. Although yes, the installer has some rudimentary smarts as to where it should be installed (erlang sets a reg key with the pag, so it's a matter of just reading it).

4) perhaps. there are some ways to get an exec to run as a service, but you might lose the console output if it isn't redirected.

Yeah, CouchDbX does spoil you :)