Appendix B. Compiling bbackupd on Windows using Visual C++

Table of Contents

Tools
Visual C++
Perl
Libraries
Download Box Backup
Configure Box Backup
Compile Box Backup
Install Box Backup
Windows Service

This Appendix explains how to build the bbackupd daemon for Windows using the Visual C++ compiler.

If you have any problems following these instructions, please sign up to the mailing list and report them to us, or send an email to Chris Wilson. Thanks!

Note: bbstored will not be built with this process. bbstored is not currently supported on Windows. There are no plans for bbstored support on Windows.

Tools

You will need quite a bit of software to make this work. All of it is available for free on the Internet, although Visual C++ Express has license restrictions and a time limit.

Visual C++

Microsoft's Visual C++ compiler and development environment are part of their commercial product Visual Studio. Visual Studio 2005 is supported, and 2003 should work as well.

You can also download a free copy of Visual C++ 2005 Express. This copy must be registered (activated) within 30 days, and is free for one year.

You will need the Platform SDK to allow you to compile Windows applications.

Perl

Download and install ActivePerl for Windows, which you can probably find here.

Libraries

You will need to download and install several libraries. They must all be built in the same directory, to be able to link properly.

Choose a directory where you will unpack and compile OpenSSL, Zlib and Box Backup. We will call this the base directory. An example might be:

C:\Documents and Settings\Your Username\Desktop\Box

Make sure you know the full path to this directory.

OpenSSL

You will need to compile OpenSSL using Visual C++. The latest release at this time, OpenSSL 0.9.8a, does not compile with Visual C++ 2005 out of the box, so you need a patched version. The original source and patch are also available.

To compile OpenSSL:

  • Use a Windows unzipper such as WinZip (free trial) to extract the openssl-0.9.8a-vc2005.tar.gz archive, which you just downloaded, into the base directory.

  • Rename the folder from openssl-0.9.8a-vc2005 to openssl

  • Open a command shell (run cmd.exe) and cd to the openssl directory

  • Run the following commands:

    perl Configure VC-WIN32
    ms\do_ms
    "c:\program files\Microsoft Visual Studio 8\Common7\Tools\vsvars32.bat"
    nmake -f ms\ntdll.mak

Zlib

You will need to download the Zlib compiled DLL. Create a directory called zlib in the base directory, and unzip the file you just downloaded into that directory. You don't need to compile anything.

Download Box Backup

The first version of Box Backup that's known to compile and with Visual C++ 2005 is available on the Subversion server. However, this version has not been extensively tested and may be out of date.

The changes are expected to be merged into the Subversion trunk at some point, and this page should then be updated. If in doubt, please sign up to the mailing list and ask us.

To get the source code out of Subversion you will need a Subversion client for Windows. After installing it, open a new command prompt, go to the base directory, and type:

svn co http://www.boxbackup.org/svn/box/chris/win32/vc2005-compile-fixes/ boxbackup

This should create a directory called boxbackup inside the base directory.

Configure Box Backup

Open a command prompt, change to the base directory then boxbackup, and run win32.bat to configure the sources. Otherwise, Visual C++ will complain about missing files whose names start with autogen, and missing config.h.

Compile Box Backup

Open Visual C++. Choose "File/Open/Project", navigate to the base directory, then to boxbackup\infrastructure\msvc\2005 (or 2003 if using Visual Studio 2003), and open any project or solution file in that directory.

Press F7 to compile Box Backup. If the compilation is successful, boxbackup\Debug\bbackupd.exe will be created.

Install Box Backup

Create the destination directory, C:\Program Files\Box Backup\bbackupd.

Write a configuration file, keys and certificate on a Unix machine, and copy them into the Box Backup directory, together with the following files from the base directory:

  • boxbackup\Debug\bbackupd.exe

  • openssl\out32dll\libeay32.dll

  • openssl\out32dll\ssleay32.dll

  • zlib\zlib1.dll

Ensure that the user running Box Backup can read from the Box Backup directory, and write to the bbackupd directory inside it.

Run Box Backup by double-clicking on it, and check that it connects to the server. If the window opens and closes immediately, it's probably due to a problem with the configuration file - check the Windows Event Viewer for details.

Windows Service

Box Backup can also run as a Windows service, in which case it will be automatically started at boot time in the background. To install this, open a command prompt, and run:

cd "C:\Program Files\Box Backup"
bbackupd.exe -i

This should output Box Backup service installed.