# Compiling GZDoom Builder

## Required software:

- Visual C# 2008 Express Edition or newer with .net Framework 3.5 support. You can download it for free from http://msdn.microsoft.com/vstudio/express/. Alternatively, you can use Visual Studio 2008 or newer with .net Framework 3.5 support.

## Optional software:

- Subversion command-line client. For example, Tortoise SVN (http://tortoisesvn.net).
  Notice: when installing Tortoise SVN, make sure to select "command line client tools" option.
- 7-zip archiver (www.7-zip.org).
- Inno Setup 5 or newer (http://www.jrsoftware.org/isinfo.php).
- Microsoft HTML Help compiler (http://www.microsoft.com/en-us/download/details.aspx?id=21138).
- SlimDX Developer SDK (http://slimdx.org/download.php).
- DirectX SDK (https://www.microsoft.com/en-us/download/details.aspx?id=6812).

## Obtaining the source:

The GZDoom Builder source code is hosted on SourceForge and is available through SVN at the following location:

    https://svn.code.sf.net/p/doombuilder/code/branches/GZDoomBuilder

If you don't want to use a SVN client, head to https://sourceforge.net/p/doombuilder/code/HEAD/tree/branches/GZDoomBuilder/ and press "Download Snapshot" button.

## Quick start guide:

This guide assumes you are using Visual Studio 2008 / Visual C# 2008 Express Edition and Tortiose SVN.

1. Create an empty folder, right click on it and choose "SVN Checkout..." from the context menu.
2. Enter "https://svn.code.sf.net/p/doombuilder/code/branches/GZDoomBuilder" in the "URL of repository" field and click OK.
3. Open "Builder.sln" in the Visual Studio and make sure it compiles and runs (click the green "Play" button, or press F5).
   - If the Visual Studio complains about missing SlimDX reference in the Builder project, you'll need to re-add it manually. To do so, delete SlimDX from the References in the Solution Explorer, right click on the Builder project and choose "Add reference". On the .NET tab, choose SlimDX (.net 2.0, x86 version).
   - You can ignore the warning about missing JetBrains.Profiler.Core.Api reference. Everything should build fine, unless you choose a profiler-enabled build target (or you can use dotTrace Performance, if you have access to it).
4. If you've made some code changes and want to submit them to the main GZDB repository, you can make a diff patch (right-click on the GZDB source folder and choose "TortioseSVN -> Create patch...") and post it at the official GZDB thread at ZDoom.org (http://forum.zdoom.org/viewtopic.php?f=3&t=32392&start=999999).

## Batch files:

GZDB source comes with several batch files, which can be used to automatically compile and package the editor. Before launching a batch file for the first time, make sure to open it and check that variables holding software paths point to the right directories. These variables are always located near the top of the file, after the info block.

- Clean Rebuild.bat - removes project cache files, then compiles it in Release mode.
  Requires Visual C# Express Edition / Visual Studio.
- CompileHelp.bat - compiles "Build\Refmanual.chm". Help source files are located in the "Help" directory.
  Requires Microsoft HTML Help compiler.
- MakeRelease.bat - removes project cache files, sets project version number to match the latest SVN revision, compiles the project in Release mode, generates "Build\Changelog.txt", compiles "Build\Refmanual.chm", creates an installer and places it in the "Release" folder.
  Requires Subversion command-line client, Visual C# Express Edition / Visual Studio, Microsoft HTML Help compiler and Inno Setup 5.
- MakeSVNRelease.bat - removes project cache files, sets project version number to match the latest SVN revision, compiles the project in Release mode, generates "Build\Changelog.txt", compiles "Build\Refmanual.chm", packs the build into 7-zip archive and places it in the "SVN_Build" folder.
  Requires Subversion command-line client, Visual C# Express Edition / Visual Studio, Microsoft HTML Help compiler and 7-zip archiver.