Table of Contents

Windows Install Package

The TerraLib binary and source code distribution packages for Windows are created from a set of scripts built with NSIS (Nullsoft Scriptable Install System). These scripts can generate packges containing binaries and libraries with their dependencies, sample code, unit test code, headers, configuration files and documentation.

The set of scripts provided can be used to create general packages or specific platform packges. The following platforms are already supported by the install scripts:

This section explains in detail the design and how to customize the install scripts.

Design

Explicar

TeComponents

Script for TerraLib components manipulation. Contains macros that make the insertion of all TerraLib modules in the installer separately, besides the configuration files and modules description that appears in the installer.

TeConfig

Script that contains the macro that applies the general settings, such as the project name, version, installation types, TerraLib path, platform and other settings.

TeDependencies

Script for TerraLib dependencies manipulation. Contains macros that make the insertion of all TerraLib dependencies in the installer.

TeDocumentation

Script for TerraLib documentation manipulation. Contains macros that make the insertion of all TerraLib API documentation in the installer, besides the creation of some shortcuts to facilitate the user's access to the documentation after installed.

TeExamples

Script for TerraLib examples manipulation. Contains macros that make the insertion of all TerraLib examples source code in the installer.

TeHeaderFiles

Script for TerraLib header files manipulation. Contains macros that make the insertion of all TerraLib header files in the installer.

TeInstallerUtils

Script that contains some installer configurations, such as functions that execute when the intaller starts (.onInit), star menu shortcuts, system registry end other configurations.

TeMinGWConfig

Script that contains specific configurations for TerraLib installers for MinGW.

TeMsvcConfig

Script that contains specific configurations for TerraLib installers for Visual Studio 2010.

TeMuiConfig

Script that contains configurations about the modern user interface, that defines the icons path, the installer pages (welcome, licence, components, directory), installer languages and other configurations.

TePlugins

Script for TerraLib plugins manipulation. Contains macros that make the insertion of all TerraLib plugins in the installer.

TeSections

Script for TerraLib installer sections manipulation. This sections appear in the components page of the installers and contains the installations options where the user can unselect a specific module or documentation sections for example.

TeUninstallerUtils

Script that contains some uninstaller configurations, such as the informations that the uninstaller must remove.

TeUnittest

Script for TerraLib unit tests manipulation. Contains macros that make the insertion of all TerraLib unit tests source code in the installer.

TeMinGW-bin-x64

Contains all specific configurations to generate a TerraLib 64 bit installer for MinGW.

TeMinGW-bin-x86

Contains all specific configurations to generate a TerraLib 32 bit installer for MinGW.

TeMinGW-bin-x86-and-x64

Contains all specific configurations to generate a TerraLib 32 and 64 bit installer for MinGW.

TeMSVC2010-bin-x64

Contains all specific configurations to generate a TerraLib 64 bit installer for Visual Studio 2010.

TeMSVC2010-bin-x86

Contains all specific configurations to generate a TerraLib 32 bit installer for Visual Studio 2010.

TeMSVC2010-bin-x86-and-x64

Contains all specific configurations to generate a TerraLib 32 and 64 bit installer for Visual Studio 2010.

Windows Registry

During the installation, the TerraLib installer insert some informations on Windows uninstaller registry. These informations inform Windows about de TerraLib, such as system name, version and especially the uninstaller path. With this registry, the Windows insert TerraLib informations on Windows uninstall manager, found in Control Panel/Programs and Features.

<color red>documentar: as chaves do registro do windows que devem ser alteradas; a questão de sistemas que são multiusuário; variáveis de ambiente; estruturas de diretórios</color>

Explicar quais são os scripts e o que cada um deles faz. justificar o porque!

Building the Install Packages

Software Requirements

Building the Scripts

Customizing the Installer

You may want to modify the installer, removing some modules, removing the dependencies, and other options. We will see how to make these customizations.

Removing Some Modules

If you want to remove TerraLib modules of the installation, you can do with few steps.

For example:

Adding New Dependencies

If you want to add a new TerraLib dependencie, you will:

Adding New TerraLib Module

If a new module is created in TerraLib, to insert it into the installer we should:

Chage Icons and Images

Adding More Languages Suport

To add a new language suport, just edit the TeMuiConfig.nsh near the lines:

Final Remarks

References

OLD DOCUMENTATION

A partir daqui precisamos rever o que pode ser aproveitado!!!!!!

NSIS

In order to generate the install packages one will need to install NSIS:

The compiler program - makensis - compiles scripts like the following example into executable installation programs.

# Example script
Name "Example1"
OutFile "example1.exe"
InstallDir "$PROGRAMFILES\Example1"
Page Directory
Page InstFiles
Section
  SetOutPath $INSTDIR
  File ..\makensis.exe
SectionEnd

The script full reference can be found here.

HM NSIS Edit

HM NSIS Edit is an editor/IDE for Nullsoft Scriptable Install System (NSIS). Its useful for experts and beginners in the creation of Setup programs with the NSIS. Its Script Wizard will help you to create standard Setup programs with only few clicks, also its InstallOptions designer will help you to create your own custom pages with a friendly drag and drop interface.

Installation Example

The HM NSIS Edit has used to create the first TerraLib Installer.

The following script is the skeleton to generate a TerraLib Installer. More details, see the file on TerraLib repository: ./terralib5/installer/nsis/terralib.nsis.

# TerraLib Installer Script Skeleton
 
; Defines
!define PRODUCT_NAME "TerraLib"
!define PRODUCT_VERSION "5.0"
!define PRODUCT_PUBLISHER "Instituto Nacional de Pesquisas Espaciais - INPE"
!define PRODUCT_WEB_SITE "www.terralib.org"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
 
; MUI 1.67 compatible
; Using the modern interface - http://nsis.sourceforge.net/Docs/Modern%20UI/Readme.html
!include "MUI.nsh"
 
; Installer UIs
; License page
!insertmacro MUI_PAGE_LICENSE "..\..\COPYING"
; Directory page - Enables the user select the installation directory
!insertmacro MUI_PAGE_DIRECTORY
; Instfiles page - Shows the extract files
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!insertmacro MUI_PAGE_FINISH
; Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES
; MUI end
 
; Installer definitions
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "install.exe"
InstallDir "$PROGRAMFILES\TerraLib"
ShowInstDetails show
ShowUnInstDetails show
BrandingText "TerraLib Development Team"
 
Function .onInit
; Init install commands.
FunctionEnd
 
; TerraLib Section
; The files that will be installed goes here.
; For example: the install directory will have a folder called 'bin' that contains some build TerraLib DLLs;  
Section "TerraLib"
  SetOutPath $INSTDIR
  CreateDirectory "bin"   ; Create the output directory
  SetOutPath $INSTDIR\bin ; Sets it as current directory
; Coping the files!
  File ..\..\bin\msvc2008\terralib_common.dll
; ...
 
Section -Post
; Post install commands. For example, writes the unistall file, writes reg keys, etc.
SectionEnd
 
Section Uninstall
; Uninstall commands. For example, delete the created directory, delete reg keys, etc.
SectionEnd

Installation Example

Nowadays, the script generates a installer that when executed, creates the following structure of directories with the following files:

If you installed the NSIS package, click with rigth button on file and select the option: Compile NSIS Script. It will be generated a executable called install.exe.

Remarks

1) The use of HM NIS Edit is not necessary, but makes the process more user-friendly
2) Can be in the “TE_INSERT_MSVC_DEBUG_SECTION”, or TE_INSERT_MINGW_DEBUG_SECTION, or “TE_INSERT_MSVC_RELEASE_SECTION”