CMake/Source/CPack/cmCPackNSISGenerator.h

95 lines
3.1 KiB
C
Raw Normal View History

/*============================================================================
CMake - Cross Platform Makefile Generator
Copyright 2000-2009 Kitware, Inc.
2006-01-02 07:21:05 +03:00
Distributed under the OSI-approved BSD License (the "License");
see accompanying file Copyright.txt for details.
2006-01-02 07:21:05 +03:00
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.
============================================================================*/
2006-01-02 07:21:05 +03:00
#ifndef cmCPackNSISGenerator_h
#define cmCPackNSISGenerator_h
2016-09-07 01:21:35 +03:00
#include <cmConfigure.h>
2007-11-06 00:55:45 +03:00
#include "cmCPackGenerator.h"
2016-09-07 01:21:35 +03:00
#include "cmTypeMacro.h"
2016-09-07 01:21:35 +03:00
#include <iosfwd>
#include <set>
2016-09-07 01:21:35 +03:00
#include <string>
#include <vector>
class cmCPackComponent;
class cmCPackComponentGroup;
2006-01-02 07:21:05 +03:00
/** \class cmCPackNSISGenerator
* \brief A generator for NSIS files
*
* http://people.freebsd.org/~kientzle/libarchive/
*/
2007-11-06 00:55:45 +03:00
class cmCPackNSISGenerator : public cmCPackGenerator
2006-01-02 07:21:05 +03:00
{
public:
2007-11-06 00:55:45 +03:00
cmCPackTypeMacro(cmCPackNSISGenerator, cmCPackGenerator);
2006-01-02 07:21:05 +03:00
static cmCPackGenerator* CreateGenerator64()
{
return new cmCPackNSISGenerator(true);
}
2006-01-02 07:21:05 +03:00
/**
* Construct generator
*/
cmCPackNSISGenerator(bool nsis64 = false);
2016-06-27 22:25:27 +03:00
~cmCPackNSISGenerator() CM_OVERRIDE;
2006-01-02 07:21:05 +03:00
protected:
2016-06-27 22:25:27 +03:00
int InitializeInternal() CM_OVERRIDE;
void CreateMenuLinks(std::ostream& str, std::ostream& deleteStr);
2016-06-27 22:25:27 +03:00
int PackageFiles() CM_OVERRIDE;
const char* GetOutputExtension() CM_OVERRIDE { return ".exe"; }
const char* GetOutputPostfix() CM_OVERRIDE { return "win32"; }
bool GetListOfSubdirectories(const char* dir,
std::vector<std::string>& dirs);
2016-06-27 22:25:27 +03:00
enum cmCPackGenerator::CPackSetDestdirSupport SupportsSetDestdir() const
CM_OVERRIDE;
bool SupportsAbsoluteDestination() const CM_OVERRIDE;
bool SupportsComponentInstallation() const CM_OVERRIDE;
2011-10-13 21:51:18 +04:00
/// Produce a string that contains the NSIS code to describe a
/// particular component. Any added macros will be emitted via
ENH: Further refinement of the CPack components functionality from Doug Gregor. Details: ========== - New cpack_add_component, cpack_add_component_group, and cpack_add_install_type "commands" defined as macros in the CPack module. - Documentation for all of the variables and commands in the CPack module. - Added get_cmake_property(... COMPONENTS) to CMake to ask for the names of all components. Used in the CPack module to automatically build component-based installers. (Set CPACK_MONOLITHIC_INSTALL to turn off component-based installation). - A group can declare its PARENT_GROUP, to build an arbitrary hierarchy of groups. - New CPack command cpack_configure_downloads, which creates an installer that downloads only the selected components on-the-fly. Those components marked DOWNLOADED will be separate packages downloaded on-the-fly (or, all packages can be marked as such with the ALL option to cpack_configure_downloads). Individual components are compressed with ZIP at installer-creation time and downloaded/uncompressed by the installer as needed. This feature is only available on Windows with NSIS at the moment. - NSIS installers can install themselves and enable the "Change" button in Add/Remove programs, allowing users to go back and install or remove components. This can be disabled through cpack_configure_downloads, because it's only really useful is most of the application's functionality is in downloaded components. - Bug fix: automatically install everything whose COMPONENT was not specified (it's a hidden, required group) - Bug fix: fixed removal of components when re-running the NSIS installer and unchecking components - Bug fix: NSIS installers now only install/remove the minimal number of files when re-run to update the installation (or by clicking "Change" in Add/Remove programs)
2008-07-08 19:52:25 +04:00
/// macrosOut.
std::string CreateComponentDescription(cmCPackComponent* component,
std::ostream& macrosOut);
/// Produce NSIS code that selects all of the components that this component
/// depends on, recursively.
std::string CreateSelectionDependenciesDescription(
cmCPackComponent* component, std::set<cmCPackComponent*>& visited);
/// Produce NSIS code that de-selects all of the components that are
/// dependent on this component, recursively.
std::string CreateDeselectionDependenciesDescription(
cmCPackComponent* component, std::set<cmCPackComponent*>& visited);
2011-10-13 21:51:18 +04:00
/// Produce a string that contains the NSIS code to describe a
ENH: Further refinement of the CPack components functionality from Doug Gregor. Details: ========== - New cpack_add_component, cpack_add_component_group, and cpack_add_install_type "commands" defined as macros in the CPack module. - Documentation for all of the variables and commands in the CPack module. - Added get_cmake_property(... COMPONENTS) to CMake to ask for the names of all components. Used in the CPack module to automatically build component-based installers. (Set CPACK_MONOLITHIC_INSTALL to turn off component-based installation). - A group can declare its PARENT_GROUP, to build an arbitrary hierarchy of groups. - New CPack command cpack_configure_downloads, which creates an installer that downloads only the selected components on-the-fly. Those components marked DOWNLOADED will be separate packages downloaded on-the-fly (or, all packages can be marked as such with the ALL option to cpack_configure_downloads). Individual components are compressed with ZIP at installer-creation time and downloaded/uncompressed by the installer as needed. This feature is only available on Windows with NSIS at the moment. - NSIS installers can install themselves and enable the "Change" button in Add/Remove programs, allowing users to go back and install or remove components. This can be disabled through cpack_configure_downloads, because it's only really useful is most of the application's functionality is in downloaded components. - Bug fix: automatically install everything whose COMPONENT was not specified (it's a hidden, required group) - Bug fix: fixed removal of components when re-running the NSIS installer and unchecking components - Bug fix: NSIS installers now only install/remove the minimal number of files when re-run to update the installation (or by clicking "Change" in Add/Remove programs)
2008-07-08 19:52:25 +04:00
/// particular component group, including its components. Any
/// added macros will be emitted via macrosOut.
std::string CreateComponentGroupDescription(cmCPackComponentGroup* group,
std::ostream& macrosOut);
2011-03-20 16:22:39 +03:00
/// Translations any newlines found in the string into \\r\\n, so that the
/// resulting string can be used within NSIS.
static std::string TranslateNewlines(std::string str);
bool Nsis64;
2006-01-02 07:21:05 +03:00
};
#endif