WinQGIS Release How-To
Author: Marco Pasetti

/* Wiki Pages Styles */ /* TableOfContents */ .table-of-contents { border: 1px solid #bbbbbb; color: black; background-color: #eeeeee; font-size: small; text-align:left; margin: 0.5em; padding-left: 1em; width: 360; } /* Contents */ html { background-color: white; color: black; font-family: Arial, Lucida Grande, sans-serif; font-size: 10pt; } body { margin: 30; } ol { font-family: Arial, Lucida Grande, sans-serif; font-size: 10pt; margin-top: 0; margin-bottom: 0; margin-left: 0; } h1 { font-family: Arial, Lucida Grande, sans-serif; font-size: 18pt; margin-top: 0; margin-bottom: 50; } h2 { font-family: Arial, Lucida Grande, sans-serif; font-size: 16pt; margin-top: 60; margin-bottom: 20; } h3 { font-family: Arial, Lucida Grande, sans-serif; font-size: 14pt; margin-top: 60; margin-bottom: 20; } h4 { font-family: Arial, Lucida Grande, sans-serif; font-size: 11pt; margin-top: 0; margin-bottom: 0; } p { font-family: Arial, Lucida Grande, sans-serif; font-size: 10pt; margin-top: 10; margin-bottom: 10; } code { font-family: Courier-new, monospace; font-size: 10pt; margin-top: 10; margin-bottom: 10; } pre { padding: 1em; border: 1px dashed #2f6fab; color: black; background-color: #f9f9f9; line-height: 1.1em; } /* Tables */ table { margin: 0.5em 0 0 0.5em; border-collapse: collapse; } td { padding: 0.25em 0.5em 0.25em 0.5em; border: 0pt solid #ADB9CC; font-family: Arial, Lucida Grande, sans-serif; font-size: 10pt; } /* Links */ a { text-decoration: none; color: #002bb8; background: none; } a:hover { text-decoration: underline; color: green; } a:visited:hover { text-decoration: underline; color: red; }

# How to prepare a MS-Windows Quantum GIS Release

Table of Contents

Introduction

1. MSYS
2. MinGW
3. Quantum GIS MSYS Environment
4. Qt OpenSource
5. Python
6. SIP
7. PyQt
8. CMake
9. Quantum GIS Build
10. Quantum GIS self-contained Package
11. NSIS
12. Quantum GIS Installer

Credits and Contacts

### Introduction

This document explains how to prepare a MS-Windows Quantum GIS release (as a self-contained package installer) using the scripts contained in the ms-windows folder. In order to avoid mistakes or misunderstandings, I highly recommend to follow each step and command exactly as they are written in this document.

### 1. MSYS (1.0.11)

Download the MSYS installer

Install to `c:\msys`

At the command prompt question for post install, type `n` and then enter.

Download the MSYS coreutils package

Unpack it to a temporary folder, then copy all the content of the `coreutils-5.97` folder to `c:\msys` (overwrite the existing files when asked)

### 2. MinGW (5.1.4)

Download the MinGW installer

Select "Download and Install Current Version";

Install only "g++ compiler" and "MinGW Make";

Install to `c:\msys\mingw`

### 3. Quantum GIS MSYS Environment

Download the Quantum GIS MSYS Environment

Extract the whole package to `c:\msys\local`

### 4. Qt OpenSource (4.4.0)

Download the Qt OpenSource installer

Install to `C:\DevTools\Qt-OpenSource`

When the installer will ask for MinGW, you don't need to download and install it, just point the installer to `c:\msys\mingw`

At the alert message "The installer could not found a valid c:\msys\mingw\include\w32api.h", press "Yes" and continue.

When Qt installation is complete, edit `C:\DevTools\Qt-OpenSource\bin\qtvars.bat` and do as follows:

At line 8 replace:

    echo -- PATH set to C:\DevTools\Qt-OpenSource\bin

with:

    echo -- Adding MSYS environment directories to PATH

At line 14 replace:

    set PATH=C:\DevTools\Qt-OpenSource\bin

with:

    set PATH=%PATH%;c:\msys\local\bin;c:\msys\local\sqlite\bin;c:\msys\local\pgsql\lib

Finally, add `C:\DevTools\Qt-OpenSource\bin` to your `PATH` system variable.

### 5. Python (2.5.2)

Download the Python installer

Install to `C:\DevTools\Python`

Add `C:\DevTools\Python` to your `PATH` system variable.

### 6. SIP (4.7.6)

Download the SIP source code

Unpack to `c:\msys\local\src`

Open a Windows terminal and type:

    cd c:\msys\local\src\sip-4.7.6
    qtvars
    python configure.py -p win32-g++
    make
    make install

### 7. PyQt (4.4.2)

Download the PyQt source code

Unpack to `c:\msys\local\src`

Open a Windows terminal and type:

    cd c:\msys\local\src\PyQt-win-gpl-4.4.2
    qtvars
    python configure.py
    make
    make install

### 8. CMake (2.6.0)

Download the CMake installer

Launch the CMake installer and do as follows:

Select "Add CMake to the system PATH for all users"

Install to `C:\DevTools\CMake`

### 9. Quantum GIS Build (0.11.0)

Download the Quantum GIS source code

Unpack to `c:\msys\local\src`

Open a Windows terminal and type:

    cd c:\msys\local\src\qgis_0.11.0
    md build
    cd build
    qtvars
    cmakesetup ..

In CMake Setup utility press "Configure" button and, when asked, choose "MinGW Makefiles" as generator.

CMake Setup will alert you for missing dependencies; don't care, press OK and continue.

When finished, select "Show Advanced Values" checkbox.

For each item listed below, select the related box in the CMake Setup utility, type in the suggested value and then press enter (we will perform a "bottom-up" procedure, editing last values of the CMake Setup list as first):

    SQLITE3_LIBRARY = c:/msys/local/sqlite/bin/libsqlite3-0.dll
    SQLITE3_INCLUDE_DIR = c:/msys/local/sqlite/include
    POSTGRES_INCLUDE_DIR = c:/msys/local/pgsql/include
    GRASS_PREFIX = c:/msys/local/grass-6.3.0
    CMAKE_INSTALL_PREFIX = c:/msys/local/qgis-0.11.0
    CMAKE_CXX_FLAGS = -DGEOS_INLINE
    CMAKE_BUILD_TYPE = Release

When finished press OK button.

Finally, in the same terminal session, type:

    make
    make install

### 10. Quantum GIS self-contained Package

Copy all the content of the ms-windows folder to a temporary directory, for example `c:\temp`.

Launch the file `c:\temp\QGIS-Packager.bat` and select the option number 2.

When finished, you should have a Quantum GIS self-contained release package in `c:\temp\QGIS-Release-Package`.

### 11. NSIS (2.38)

Download the NSIS installer

Install to `c:\DevTools`

### 12. Quantum GIS Installer

Open the the file `c:\temp\QGIS-Installer.nsi`.

At line 13 set the `INSTALLER_TYPE` variable to `"Release"`, then, at lines 19-22, set the `RELEASE_VERSION_NUMBER`, the `RELEASE_VERSION_NAME`, the `RELEASE_SVN_REVISION` and the `RELEASE_BINARY_REVISION` variables.

Finally, right click on the file `c:\temp\QGIS-Installer.nsi` and select `Compile NSIS Script`.

When finished, you should have the Quantum GIS release installer in `c:\temp`.

### Credits and Contacts

The Quantum GIS MSYS Environment and the Quantum GIS Packager and Installer scripts are provided by Marco Pasetti.

To contact him, e-mail to: Quantum GIS Development Mailing List (http://lists.osgeo.org/mailman/listinfo/qgis-developer).

Edited by Marco Pasetti on 13 September 2008.