summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorVailin Choi <vchoi@hdfgroup.org>2014-06-09 16:19:26 (GMT)
committerVailin Choi <vchoi@hdfgroup.org>2014-06-09 16:19:26 (GMT)
commit519e23171052963775c47132ec0106727fdf5c41 (patch)
treecf7c6da9e0f28cf28632d596901ff5989f5b6401 /config
parent94d9aa2d319addf02c456d9f1b4551004d5e4a38 (diff)
downloadhdf5-519e23171052963775c47132ec0106727fdf5c41.zip
hdf5-519e23171052963775c47132ec0106727fdf5c41.tar.gz
hdf5-519e23171052963775c47132ec0106727fdf5c41.tar.bz2
[svn-r25242] Bring revisions #24505 - #24670 from trunk to revise_chunks.
Tested on jam, ostrich, koala, platypus.
Diffstat (limited to 'config')
-rw-r--r--config/cmake/CPack.cmake588
-rw-r--r--config/cmake/ConfigureChecks.cmake7
-rw-r--r--config/cmake/HDF518_Examples.cmake.in236
-rw-r--r--config/cmake/HDF5Tests.c2
-rw-r--r--config/cmake/NSIS.template.in233
-rw-r--r--config/cmake/xlatefile.c56
6 files changed, 255 insertions, 867 deletions
diff --git a/config/cmake/CPack.cmake b/config/cmake/CPack.cmake
deleted file mode 100644
index bdfa5b8..0000000
--- a/config/cmake/CPack.cmake
+++ /dev/null
@@ -1,588 +0,0 @@
-##section Variables common to all CPack generators
-##end
-##module
-# - Build binary and source package installers.
-# The CPack module generates binary and source installers in a variety
-# of formats using the cpack program. Inclusion of the CPack module
-# adds two new targets to the resulting makefiles, package and
-# package_source, which build the binary and source installers,
-# respectively. The generated binary installers contain everything
-# installed via CMake's INSTALL command (and the deprecated
-# INSTALL_FILES, INSTALL_PROGRAMS, and INSTALL_TARGETS commands).
-#
-# For certain kinds of binary installers (including the graphical
-# installers on Mac OS X and Windows), CPack generates installers that
-# allow users to select individual application components to
-# install. See CPackComponent module for that.
-#
-# The CPACK_GENERATOR variable has different meanings in different
-# contexts. In your CMakeLists.txt file, CPACK_GENERATOR is a
-# *list of generators*: when run with no other arguments, CPack
-# will iterate over that list and produce one package for each
-# generator. In a CPACK_PROJECT_CONFIG_FILE, though, CPACK_GENERATOR
-# is a *string naming a single generator*. If you need per-cpack-
-# generator logic to control *other* cpack settings, then you need
-# a CPACK_PROJECT_CONFIG_FILE.
-#
-# The CMake source tree itself contains a CPACK_PROJECT_CONFIG_FILE.
-# See the top level file CMakeCPackOptions.cmake.in for an example.
-#
-# If set, the CPACK_PROJECT_CONFIG_FILE is included automatically
-# on a per-generator basis. It only need contain overrides.
-#
-# Here's how it works:
-# - cpack runs
-# - it includes CPackConfig.cmake
-# - it iterates over the generators listed in that file's
-# CPACK_GENERATOR list variable (unless told to use just a
-# specific one via -G on the command line...)
-#
-# - foreach generator, it then
-# - sets CPACK_GENERATOR to the one currently being iterated
-# - includes the CPACK_PROJECT_CONFIG_FILE
-# - produces the package for that generator
-#
-# This is the key: For each generator listed in CPACK_GENERATOR
-# in CPackConfig.cmake, cpack will *reset* CPACK_GENERATOR
-# internally to *the one currently being used* and then include
-# the CPACK_PROJECT_CONFIG_FILE.
-#
-# Before including this CPack module in your CMakeLists.txt file,
-# there are a variety of variables that can be set to customize
-# the resulting installers. The most commonly-used variables are:
-##end
-#
-##variable
-# CPACK_PACKAGE_NAME - The name of the package (or application). If
-# not specified, defaults to the project name.
-##end
-#
-##variable
-# CPACK_PACKAGE_VENDOR - The name of the package vendor. (e.g.,
-# "Kitware").
-##end
-#
-##variable
-# CPACK_PACKAGE_DIRECTORY - The directory in which CPack is doing its
-# packaging. If it is not set then this will default (internally) to the
-# build dir. This variable may be defined in CPack config file or from
-# the cpack command line option "-B". If set the command line option
-# override the value found in the config file.
-##end
-#
-##variable
-# CPACK_PACKAGE_VERSION_MAJOR - Package major Version
-##end
-#
-##variable
-# CPACK_PACKAGE_VERSION_MINOR - Package minor Version
-##end
-#
-##variable
-# CPACK_PACKAGE_VERSION_PATCH - Package patch Version
-##end
-#
-##variable
-# CPACK_PACKAGE_DESCRIPTION_FILE - A text file used to describe the
-# project. Used, for example, the introduction screen of a
-# CPack-generated Windows installer to describe the project.
-##end
-#
-##variable
-# CPACK_PACKAGE_DESCRIPTION_SUMMARY - Short description of the
-# project (only a few words).
-##end
-#
-##variable
-# CPACK_PACKAGE_FILE_NAME - The name of the package file to generate,
-# not including the extension. For example, cmake-2.6.1-Linux-i686.
-# The default value is
-#
-# ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}.
-##end
-#
-##variable
-# CPACK_PACKAGE_INSTALL_DIRECTORY - Installation directory on the
-# target system. This may be used by some CPack generators
-# like NSIS to create an installation directory e.g., "CMake 2.5"
-# below the installation prefix. All installed element will be
-# put inside this directory.
-##end
-#
-##variable
-# CPACK_PACKAGE_ICON - A branding image that will be displayed inside
-# the installer (used by GUI installers).
-##end
-#
-##variable
-# CPACK_PROJECT_CONFIG_FILE - CPack-time project CPack configuration
-# file. This file included at cpack time, once per
-# generator after CPack has set CPACK_GENERATOR to the actual generator
-# being used. It allows per-generator setting of CPACK_* variables at
-# cpack time.
-##end
-#
-##variable
-# CPACK_RESOURCE_FILE_LICENSE - License to be embedded in the installer. It
-# will typically be displayed to the user by the produced installer
-# (often with an explicit "Accept" button, for graphical installers)
-# prior to installation. This license file is NOT added to installed
-# file but is used by some CPack generators like NSIS. If you want
-# to install a license file (may be the same as this one)
-# along with your project you must add an appropriate CMake INSTALL
-# command in your CMakeLists.txt.
-##end
-#
-##variable
-# CPACK_RESOURCE_FILE_README - ReadMe file to be embedded in the installer. It
-# typically describes in some detail the purpose of the project
-# during the installation. Not all CPack generators uses
-# this file.
-##end
-#
-##variable
-# CPACK_RESOURCE_FILE_WELCOME - Welcome file to be embedded in the
-# installer. It welcomes users to this installer.
-# Typically used in the graphical installers on Windows and Mac OS X.
-##end
-#
-##variable
-# CPACK_MONOLITHIC_INSTALL - Disables the component-based
-# installation mechanism. When set the component specification is ignored
-# and all installed items are put in a single "MONOLITHIC" package.
-# Some CPack generators do monolithic packaging by default and
-# may be asked to do component packaging by setting
-# CPACK_<GENNAME>_COMPONENT_INSTALL to 1/TRUE.
-##end
-#
-##variable
-# CPACK_GENERATOR - List of CPack generators to use. If not
-# specified, CPack will create a set of options CPACK_BINARY_<GENNAME> (e.g.,
-# CPACK_BINARY_NSIS) allowing the user to enable/disable individual
-# generators. This variable may be used on the command line
-# as well as in:
-#
-# cpack -D CPACK_GENERATOR="ZIP;TGZ" /path/to/build/tree
-##end
-#
-##variable
-# CPACK_OUTPUT_CONFIG_FILE - The name of the CPack binary configuration
-# file. This file is the CPack configuration generated by the CPack module
-# for binary installers. Defaults to CPackConfig.cmake.
-##end
-#
-##variable
-# CPACK_PACKAGE_EXECUTABLES - Lists each of the executables and associated
-# text label to be used to create Start Menu shortcuts. For example,
-# setting this to the list ccmake;CMake will
-# create a shortcut named "CMake" that will execute the installed
-# executable ccmake. Not all CPack generators use it (at least NSIS and
-# OSXX11 do).
-##end
-#
-##variable
-# CPACK_STRIP_FILES - List of files to be stripped. Starting with
-# CMake 2.6.0 CPACK_STRIP_FILES will be a boolean variable which
-# enables stripping of all files (a list of files evaluates to TRUE
-# in CMake, so this change is compatible).
-##end
-#
-# The following CPack variables are specific to source packages, and
-# will not affect binary packages:
-#
-##variable
-# CPACK_SOURCE_PACKAGE_FILE_NAME - The name of the source package. For
-# example cmake-2.6.1.
-##end
-#
-##variable
-# CPACK_SOURCE_STRIP_FILES - List of files in the source tree that
-# will be stripped. Starting with CMake 2.6.0
-# CPACK_SOURCE_STRIP_FILES will be a boolean variable which enables
-# stripping of all files (a list of files evaluates to TRUE in CMake,
-# so this change is compatible).
-##end
-#
-##variable
-# CPACK_SOURCE_GENERATOR - List of generators used for the source
-# packages. As with CPACK_GENERATOR, if this is not specified then
-# CPack will create a set of options (e.g., CPACK_SOURCE_ZIP)
-# allowing users to select which packages will be generated.
-##end
-#
-##variable
-# CPACK_SOURCE_OUTPUT_CONFIG_FILE - The name of the CPack source
-# configuration file. This file is the CPack configuration generated by the
-# CPack module for source installers. Defaults to CPackSourceConfig.cmake.
-##end
-#
-##variable
-# CPACK_SOURCE_IGNORE_FILES - Pattern of files in the source tree
-# that won't be packaged when building a source package. This is a
-# list of regular expression patterns (that must be properly escaped),
-# e.g., /CVS/;/\\.svn/;\\.swp$;\\.#;/#;.*~;cscope.*
-##end
-#
-# The following variables are for advanced uses of CPack:
-#
-##variable
-# CPACK_CMAKE_GENERATOR - What CMake generator should be used if the
-# project is CMake project. Defaults to the value of CMAKE_GENERATOR
-# few users will want to change this setting.
-##end
-#
-##variable
-# CPACK_INSTALL_CMAKE_PROJECTS - List of four values that specify
-# what project to install. The four values are: Build directory,
-# Project Name, Project Component, Directory. If omitted, CPack will
-# build an installer that installers everything.
-##end
-#
-##variable
-# CPACK_SYSTEM_NAME - System name, defaults to the value of
-# ${CMAKE_SYSTEM_NAME}.
-##end
-#
-##variable
-# CPACK_PACKAGE_VERSION - Package full version, used internally. By
-# default, this is built from CPACK_PACKAGE_VERSION_MAJOR,
-# CPACK_PACKAGE_VERSION_MINOR, and CPACK_PACKAGE_VERSION_PATCH.
-##end
-#
-##variable
-# CPACK_TOPLEVEL_TAG - Directory for the installed files.
-##end
-#
-##variable
-# CPACK_INSTALL_COMMANDS - Extra commands to install components.
-##end
-#
-##variable
-# CPACK_INSTALLED_DIRECTORIES - Extra directories to install.
-##end
-#
-##variable
-# CPACK_PACKAGE_INSTALL_REGISTRY_KEY - Registry key used when
-# installing this project. This is only used
-# by installer for Windows.
-##end
-##variable
-# CPACK_CREATE_DESKTOP_LINKS - List of desktop links to create.
-##end
-#
-
-#=============================================================================
-# Copyright 2006-2009 Kitware, Inc.
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-# License text for the above reference.)
-
-# Define this var in order to avoid (or warn) concerning multiple inclusion
-if(CPack_CMake_INCLUDED)
- message(WARNING "CPack.cmake has already been included!!")
-else()
- set(CPack_CMake_INCLUDED 1)
-endif()
-
-# Pick a configuration file
-set(cpack_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in")
-if(EXISTS "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
- set(cpack_input_file "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
-endif()
-set(cpack_source_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in")
-if(EXISTS "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
- set(cpack_source_input_file "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
-endif()
-
-# Backward compatibility
-# Include CPackComponent macros if it has not already been included before.
-include(CPackComponent)
-
-# Macro for setting values if a user did not overwrite them
-macro(cpack_set_if_not_set name value)
- if(NOT DEFINED "${name}")
- set(${name} "${value}")
- endif()
-endmacro()
-
-# cpack_encode_variables - Macro to encode variables for the configuration file
-# find any variable that starts with CPACK and create a variable
-# _CPACK_OTHER_VARIABLES_ that contains SET commands for
-# each cpack variable. _CPACK_OTHER_VARIABLES_ is then
-# used as an @ replacment in configure_file for the CPackConfig.
-macro(cpack_encode_variables)
- set(_CPACK_OTHER_VARIABLES_)
- get_cmake_property(res VARIABLES)
- foreach(var ${res})
- if("xxx${var}" MATCHES "xxxCPACK")
- set(_CPACK_OTHER_VARIABLES_
- "${_CPACK_OTHER_VARIABLES_}\nSET(${var} \"${${var}}\")")
- endif()
- endforeach()
-endmacro()
-
-# Set the package name
-cpack_set_if_not_set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
-cpack_set_if_not_set(CPACK_PACKAGE_VERSION_MAJOR "0")
-cpack_set_if_not_set(CPACK_PACKAGE_VERSION_MINOR "1")
-cpack_set_if_not_set(CPACK_PACKAGE_VERSION_PATCH "1")
-cpack_set_if_not_set(CPACK_PACKAGE_VERSION
- "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
-cpack_set_if_not_set(CPACK_PACKAGE_VENDOR "Humanity")
-cpack_set_if_not_set(CPACK_PACKAGE_DESCRIPTION_SUMMARY
- "${CMAKE_PROJECT_NAME} built using CMake")
-
-cpack_set_if_not_set(CPACK_PACKAGE_DESCRIPTION_FILE
- "${CMAKE_ROOT}/Templates/CPack.GenericDescription.txt")
-cpack_set_if_not_set(CPACK_RESOURCE_FILE_LICENSE
- "${CMAKE_ROOT}/Templates/CPack.GenericLicense.txt")
-cpack_set_if_not_set(CPACK_RESOURCE_FILE_README
- "${CMAKE_ROOT}/Templates/CPack.GenericDescription.txt")
-cpack_set_if_not_set(CPACK_RESOURCE_FILE_WELCOME
- "${CMAKE_ROOT}/Templates/CPack.GenericWelcome.txt")
-
-cpack_set_if_not_set(CPACK_MODULE_PATH "${CMAKE_MODULE_PATH}")
-
-if(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL)
- set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
-endif()
-
-if(CPACK_NSIS_MODIFY_PATH)
- set(CPACK_NSIS_MODIFY_PATH ON)
-endif()
-
-set(__cpack_system_name ${CMAKE_SYSTEM_NAME})
-if(${__cpack_system_name} MATCHES Windows)
- if(CMAKE_CL_64)
- set(__cpack_system_name win64)
- else()
- set(__cpack_system_name win32)
- endif()
-endif()
-cpack_set_if_not_set(CPACK_SYSTEM_NAME "${__cpack_system_name}")
-
-# Root dir: default value should be the string literal "$PROGRAMFILES"
-# for backwards compatibility. Projects may set this value to anything.
-if(CMAKE_CL_64)
-set(__cpack_root_default "$PROGRAMFILES64")
-else()
-set(__cpack_root_default "$PROGRAMFILES")
-endif()
-cpack_set_if_not_set(CPACK_NSIS_INSTALL_ROOT "${__cpack_root_default}")
-
-# <project>-<major>.<minor>.<patch>-<release>-<platform>.<pkgtype>
-cpack_set_if_not_set(CPACK_PACKAGE_FILE_NAME
- "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}")
-cpack_set_if_not_set(CPACK_PACKAGE_INSTALL_DIRECTORY
- "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}")
-cpack_set_if_not_set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY
- "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
-cpack_set_if_not_set(CPACK_PACKAGE_DEFAULT_LOCATION "/")
-cpack_set_if_not_set(CPACK_PACKAGE_RELOCATABLE "true")
-
-# always force to exactly "true" or "false" for CPack.Info.plist.in:
-if(CPACK_PACKAGE_RELOCATABLE)
- set(CPACK_PACKAGE_RELOCATABLE "true")
-else()
- set(CPACK_PACKAGE_RELOCATABLE "false")
-endif()
-
-macro(cpack_check_file_exists file description)
- if(NOT EXISTS "${file}")
- message(SEND_ERROR "CPack ${description} file: \"${file}\" could not be found.")
- endif()
-endmacro()
-
-cpack_check_file_exists("${CPACK_PACKAGE_DESCRIPTION_FILE}" "package description")
-cpack_check_file_exists("${CPACK_RESOURCE_FILE_LICENSE}" "license resource")
-cpack_check_file_exists("${CPACK_RESOURCE_FILE_README}" "readme resource")
-cpack_check_file_exists("${CPACK_RESOURCE_FILE_WELCOME}" "welcome resource")
-
-macro(cpack_optional_append _list _cond _item)
- if(${_cond})
- set(${_list} ${${_list}} ${_item})
- endif()
-endmacro()
-
-##variable
-# CPACK_BINARY_<GENNAME> - CPack generated options for binary generators. The
-# CPack.cmake module generates (when CPACK_GENERATOR is not set)
-# a set of CMake options (see CMake option command) which may then be used to
-# select the CPack generator(s) to be used when launching the package target.
-##end
-# Provide options to choose generators
-# we might check here if the required tools for the generates exist
-# and set the defaults according to the results
-if(NOT CPACK_GENERATOR)
- if(UNIX)
- if(CYGWIN)
- option(CPACK_BINARY_CYGWIN "Enable to build Cygwin binary packages" ON)
- else()
- if(APPLE)
- option(CPACK_BINARY_BUNDLE "Enable to build OSX bundles" OFF)
- option(CPACK_BINARY_DRAGNDROP "Enable to build OSX Drag And Drop package" OFF)
- option(CPACK_BINARY_PACKAGEMAKER "Enable to build PackageMaker packages" ON)
- option(CPACK_BINARY_OSXX11 "Enable to build OSX X11 packages" OFF)
- else()
- option(CPACK_BINARY_TZ "Enable to build TZ packages" ON)
- endif()
- option(CPACK_BINARY_STGZ "Enable to build STGZ packages" ON)
- option(CPACK_BINARY_TGZ "Enable to build TGZ packages" ON)
- option(CPACK_BINARY_TBZ2 "Enable to build TBZ2 packages" OFF)
- option(CPACK_BINARY_DEB "Enable to build Debian packages" OFF)
- option(CPACK_BINARY_RPM "Enable to build RPM packages" OFF)
- option(CPACK_BINARY_NSIS "Enable to build NSIS packages" OFF)
- endif()
- else()
- option(CPACK_BINARY_NSIS "Enable to build NSIS packages" ON)
- option(CPACK_BINARY_WIX "Enable to build WiX packages" OFF)
- option(CPACK_BINARY_ZIP "Enable to build ZIP packages" OFF)
- endif()
-
- cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_BUNDLE Bundle)
- cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_DRAGNDROP DragNDrop)
- cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_PACKAGEMAKER PackageMaker)
- cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_OSXX11 OSXX11)
- cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_CYGWIN CygwinBinary)
- cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_DEB DEB)
- cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_RPM RPM)
- cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_NSIS NSIS)
- cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_STGZ STGZ)
- cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_TGZ TGZ)
- cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_TBZ2 TBZ2)
- cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_TZ TZ)
- cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_WIX WIX)
- cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_ZIP ZIP)
-
-endif()
-
-# Provide options to choose source generators
-if(NOT CPACK_SOURCE_GENERATOR)
- if(UNIX)
- if(CYGWIN)
- option(CPACK_SOURCE_CYGWIN "Enable to build Cygwin source packages" ON)
- else()
- option(CPACK_SOURCE_TBZ2 "Enable to build TBZ2 source packages" ON)
- option(CPACK_SOURCE_TGZ "Enable to build TGZ source packages" ON)
- option(CPACK_SOURCE_TZ "Enable to build TZ source packages" ON)
- option(CPACK_SOURCE_ZIP "Enable to build ZIP source packages" OFF)
- endif()
- else()
- option(CPACK_SOURCE_ZIP "Enable to build ZIP source packages" ON)
- endif()
-
- cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_CYGWIN CygwinSource)
- cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_TGZ TGZ)
- cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_TBZ2 TBZ2)
- cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_TZ TZ)
- cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_ZIP ZIP)
-endif()
-
-# mark the above options as advanced
-mark_as_advanced(CPACK_BINARY_CYGWIN CPACK_BINARY_PACKAGEMAKER CPACK_BINARY_OSXX11
- CPACK_BINARY_STGZ CPACK_BINARY_TGZ CPACK_BINARY_TBZ2
- CPACK_BINARY_DEB CPACK_BINARY_RPM CPACK_BINARY_TZ
- CPACK_BINARY_NSIS CPACK_BINARY_WIX CPACK_BINARY_ZIP CPACK_BINARY_BUNDLE
- CPACK_SOURCE_CYGWIN CPACK_SOURCE_TBZ2 CPACK_SOURCE_TGZ
- CPACK_SOURCE_TZ CPACK_SOURCE_ZIP CPACK_BINARY_DRAGNDROP)
-
-# Set some other variables
-cpack_set_if_not_set(CPACK_INSTALL_CMAKE_PROJECTS
- "${CMAKE_BINARY_DIR};${CMAKE_PROJECT_NAME};ALL;/")
-cpack_set_if_not_set(CPACK_CMAKE_GENERATOR "${CMAKE_GENERATOR}")
-cpack_set_if_not_set(CPACK_TOPLEVEL_TAG "${CPACK_SYSTEM_NAME}")
-# if the user has set CPACK_NSIS_DISPLAY_NAME remember it
-if(DEFINED CPACK_NSIS_DISPLAY_NAME)
- set(CPACK_NSIS_DISPLAY_NAME_SET TRUE)
-endif()
-# if the user has set CPACK_NSIS_DISPLAY
-# explicitly, then use that as the default
-# value of CPACK_NSIS_PACKAGE_NAME instead
-# of CPACK_PACKAGE_INSTALL_DIRECTORY
-cpack_set_if_not_set(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
-
-if(CPACK_NSIS_DISPLAY_NAME_SET)
- string(REPLACE "\\" "\\\\"
- _NSIS_DISPLAY_NAME_TMP "${CPACK_NSIS_DISPLAY_NAME}")
- cpack_set_if_not_set(CPACK_NSIS_PACKAGE_NAME "${_NSIS_DISPLAY_NAME_TMP}")
-else()
- cpack_set_if_not_set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
-endif()
-
-cpack_set_if_not_set(CPACK_OUTPUT_CONFIG_FILE
- "${CMAKE_BINARY_DIR}/CPackConfig.cmake")
-
-cpack_set_if_not_set(CPACK_SOURCE_OUTPUT_CONFIG_FILE
- "${CMAKE_BINARY_DIR}/CPackSourceConfig.cmake")
-
-cpack_set_if_not_set(CPACK_SET_DESTDIR OFF)
-cpack_set_if_not_set(CPACK_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
-
-cpack_set_if_not_set(CPACK_NSIS_INSTALLER_ICON_CODE "")
-cpack_set_if_not_set(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "")
-
-# WiX specific variables
-cpack_set_if_not_set(CPACK_WIX_SIZEOF_VOID_P "${CMAKE_SIZEOF_VOID_P}")
-
-if(DEFINED CPACK_COMPONENTS_ALL)
- if(CPACK_MONOLITHIC_INSTALL)
- message("CPack warning: both CPACK_COMPONENTS_ALL and CPACK_MONOLITHIC_INSTALL have been set.\nDefaulting to a monolithic installation.")
- set(CPACK_COMPONENTS_ALL)
- else()
- # The user has provided the set of components to be installed as
- # part of a component-based installation; trust her.
- set(CPACK_COMPONENTS_ALL_SET_BY_USER TRUE)
- endif()
-else()
- # If the user has not specifically requested a monolithic installer
- # but has specified components in various "install" commands, tell
- # CPack about those components.
- if(NOT CPACK_MONOLITHIC_INSTALL)
- get_cmake_property(CPACK_COMPONENTS_ALL COMPONENTS)
- list(LENGTH CPACK_COMPONENTS_ALL CPACK_COMPONENTS_LEN)
- if(CPACK_COMPONENTS_LEN EQUAL 1)
- # Only one component: this is not a component-based installation
- # (at least, it isn't a component-based installation, but may
- # become one later if the user uses the cpack_add_* commands).
- set(CPACK_COMPONENTS_ALL)
- endif()
- set(CPACK_COMPONENTS_LEN)
- endif()
-endif()
-
-# CMake always generates a component named "Unspecified", which is
-# used to install everything that doesn't have an explicitly-provided
-# component. Since these files should always be installed, we'll make
-# them hidden and required.
-set(CPACK_COMPONENT_UNSPECIFIED_HIDDEN TRUE)
-set(CPACK_COMPONENT_UNSPECIFIED_REQUIRED TRUE)
-
-cpack_encode_variables()
-configure_file("${cpack_input_file}" "${CPACK_OUTPUT_CONFIG_FILE}" @ONLY IMMEDIATE)
-
-# Generate source file
-cpack_set_if_not_set(CPACK_SOURCE_INSTALLED_DIRECTORIES
- "${CMAKE_SOURCE_DIR};/")
-cpack_set_if_not_set(CPACK_SOURCE_TOPLEVEL_TAG "${CPACK_SYSTEM_NAME}-Source")
-cpack_set_if_not_set(CPACK_SOURCE_PACKAGE_FILE_NAME
- "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-Source")
-cpack_set_if_not_set(CPACK_SOURCE_IGNORE_FILES
- "/CVS/;/\\\\\\\\.svn/;/\\\\\\\\.bzr/;/\\\\\\\\.hg/;/\\\\\\\\.git/;\\\\\\\\.swp$;\\\\\\\\.#;/#")
-set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_SOURCE_INSTALL_CMAKE_PROJECTS}")
-set(CPACK_INSTALLED_DIRECTORIES "${CPACK_SOURCE_INSTALLED_DIRECTORIES}")
-set(CPACK_GENERATOR "${CPACK_SOURCE_GENERATOR}")
-set(CPACK_TOPLEVEL_TAG "${CPACK_SOURCE_TOPLEVEL_TAG}")
-set(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
-set(CPACK_IGNORE_FILES "${CPACK_SOURCE_IGNORE_FILES}")
-set(CPACK_STRIP_FILES "${CPACK_SOURCE_STRIP_FILES}")
-
-cpack_encode_variables()
-configure_file("${cpack_source_input_file}"
- "${CPACK_SOURCE_OUTPUT_CONFIG_FILE}" @ONLY IMMEDIATE)
diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake
index 769483e..48bff74 100644
--- a/config/cmake/ConfigureChecks.cmake
+++ b/config/cmake/ConfigureChecks.cmake
@@ -33,6 +33,11 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
SET (H5_HAVE_DARWIN 1)
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+# Check for Solaris
+IF(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
+ SET (H5_HAVE_SOLARIS 1)
+ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
+
#-----------------------------------------------------------------------------
# Option to Clear File Buffers before write --enable-clear-file-buffers
#-----------------------------------------------------------------------------
@@ -433,6 +438,7 @@ SET (LINUX_LFS 0)
SET (HDF5_EXTRA_C_FLAGS)
SET (HDF5_EXTRA_FLAGS)
IF (NOT WINDOWS)
+ IF(NOT H5_HAVE_SOLARIS)
# Linux Specific flags
# This was originally defined as _POSIX_SOURCE which was updated to
# _POSIX_C_SOURCE=199506L to expose a greater amount of POSIX
@@ -474,6 +480,7 @@ IF (NOT WINDOWS)
ENDIF (TEST_LFS_WORKS_COMPILE)
ENDIF (HDF5_ENABLE_LARGE_FILE)
SET (CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${HDF5_EXTRA_FLAGS})
+ ENDIF(NOT H5_HAVE_SOLARIS)
ENDIF (NOT WINDOWS)
ADD_DEFINITIONS (${HDF5_EXTRA_FLAGS})
diff --git a/config/cmake/HDF518_Examples.cmake.in b/config/cmake/HDF518_Examples.cmake.in
index c6be9ff..1883d3e 100644
--- a/config/cmake/HDF518_Examples.cmake.in
+++ b/config/cmake/HDF518_Examples.cmake.in
@@ -1,119 +1,119 @@
-cmake_minimum_required(VERSION 2.8.10 FATAL_ERROR)
-###############################################################################################################
-# This script will build and run the examples from a compressed file
-# Execute from a command line:
-# ctest -S HDF518_Examples.cmake,HDF5Examples-0.1.1-Source -C Release -O test.log
-###############################################################################################################
-
-set(INSTALLDIR "@CMAKE_INSTALL_PREFIX@/@HDF5_PACKAGE_VERSION@")
-set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
-set(STATICLIBRARIES "@H5_ENABLE_STATIC_LIB@")
-set(CTEST_SOURCE_NAME ${CTEST_SCRIPT_ARG})
-set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY})
-set(CTEST_BUILD_CONFIGURATION "Release")
-#set(NO_MAC_FORTRAN "true")
-#set(BUILD_OPTIONS ""${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF")
-#set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_ENABLE_F2003:BOOL=ON)
-
-###############################################################################################################
-# Adjust the following SET Commands as needed
-###############################################################################################################
-if(WIN32)
- if(STATICLIBRARIES)
- set(BUILD_OPTIONS "${BUILD_OPTIONS} -DUSE_SHARED_LIBS:BOOL=OFF")
- endif(STATICLIBRARIES)
- set(ENV{HDF5_DIR} "${INSTALLDIR}/cmake/hdf5")
- set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build)
- set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}")
- set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}")
-else(WIN32)
- if(STATICLIBRARIES)
- set(BUILD_OPTIONS "${BUILD_OPTIONS} -DUSE_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC")
- endif(STATICLIBRARIES)
- set(ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake/hdf5")
- set(ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib")
- set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build)
- set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}")
- set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}")
-endif(WIN32)
-
-###############################################################################################################
-# For any comments please contact cdashhelp@hdfgroup.org
-#
-###############################################################################################################
-
-#-----------------------------------------------------------------------------
-# MAC machines need special option
-#-----------------------------------------------------------------------------
-if(APPLE)
- # Compiler choice
- execute_process(COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE)
- execute_process(COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE)
- set(ENV{CC} "${XCODE_CC}")
- set(ENV{CXX} "${XCODE_CXX}")
- if(NOT NO_MAC_FORTRAN)
- # Shared fortran is not supported, build static
- set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC")
- else(NOT NO_MAC_FORTRAN)
- set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF")
- endif(NOT NO_MAC_FORTRAN)
- set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF")
-endif(APPLE)
-
-#-----------------------------------------------------------------------------
-set(CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"")
-## Uncompress source in tar file provided
-## --------------------------
-if(WIN32)
- set(CTEST_7Z_COMMAND "C:/Program Files/7-Zip/7z.exe")
- message("extracting... [${CTEST_7Z_COMMAND} x ${CTEST_SOURCE_NAME}.zip]")
- execute_process(COMMAND ${CTEST_7Z_COMMAND} x ${CTEST_SOURCE_NAME}.zip RESULT_VARIABLE rv)
-else(WIN32)
- message("extracting... [${CTEST_CMAKE_COMMAND} -E tar -xvf ${CTEST_SOURCE_NAME}.tar.gz]")
- execute_process(COMMAND tar -xvf ${CTEST_SOURCE_NAME}.tar.gz RESULT_VARIABLE rv)
-endif(WIN32)
-
-if(NOT rv EQUAL 0)
- message("extracting... [error-(${rv}) clean up]")
- file(REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}")
- message(FATAL_ERROR "error: extract of ${CTEST_SOURCE_NAME} failed")
-endif(NOT rv EQUAL 0)
-
-#-----------------------------------------------------------------------------
-## Clear the build directory
-## --------------------------
-set(CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE)
-file(MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}")
-ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
-
-# Use multiple CPU cores to build
-include(ProcessorCount)
-ProcessorCount(N)
-if(NOT N EQUAL 0)
- if(NOT WIN32)
- set(CTEST_BUILD_FLAGS -j${N})
- endif(NOT WIN32)
- set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N})
-endif()
-set (CTEST_CONFIGURE_COMMAND
- "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\""
-)
-
-#-----------------------------------------------------------------------------
-## -- set output to english
-set($ENV{LC_MESSAGES} "en_EN")
-
-#-----------------------------------------------------------------------------
- ## NORMAL process
- ## --------------------------
- CTEST_START (Experimental)
- CTEST_CONFIGURE (BUILD "${CTEST_BINARY_DIRECTORY}")
- CTEST_READ_CUSTOM_FILES ("${CTEST_BINARY_DIRECTORY}")
- CTEST_BUILD (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND)
- CTEST_TEST (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res)
- if(res GREATER 0)
- message (FATAL_ERROR "tests FAILED")
- endif(res GREATER 0)
-#-----------------------------------------------------------------------------
-##############################################################################################################
+cmake_minimum_required(VERSION 2.8.10 FATAL_ERROR)
+###############################################################################################################
+# This script will build and run the examples from a compressed file
+# Execute from a command line:
+# ctest -S HDF518_Examples.cmake,HDF5Examples-0.1.1-Source -C Release -O test.log
+###############################################################################################################
+
+set(INSTALLDIR "@CMAKE_INSTALL_PREFIX@/HDF_Group/@HDF5_PACKAGE_NAME@/@HDF5_PACKAGE_VERSION@")
+set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
+set(STATICLIBRARIES "@H5_ENABLE_STATIC_LIB@")
+set(CTEST_SOURCE_NAME ${CTEST_SCRIPT_ARG})
+set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY})
+set(CTEST_BUILD_CONFIGURATION "Release")
+#set(NO_MAC_FORTRAN "true")
+#set(BUILD_OPTIONS ""${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF")
+#set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_ENABLE_F2003:BOOL=ON)
+
+###############################################################################################################
+# Adjust the following SET Commands as needed
+###############################################################################################################
+if(WIN32)
+ if(STATICLIBRARIES)
+ set(BUILD_OPTIONS "${BUILD_OPTIONS} -DUSE_SHARED_LIBS:BOOL=OFF")
+ endif(STATICLIBRARIES)
+ set(ENV{HDF5_DIR} "${INSTALLDIR}/cmake/hdf5")
+ set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build)
+ set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}")
+ set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}")
+else(WIN32)
+ if(STATICLIBRARIES)
+ set(BUILD_OPTIONS "${BUILD_OPTIONS} -DUSE_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC")
+ endif(STATICLIBRARIES)
+ set(ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake/hdf5")
+ set(ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib")
+ set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build)
+ set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}")
+ set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}")
+endif(WIN32)
+
+###############################################################################################################
+# For any comments please contact cdashhelp@hdfgroup.org
+#
+###############################################################################################################
+
+#-----------------------------------------------------------------------------
+# MAC machines need special option
+#-----------------------------------------------------------------------------
+if(APPLE)
+ # Compiler choice
+ execute_process(COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE)
+ execute_process(COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE)
+ set(ENV{CC} "${XCODE_CC}")
+ set(ENV{CXX} "${XCODE_CXX}")
+ if(NOT NO_MAC_FORTRAN)
+ # Shared fortran is not supported, build static
+ set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC")
+ else(NOT NO_MAC_FORTRAN)
+ set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF")
+ endif(NOT NO_MAC_FORTRAN)
+ set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF")
+endif(APPLE)
+
+#-----------------------------------------------------------------------------
+set(CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"")
+## Uncompress source in tar file provided
+## --------------------------
+if(WIN32)
+ set(CTEST_7Z_COMMAND "C:/Program Files/7-Zip/7z.exe")
+ message("extracting... [${CTEST_7Z_COMMAND} x ${CTEST_SOURCE_NAME}.zip]")
+ execute_process(COMMAND ${CTEST_7Z_COMMAND} x ${CTEST_SOURCE_NAME}.zip RESULT_VARIABLE rv)
+else(WIN32)
+ message("extracting... [${CTEST_CMAKE_COMMAND} -E tar -xvf ${CTEST_SOURCE_NAME}.tar.gz]")
+ execute_process(COMMAND tar -xvf ${CTEST_SOURCE_NAME}.tar.gz RESULT_VARIABLE rv)
+endif(WIN32)
+
+if(NOT rv EQUAL 0)
+ message("extracting... [error-(${rv}) clean up]")
+ file(REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}")
+ message(FATAL_ERROR "error: extract of ${CTEST_SOURCE_NAME} failed")
+endif(NOT rv EQUAL 0)
+
+#-----------------------------------------------------------------------------
+## Clear the build directory
+## --------------------------
+set(CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE)
+file(MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}")
+ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
+
+# Use multiple CPU cores to build
+include(ProcessorCount)
+ProcessorCount(N)
+if(NOT N EQUAL 0)
+ if(NOT WIN32)
+ set(CTEST_BUILD_FLAGS -j${N})
+ endif(NOT WIN32)
+ set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N})
+endif()
+set (CTEST_CONFIGURE_COMMAND
+ "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\""
+)
+
+#-----------------------------------------------------------------------------
+## -- set output to english
+set($ENV{LC_MESSAGES} "en_EN")
+
+#-----------------------------------------------------------------------------
+ ## NORMAL process
+ ## --------------------------
+ CTEST_START (Experimental)
+ CTEST_CONFIGURE (BUILD "${CTEST_BINARY_DIRECTORY}")
+ CTEST_READ_CUSTOM_FILES ("${CTEST_BINARY_DIRECTORY}")
+ CTEST_BUILD (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND)
+ CTEST_TEST (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res)
+ if(res GREATER 0)
+ message (FATAL_ERROR "tests FAILED")
+ endif(res GREATER 0)
+#-----------------------------------------------------------------------------
+##############################################################################################################
message("DONE") \ No newline at end of file
diff --git a/config/cmake/HDF5Tests.c b/config/cmake/HDF5Tests.c
index 2f69ec8..21206e0 100644
--- a/config/cmake/HDF5Tests.c
+++ b/config/cmake/HDF5Tests.c
@@ -377,10 +377,10 @@ int main(int argc, char **argv)
#endif
#ifdef GETTIMEOFDAY_GIVES_TZ
+#include <time.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
-#include <time.h>
int main(void)
{
struct timeval tv;
diff --git a/config/cmake/NSIS.template.in b/config/cmake/NSIS.template.in
index f28db0f..ecced05 100644
--- a/config/cmake/NSIS.template.in
+++ b/config/cmake/NSIS.template.in
@@ -25,7 +25,7 @@
!include "MUI.nsh"
;Default installation folder
- InstallDir "@CPACK_NSIS_INSTALL_ROOT@\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_DIRECTORY@\@CPACK_PACKAGE_VERSION@"
+ InstallDir "@CPACK_NSIS_INSTALL_ROOT@\@CPACK_PACKAGE_INSTALL_DIRECTORY@"
;--------------------------------
;General
@@ -37,7 +37,7 @@
;Set compression
SetCompressor @CPACK_NSIS_COMPRESSOR@
-@CPACK_NSIS_DEFINES@
+@CPACK_NSIS_DEFINES@
!include Sections.nsh
@@ -71,10 +71,10 @@ Var AR_RegFlags
; This macro reads component installed flag from the registry and
;changes checked state of the section on the components page.
;Input: section index constant name specified in Section command.
-
+
ClearErrors
;Reading component status from registry
- ReadRegDWORD $AR_RegFlags HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@\Components\${SecName}" "Installed"
+ ReadRegDWORD $AR_RegFlags HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@\Components\${SecName}" "Installed"
IfErrors "default_${SecName}"
;Status will stay default if registry value not found
;(component was never installed)
@@ -86,20 +86,20 @@ Var AR_RegFlags
; Note whether this component was installed before
!insertmacro StoreVar ${SecName}_was_installed $AR_RegFlags
IntOp $R0 $AR_RegFlags & $AR_RegFlags
-
+
;Writing modified flags
SectionSetFlags ${${SecName}} $AR_SecFlags
-
+
"default_${SecName}:"
!insertmacro LoadSectionSelectedIntoVar ${SecName} ${SecName}_selected
!macroend
-
+
!macro FinishSection SecName
; This macro reads section flag set by user and removes the section
;if it is not selected.
;Then it writes component installed flag to registry
;Input: section index constant name specified in Section command.
-
+
SectionGetFlags ${${SecName}} $AR_SecFlags ;Reading section flags
;Checking lowest bit:
IntOp $AR_SecFlags $AR_SecFlags & ${SF_SELECTED}
@@ -107,23 +107,23 @@ Var AR_RegFlags
;Section is not selected:
;Calling Section uninstall macro and writing zero installed flag
!insertmacro "Remove_${${SecName}}"
- WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@\Components\${SecName}" \
+ WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@\Components\${SecName}" \
"Installed" 0
Goto "exit_${SecName}"
-
+
"leave_${SecName}:"
;Section is selected:
- WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@\Components\${SecName}" \
+ WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@\Components\${SecName}" \
"Installed" 1
-
+
"exit_${SecName}:"
!macroend
-
-!macro RemoveSection SecName
+
+!macro RemoveSection_CPack SecName
; This macro is used to call section's Remove_... macro
;from the uninstaller.
;Input: section index constant name specified in Section command.
-
+
!insertmacro "Remove_${${SecName}}"
!macroend
@@ -132,18 +132,18 @@ Var AR_RegFlags
!insertmacro LoadVar ${SecName}_selected
SectionGetFlags ${${SecName}} $R1
IntOp $R1 $R1 & ${SF_SELECTED} ;Turn off all other bits
-
+
; See if the status has changed:
IntCmp $R0 $R1 "${SecName}_unchanged"
!insertmacro LoadSectionSelectedIntoVar ${SecName} ${SecName}_selected
-
+
IntCmp $R1 ${SF_SELECTED} "${SecName}_was_selected"
!insertmacro "Deselect_required_by_${SecName}"
goto "${SecName}_unchanged"
-
+
"${SecName}_was_selected:"
!insertmacro "Select_${SecName}_depends"
-
+
"${SecName}_unchanged:"
!macroend
;--- End of Add/Remove macros ---
@@ -153,7 +153,7 @@ Var AR_RegFlags
!define MUI_HEADERIMAGE
!define MUI_ABORTWARNING
-
+
;--------------------------------
; path functions
@@ -168,7 +168,7 @@ Var AR_RegFlags
!include "WinMessages.NSH"
!verbose 4
;====================================================
-; get_NT_environment
+; get_NT_environment
; Returns: the selected environment
; Output : head of the stack
;====================================================
@@ -198,22 +198,22 @@ FunctionEnd
!define WriteEnvStr_RegKey 'HKCU "Environment"'
!endif
!endif
-
+
; AddToPath - Adds the given dir to the search path.
; Input - head of the stack
; Note - Win9x systems requires reboot
-
+
Function AddToPath
Exch $0
Push $1
Push $2
Push $3
-
+
# don't add if the path doesn't exist
IfFileExists "$0\*.*" "" AddToPath_done
-
+
ReadEnvStr $1 PATH
- ; if the path is too long for a NSIS variable NSIS will return a 0
+ ; if the path is too long for a NSIS variable NSIS will return a 0
; length string. If we find that, then warn and skip any path
; modification as it will trash the existing path.
StrLen $2 $1
@@ -243,7 +243,7 @@ Function AddToPath
Call StrStr
Pop $2
StrCmp $2 "" "" AddToPath_done
-
+
Call IsNT
Pop $1
StrCmp $1 1 AddToPath_NT
@@ -258,7 +258,7 @@ Function AddToPath
FileClose $1
SetRebootFlag true
Goto AddToPath_done
-
+
AddToPath_NT:
StrCmp $ADD_TO_PATH_ALL_USERS "1" ReadAllKey
ReadRegStr $1 ${NT_current_env} "PATH"
@@ -279,7 +279,7 @@ Function AddToPath
WriteRegExpandStr ${NT_all_env} "PATH" $0
DoSend:
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
-
+
AddToPath_done:
Pop $3
Pop $2
@@ -287,10 +287,10 @@ Function AddToPath
Pop $0
FunctionEnd
-
+
; RemoveFromPath - Remove a given dir from the path
; Input: head of the stack
-
+
Function un.RemoveFromPath
Exch $0
Push $1
@@ -299,9 +299,9 @@ Function un.RemoveFromPath
Push $4
Push $5
Push $6
-
+
IntFmt $6 "%c" 26 # DOS EOF
-
+
Call un.IsNT
Pop $1
StrCmp $1 1 unRemoveFromPath_NT
@@ -313,7 +313,7 @@ Function un.RemoveFromPath
GetFullPathName /SHORT $0 $0
StrCpy $0 "SET PATH=%PATH%;$0"
Goto unRemoveFromPath_dosLoop
-
+
unRemoveFromPath_dosLoop:
FileRead $1 $3
StrCpy $5 $3 1 -1 # read last char
@@ -328,7 +328,7 @@ Function un.RemoveFromPath
unRemoveFromPath_dosLoopRemoveLine:
SetRebootFlag true
Goto unRemoveFromPath_dosLoop
-
+
unRemoveFromPath_dosLoopEnd:
FileClose $2
FileClose $1
@@ -337,7 +337,7 @@ Function un.RemoveFromPath
CopyFiles /SILENT $4 "$1\autoexec.bat"
Delete $4
Goto unRemoveFromPath_done
-
+
unRemoveFromPath_NT:
StrCmp $ADD_TO_PATH_ALL_USERS "1" unReadAllKey
ReadRegStr $1 ${NT_current_env} "PATH"
@@ -361,11 +361,11 @@ Function un.RemoveFromPath
StrCpy $5 $1 -$4 # $5 is now the part before the path to remove
StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove
StrCpy $3 $5$6
-
+
StrCpy $5 $3 1 -1 # copy last char
StrCmp $5 ";" 0 +2 # if last char == ;
StrCpy $3 $3 -1 # remove last char
-
+
StrCmp $ADD_TO_PATH_ALL_USERS "1" unWriteAllKey
WriteRegExpandStr ${NT_current_env} "PATH" $3
Goto unDoSend
@@ -373,7 +373,7 @@ Function un.RemoveFromPath
WriteRegExpandStr ${NT_all_env} "PATH" $3
unDoSend:
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
-
+
unRemoveFromPath_done:
Pop $6
Pop $5
@@ -383,7 +383,7 @@ Function un.RemoveFromPath
Pop $1
Pop $0
FunctionEnd
-
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Uninstall sutff
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -391,7 +391,7 @@ FunctionEnd
###########################################
# Utility Functions #
###########################################
-
+
;====================================================
; IsNT - Returns 1 if the current system is NT, 0
; otherwise.
@@ -405,7 +405,7 @@ FunctionEnd
; Call IsNT
; Pop $R0
; ($R0 at this point is 1 or 0)
-
+
!macro IsNT un
Function ${un}IsNT
Push $0
@@ -415,7 +415,7 @@ Function ${un}IsNT
Pop $0
Push 0
Return
-
+
IsNT_yes:
; NT!!!
Pop $0
@@ -424,7 +424,7 @@ FunctionEnd
!macroend
!insertmacro IsNT ""
!insertmacro IsNT "un."
-
+
; StrStr
; input, top of stack = string to search for
; top of stack-1 = string to search in
@@ -437,7 +437,7 @@ FunctionEnd
; Call StrStr
; Pop $R0
; ($R0 at this point is "ass string")
-
+
!macro StrStr un
Function ${un}StrStr
Exch $R1 ; st=haystack,old$R1, $R1=needle
@@ -472,28 +472,28 @@ FunctionEnd
!insertmacro StrStr "un."
Function Trim ; Added by Pelaca
- Exch $R1
- Push $R2
+ Exch $R1
+ Push $R2
Loop:
- StrCpy $R2 "$R1" 1 -1
- StrCmp "$R2" " " RTrim
- StrCmp "$R2" "$\n" RTrim
- StrCmp "$R2" "$\r" RTrim
- StrCmp "$R2" ";" RTrim
- GoTo Done
-RTrim:
- StrCpy $R1 "$R1" -1
- Goto Loop
+ StrCpy $R2 "$R1" 1 -1
+ StrCmp "$R2" " " RTrim
+ StrCmp "$R2" "$\n" RTrim
+ StrCmp "$R2" "$\r" RTrim
+ StrCmp "$R2" ";" RTrim
+ GoTo Done
+RTrim:
+ StrCpy $R1 "$R1" -1
+ Goto Loop
Done:
- Pop $R2
- Exch $R1
+ Pop $R2
+ Exch $R1
FunctionEnd
Function ConditionalAddToRegisty
Pop $0
Pop $1
StrCmp "$0" "" ConditionalAddToRegisty_EmptyString
- WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" \
+ WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" \
"$1" "$0"
;MessageBox MB_OK "Set Registry: '$1' to '$0'"
DetailPrint "Set install registry entry: '$1' to '$0'"
@@ -516,7 +516,7 @@ Function DownloadFile
try_again:
NSISdl::download "$1/$0" "$INSTDIR\$0"
-
+
Pop $1
StrCmp $1 "success" success
StrCmp $1 "Cancelled" cancel
@@ -549,10 +549,10 @@ FunctionEnd
!insertmacro MUI_PAGE_LICENSE "@CPACK_RESOURCE_FILE_LICENSE@"
Page custom InstallOptionsPage
!insertmacro MUI_PAGE_DIRECTORY
-
+
;Start Menu Folder Page Configuration
- !define MUI_STARTMENUPAGE_REGISTRY_ROOT "SHCTX"
- !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@"
+ !define MUI_STARTMENUPAGE_REGISTRY_ROOT "SHCTX"
+ !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
!insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER
@@ -637,11 +637,12 @@ Section "-Core installation"
;Use the entire tree produced by the INSTALL target. Keep the
;list of directories here in sync with the RMDir commands below.
SetOutPath "$INSTDIR"
+ @CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS@
@CPACK_NSIS_FULL_INSTALL@
-
+
;Store installation folder
WriteRegStr SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "" $INSTDIR
-
+
;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
Push "DisplayName"
@@ -659,7 +660,7 @@ Section "-Core installation"
Push "NoRepair"
Push "1"
Call ConditionalAddToRegisty
-
+
!ifdef CPACK_NSIS_ADD_REMOVE
;Create add/remove functionality
Push "ModifyPath"
@@ -670,7 +671,7 @@ Section "-Core installation"
Push "1"
Call ConditionalAddToRegisty
!endif
-
+
; Optional registration
Push "DisplayIcon"
Push "$INSTDIR\@CPACK_NSIS_INSTALLED_ICON_NAME@"
@@ -686,7 +687,7 @@ Section "-Core installation"
Call ConditionalAddToRegisty
!insertmacro MUI_INSTALLOPTIONS_READ $INSTALL_DESKTOP "NSIS.InstallOptions.ini" "Field 5" "State"
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
-
+
;Create shortcuts
CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
@CPACK_NSIS_CREATE_ICONS@
@@ -724,7 +725,7 @@ SectionEnd
Section "-Add to path"
Push $INSTDIR\bin
StrCmp "@CPACK_NSIS_MODIFY_PATH@" "ON" 0 doNotAddToPath
- StrCmp $DO_NOT_ADD_TO_PATH "1" doNotAddToPath 0
+ StrCmp $DO_NOT_ADD_TO_PATH "1" doNotAddToPath 0
Call AddToPath
doNotAddToPath:
SectionEnd
@@ -755,12 +756,12 @@ Function un.onInit
SetShellVarContext all
;MessageBox MB_OK 'User "$0" is in the Power Users group'
Goto done
-
+
noLM:
;Get installation folder from registry if available
done:
-
+
FunctionEnd
;--- Add/Remove callback functions: ---
@@ -769,25 +770,25 @@ FunctionEnd
;List all of your components in following manner here.
@CPACK_NSIS_COMPONENT_SECTION_LIST@
!macroend
-
+
Section -FinishComponents
;Removes unselected components and writes component status to registry
!insertmacro SectionList "FinishSection"
-
-!ifdef CPACK_NSIS_ADD_REMOVE
+
+!ifdef CPACK_NSIS_ADD_REMOVE
; Get the name of the installer executable
System::Call 'kernel32::GetModuleFileNameA(i 0, t .R0, i 1024) i r1'
StrCpy $R3 $R0
-
+
; Strip off the last 13 characters, to see if we have AddRemove.exe
StrLen $R1 $R0
IntOp $R1 $R0 - 13
StrCpy $R2 $R0 13 $R1
StrCmp $R2 "AddRemove.exe" addremove_installed
-
+
; We're not running AddRemove.exe, so install it
CopyFiles $R3 $INSTDIR\AddRemove.exe
-
+
addremove_installed:
!endif
SectionEnd
@@ -804,17 +805,17 @@ FunctionEnd
Section "Uninstall"
ReadRegStr $START_MENU SHCTX \
- "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "StartMenu"
+ "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "StartMenu"
;MessageBox MB_OK "Start menu is in: $START_MENU"
ReadRegStr $DO_NOT_ADD_TO_PATH SHCTX \
- "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "DoNotAddToPath"
+ "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "DoNotAddToPath"
ReadRegStr $ADD_TO_PATH_ALL_USERS SHCTX \
- "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "AddToPathAllUsers"
+ "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "AddToPathAllUsers"
ReadRegStr $ADD_TO_PATH_CURRENT_USER SHCTX \
- "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "AddToPathCurrentUser"
+ "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "AddToPathCurrentUser"
;MessageBox MB_OK "Add to path: $DO_NOT_ADD_TO_PATH all users: $ADD_TO_PATH_ALL_USERS"
ReadRegStr $INSTALL_DESKTOP SHCTX \
- "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "InstallToDesktop"
+ "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "InstallToDesktop"
;MessageBox MB_OK "Install to desktop: $INSTALL_DESKTOP "
@CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS@
@@ -824,14 +825,14 @@ Section "Uninstall"
@CPACK_NSIS_DELETE_FILES@
@CPACK_NSIS_DELETE_DIRECTORIES@
-!ifdef CPACK_NSIS_ADD_REMOVE
+!ifdef CPACK_NSIS_ADD_REMOVE
;Remove the add/remove program
Delete "$INSTDIR\AddRemove.exe"
!endif
;Remove the uninstaller itself.
Delete "$INSTDIR\Uninstall.exe"
- DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@"
+ DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@"
;Remove the installation directory if it is empty.
RMDir "$INSTDIR"
@@ -840,24 +841,24 @@ Section "Uninstall"
DeleteRegKey SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@"
; Removes all optional components
- !insertmacro SectionList "RemoveSection"
-
+ !insertmacro SectionList "RemoveSection_CPack"
+
!insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
-
+
Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
@CPACK_NSIS_DELETE_ICONS@
@CPACK_NSIS_DELETE_ICONS_EXTRA@
-
+
;Delete empty start menu parent diretories
StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP"
-
+
startMenuDeleteLoop:
ClearErrors
RMDir $MUI_TEMP
GetFullPathName $MUI_TEMP "$MUI_TEMP\.."
-
+
IfErrors startMenuDeleteLoopDone
-
+
StrCmp "$MUI_TEMP" "$SMPROGRAMS" startMenuDeleteLoopDone startMenuDeleteLoop
startMenuDeleteLoopDone:
@@ -866,17 +867,17 @@ Section "Uninstall"
StrCpy $MUI_TEMP "$START_MENU"
Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
@CPACK_NSIS_DELETE_ICONS_EXTRA@
-
+
;Delete empty start menu parent diretories
StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP"
-
+
secondStartMenuDeleteLoop:
ClearErrors
RMDir $MUI_TEMP
GetFullPathName $MUI_TEMP "$MUI_TEMP\.."
-
+
IfErrors secondStartMenuDeleteLoopDone
-
+
StrCmp "$MUI_TEMP" "$SMPROGRAMS" secondStartMenuDeleteLoopDone secondStartMenuDeleteLoop
secondStartMenuDeleteLoopDone:
@@ -899,22 +900,46 @@ SectionEnd
; "Program Files" for AllUsers, "My Documents" for JustMe...
Function .onInit
+ StrCmp "@CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL@" "ON" 0 inst
+
+ ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "UninstallString"
+ StrCmp $0 "" inst
+
+ MessageBox MB_YESNOCANCEL|MB_ICONEXCLAMATION \
+ "@CPACK_NSIS_PACKAGE_NAME@ is already installed. $\n$\nDo you want to uninstall the old version before installing the new one?" \
+ IDYES uninst IDNO inst
+ Abort
+
+;Run the uninstaller
+uninst:
+ ClearErrors
+ StrLen $2 "\Uninstall.exe"
+ StrCpy $3 $0 -$2 # remove "\Uninstall.exe" from UninstallString to get path
+ ExecWait '$0 _?=$3' ;Do not copy the uninstaller to a temp file
+
+ IfErrors uninst_failed inst
+uninst_failed:
+ MessageBox MB_OK|MB_ICONSTOP "Uninstall failed."
+ Abort
+
+
+inst:
; Reads components status for registry
!insertmacro SectionList "InitSection"
- ; check to see if /D has been used to change
- ; the install directory by comparing it to the
+ ; check to see if /D has been used to change
+ ; the install directory by comparing it to the
; install directory that is expected to be the
; default
StrCpy $IS_DEFAULT_INSTALLDIR 0
- StrCmp "$INSTDIR" "@CPACK_NSIS_INSTALL_ROOT@\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_DIRECTORY@\@CPACK_PACKAGE_VERSION@" 0 +2
+ StrCmp "$INSTDIR" "@CPACK_NSIS_INSTALL_ROOT@\@CPACK_PACKAGE_INSTALL_DIRECTORY@" 0 +2
StrCpy $IS_DEFAULT_INSTALLDIR 1
-
+
StrCpy $SV_ALLUSERS "JustMe"
; if default install dir then change the default
; if it is installed for JustMe
StrCmp "$IS_DEFAULT_INSTALLDIR" "1" 0 +2
- StrCpy $INSTDIR "$DOCUMENTS\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_DIRECTORY@\@CPACK_PACKAGE_VERSION@"
+ StrCpy $INSTDIR "$DOCUMENTS\@CPACK_PACKAGE_INSTALL_DIRECTORY@"
ClearErrors
UserInfo::GetName
@@ -922,17 +947,17 @@ Function .onInit
Pop $0
UserInfo::GetAccountType
Pop $1
- StrCmp $1 "Admin" 0 +3
+ StrCmp $1 "Admin" 0 +4
SetShellVarContext all
;MessageBox MB_OK 'User "$0" is in the Admin group'
StrCpy $SV_ALLUSERS "AllUsers"
Goto done
- StrCmp $1 "Power" 0 +3
+ StrCmp $1 "Power" 0 +4
SetShellVarContext all
;MessageBox MB_OK 'User "$0" is in the Power Users group'
StrCpy $SV_ALLUSERS "AllUsers"
Goto done
-
+
noLM:
StrCpy $SV_ALLUSERS "AllUsers"
;Get installation folder from registry if available
@@ -940,7 +965,7 @@ Function .onInit
done:
StrCmp $SV_ALLUSERS "AllUsers" 0 +3
StrCmp "$IS_DEFAULT_INSTALLDIR" "1" 0 +2
- StrCpy $INSTDIR "@CPACK_NSIS_INSTALL_ROOT@\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_DIRECTORY@\@CPACK_PACKAGE_VERSION@"
+ StrCpy $INSTDIR "@CPACK_NSIS_INSTALL_ROOT@\@CPACK_PACKAGE_INSTALL_DIRECTORY@"
StrCmp "@CPACK_NSIS_MODIFY_PATH@" "ON" 0 noOptionsPage
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "NSIS.InstallOptions.ini"
diff --git a/config/cmake/xlatefile.c b/config/cmake/xlatefile.c
deleted file mode 100644
index e220289..0000000
--- a/config/cmake/xlatefile.c
+++ /dev/null
@@ -1,56 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#define BUFFERSIZE 1024
-
-int main(int argc, char *argv[]) {
- FILE *infile = NULL;
- FILE *outfile = NULL;
- char *buffer = NULL;
- char argbuf[8];
- size_t bytes = 0;
- size_t idx = 0;
- unsigned int lineidx = 0;
- unsigned int stripXlines = 3;
-
- if(argc < 3)
- exit(1);
- if(NULL == (infile = fopen(argv[1], "rb")))
- exit(2);
- if(NULL == (outfile = fopen(argv[2], "wb+")))
- exit(3);
- if(argc > 3)
- if(argv[3][0] == '-')
- if(argv[3][1] == 'l') {
- strcpy(argbuf, &argv[3][2]);
- stripXlines = atoi(argbuf);
- }
- buffer = (char*)malloc(BUFFERSIZE);
- if(buffer) {
- while(!feof(infile)) {
- /* read the file into the buffer. */
- bytes = fread(buffer, 1, BUFFERSIZE, infile);
- if(lineidx < stripXlines) {
- for(idx = 0; idx < bytes; idx++) {
- if(buffer[idx] == '\n') {
- lineidx++;
- if(buffer[idx+1] == '\r')
- idx++;
- }
- if(lineidx >= stripXlines) {
- fwrite(&buffer[idx+1], 1, bytes-idx-1, outfile);
- idx = bytes;
- }
- }
- }
- else
- fwrite(buffer, 1, bytes, outfile);
- }
- free(buffer);
- }
- fclose(outfile);
- fclose(infile);
-
- return 0;
-}