# 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:

- Git command-line client (https://git-scm.com/).
- TortoiseGit (https://tortoisegit.org/).
- 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 at GitHub (https://github.com/m-x-d/GZDoom-Builder).

## Quick start guide:

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

1. Create an empty folder, right click on it and choose "GIT Clone..." from the context menu.
2. Enter "https://github.com/m-x-d/GZDoom-Builder.git" in the "URL" field, click OK and wait for the source to download.
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 are planning to submit your changes to the main GZDoom Builder repository, it's recomeded to fork GZDoom Builder at GitHub, make the changes, then submit a Pull Request.

## 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.
- Compile Help.bat - compiles "Build\Refmanual.chm". Help source files are located in the "Help" directory.
  Requires Microsoft HTML Help compiler.
- Make Release.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 Git command-line client, Visual C# Express Edition / Visual Studio, Microsoft HTML Help compiler and Inno Setup 5.
- Make GIT Build.bat - removes project cache files, sets project version number to match the number of commits in the master branch, 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 "GIT_Build" folder.
  Requires Git command-line client, Visual C# Express Edition / Visual Studio, Microsoft HTML Help compiler and 7-zip archiver.