1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmCPackNSISGenerator.h,v $
6 Date: $Date: 2008-10-01 13:04:27 $
7 Version: $Revision: 1.14 $
9 Copyright (c) 2002 Kitware, Inc. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
18 #ifndef cmCPackNSISGenerator_h
19 #define cmCPackNSISGenerator_h
22 #include "cmCPackGenerator.h"
25 /** \class cmCPackNSISGenerator
26 * \brief A generator for NSIS files
28 * http://people.freebsd.org/~kientzle/libarchive/
30 class cmCPackNSISGenerator
: public cmCPackGenerator
33 cmCPackTypeMacro(cmCPackNSISGenerator
, cmCPackGenerator
);
38 cmCPackNSISGenerator();
39 virtual ~cmCPackNSISGenerator();
42 virtual int InitializeInternal();
43 void CreateMenuLinks( cmOStringStream
& str
,
44 cmOStringStream
& deleteStr
);
45 int CompressFiles(const char* outFileName
, const char* toplevel
,
46 const std::vector
<std::string
>& files
);
47 virtual const char* GetOutputExtension() { return ".exe"; }
48 virtual const char* GetOutputPostfix() { return "win32"; }
50 bool GetListOfSubdirectories(const char* dir
,
51 std::vector
<std::string
>& dirs
);
53 virtual bool SupportsComponentInstallation() const;
55 /// Produce a string that contains the NSIS code to describe a
56 /// particular component. Any added macros will be emitted via
59 CreateComponentDescription(cmCPackComponent
*component
,
60 cmOStringStream
& macrosOut
);
62 /// Produce NSIS code that selects all of the components that this component
63 /// depends on, recursively.
64 std::string CreateSelectionDependenciesDescription
65 (cmCPackComponent
*component
,
66 std::set
<cmCPackComponent
*>& visited
);
68 /// Produce NSIS code that de-selects all of the components that are
69 /// dependent on this component, recursively.
70 std::string CreateDeselectionDependenciesDescription
71 (cmCPackComponent
*component
,
72 std::set
<cmCPackComponent
*>& visited
);
74 /// Produce a string that contains the NSIS code to describe a
75 /// particular component group, including its components. Any
76 /// added macros will be emitted via macrosOut.
78 CreateComponentGroupDescription(cmCPackComponentGroup
*group
,
79 cmOStringStream
& macrosOut
);
81 /// Translations any newlines found in the string into \r\n, so that the
82 /// resulting string can be used within NSIS.
83 static std::string
TranslateNewlines(std::string str
);