Build Procedures

Follow these steps to build the System.Data.SQLite (SDS) binaries. Unless otherwise noted, all steps need to be done in the order specified.

You will need a Visual Studio 2008, 2008 SP1, 2010, or 2010 SP1 development environment for this build.

The new build system has been setup using modular solution, project, and property files.

In general, files with 2008 in the name (e.g. SQLite.Interop.2008.vcproj) or files ending in .vsprops are project and property files for the Visual Studio 2008 solution. Files with 2010 in the name (e.g. SQLite.Interop.2010.vcxproj) or files ending in .props are property and project files for the Visual Studio 2010 solution. When making changes, you should make changes to both to keep them in sync.

You can either [./build.wiki#manual | manually build] the System.Data.SQLite binaries using one of the supplied Visual Studio solutions or follow the steps outlined in the [./build.wiki#automated | Automated Build] section below.

Build Assumptions & Prerequisites

  1. We want to ship managed binaries that rely on the .NET Framework 2.0 SP2 (or for the LINQ assembly, the .NET Framework 3.5 SP1). The .NET Framework 2.0 is very widely deployed and binaries produced for it can also be referenced and used successfully from projects using the .NET Framework 4.0.
  2. We want to ship native binaries that rely on the Visual C++ 2008 Runtime.
  3. We want to ship the separate managed-only System.Data.SQLite assembly and the SQLite.Interop.dll native library. This will make it easier to maintain and deploy the included core SQLite code (in the "SQLite.Interop.dll" native library). We also want to ship the "monster DLL" (i.e. the "mixed-mode" System.Data.SQLite assembly that includes all the necessary native and managed code). This will make it easier for developers that wish to register the assembly in the Global Assembly Cache (GAC).
  4. The machine used to prepare the official releases will have the [http://www.microsoft.com/downloads/en/details.aspx?FamilyID=ab99342f-5d1a-413d-8319-81da479ab0d7 | .NET Framework 3.5 SP1] and the corresponding [http://www.microsoft.com/downloads/details.aspx?FamilyId=E6E1C3DF-A74F-4207-8586-711EBE331CDC | SDK] installed.
  5. The machine used to prepare the official releases will have [http://www.jrsoftware.org/isdl.php | Inno Setup 5.4.2] or higher installed in "%ProgramFiles%\Inno Setup 5" or "%ProgramFiles(x86)%\Inno Setup 5" for an 64-bit machines. Alternatively, the InnoSetup directory may be included in the PATH environment variable.
  6. The string "<root>" represents the root of your source tree for System.Data.SQLite.
  7. The string "<year>" represents the version of Visual Studio being used (e.g. 2008).

All Builds

  1. Make sure the version information is correct for SQLite in all of the following files: You'll need to update the SQLITE_MANIFEST_VERSION and SQLITE_RC_VERSION properties. This version number should track the release versions of SQLite (i.e. [http://www.sqlite.org/changes.html | 3.7.x]).
  2. Make sure the version information is correct for System.Data.SQLite in the following files: You'll need to update the INTEROP_BUILD_NUMBER, INTEROP_MANIFEST_VERSION, and INTEROP_RC_VERSION properties in the .vsprops and .props files, and the INTEROP_VERSION define in interop.h. This version number should track the release versions of the System.Data.SQLite packages (i.e. [./news.wiki | 1.0.x]).

Manual Build

  1. Complete the steps outlined in the [./build.wiki#all | All Builds] section (above).
  2. Open the appropriate solution for your build platform.
  3. Select the desired solution configuration (e.g. ReleaseNativeOnly) and and solution platform (e.g. x64), then "Build->Rebuild Solution". Alternatively, you can select "Build->Batch Build", "Select All", and then "Rebuild".

Automated Build

  1. Complete the steps outlined in the [./build.wiki#all | All Builds] section (above).
  2. Make sure the "<root>\bin" and "<root>\obj" directories are completely free of all output files. In theory, you should be able to simply delete these directories.
  3. Open a normal command prompt window with "cmd.exe".
  4. Change the current directory to "<root>\Setup".
  5. Enter the following command to build the binaries for Win32 (x86): build.bat ReleaseNativeOnly Win32
    You may need to enter the command "setenv /x86" first if you are using a "Windows SDK Command Prompt" or "Visual Studio Command Prompt" window.
  6. Make sure everything succeeds with no errors; the log file "%TEMP%\System.Data.SQLite.Build_ReleaseNativeOnly_Win32_<year>_Unknown.log" may be checked if any errors should occur.
  7. Enter the following command to build the binaries for x64: build.bat ReleaseNativeOnly x64
    You may need to enter the command "setenv /x64" first if you are using a "Windows SDK Command Prompt" or "Visual Studio Command Prompt" window.
  8. Make sure everything succeeds with no errors; the log file "%TEMP%\System.Data.SQLite.Build_ReleaseNativeOnly_x64_<year>_Unknown.log" may be checked if any errors should occur.
  9. Enter the following command to build the setup binaries for all supported build configurations (unfortunately, it is not possible to build the setup using the InnoSetup IDE. It must be done using the provided command line tools due to its highly dynamic nature): bake_all.bat
  10. Make sure everything succeeds with no errors. InnoSetup should produce "success" messages very similar to the following: Successful compile (X.XXX sec). Resulting Setup program filename is: abc