How to prepare a MS-Windows QGIS Release

Table of Contents

Introduction

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

Credits and Contacts


Introduction

This document explains how to prepare a MS-Windows QGIS 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. QGIS MSYS Environment

Download the QGIS 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. QGIS Build (0.11.0)

Download the QGIS 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. QGIS 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 QGIS self-contained release package in c:\temp\QGIS-Release-Package.

11. NSIS (2.38)

Download the NSIS installer

Install to c:\DevTools

12. QGIS 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 QGIS release installer in c:\temp.

Credits and Contacts

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

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

Edited by Marco Pasetti on 13 September 2008.