NDEVR
API Documentation
InstallerManager.h
1#pragma once
2#include "InstallerBuilder/Headers/InstallerManager.h"
3#include "Base/Headers/String.h"
4#include "Base/Headers/File.h"
5#include "Base/Headers/TranslatedString.h"
6#include "Base/Headers/ModuleManager.h"
7#include "Base/Headers/ModuleResourceManager.h"
8#include "Base/Headers/Set.h"
9namespace NDEVR
10{
15 {
21 void addLine(const StringView& line);
23 void begin();
25 void end();
26 };
27
45
63
76
101
105 {
106 public:
112 bool is_64_bit = true;
113 protected:
115 protected:
120 static String WixTranslationID(String translation_id);
125 static uint04 CodePage(String translation_id);
131 static void AddString(const TranslatedString& string, WixInstallerFile& wix, const String& language);
146 static void AddFeatureHeading(const WixInstallerFeature& feature, WixInstallerFile& wix);
150 static void EndFeature(WixInstallerFile& wix);
155 static void AddFeature(const WixInstallerFeature& feature, WixInstallerFile& wix);
160 String fileIDName(const File& file) const;
165 String fileID(const File& file) const;
170 void addFile(const File& file, WixInstallerFile& wix) const;
181 void addDirectoryFiles(const String& directory, const Buffer<File>& files, WixInstallerFile& wix) const;
186 static String CreateWixGUID(const String& input);
191 void addDirectory(const WixDirectory& directory, WixInstallerFile& wix) const;
197 void calculateFeature(WixInstallerFeature& feature, WixFragment& fragment, Set<String>& global_features) const;
207 static String FolderID(const StringView& resource);
212 static void WriteImage(const StringView& image, File folder_location);
223 static String OutputName(const String& language);
233 void createLanguage(const String& language, WixInstallerFile& wix);
242 public:
245 };
246}
The equivelent of std::vector but with a bit more control.
Definition Buffer.hpp:58
A hash-based key-value store, useful for quick associative lookups.
Definition Dictionary.h:64
Logic for reading or writing to a file as well as navigating filesystems or other common file operati...
Definition File.h:53
A light-weight wrapper that will be a no-op if there is not a valid log reference,...
Container that stores unique elements in no particular order, and which allow for fast retrieval or i...
Definition Set.h:59
The core String View class for the NDEVR API.
Definition StringView.h:58
The core String class for the NDEVR API.
Definition String.h:95
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Manages the creation of WiX-based Windows installer projects from NDEVR module definitions.
String fileID(const File &file) const
Generates a unique WiX file ID from a file path.
Set< TranslatedString > strings
Collected translatable strings for the installer.
void createLanguage(const String &language, WixInstallerFile &wix)
Creates the language-specific WiX source files.
void writeProjectFile(const String &language, WixInstallerFile &file)
Writes the WiX project file for a specific language.
bool is_64_bit
Whether to build a 64-bit installer.
void buildBatchFiles()
Builds the batch files for compiling the installer.
WixInstallerFeature prepareModule(const Module &module, WixDirectory &directory)
Prepares a module's files and features for the installer.
static void AddFeatureHeading(const WixInstallerFeature &feature, WixInstallerFile &wix)
Writes the opening XML for a feature in the WiX file.
static void EndFeature(WixInstallerFile &wix)
Closes a feature element in the WiX file.
static String FolderID(const StringView &resource)
Generates a WiX folder ID from a resource path.
static uint04 CodePage(String translation_id)
Gets the code page number for a given translation ID.
File msi_folder
The folder for MSI output files.
void addDirectoryFiles(const String &directory, const Buffer< File > &files, WixInstallerFile &wix) const
Adds directory file entries to the WiX file.
void addDirectory(const WixDirectory &directory, WixInstallerFile &wix) const
Writes directory structure entries to the WiX file.
void addFile(const File &file, WixInstallerFile &wix) const
Adds a file entry to the WiX file.
Buffer< String > fileIDs(const Buffer< File > &files) const
Generates file IDs for a buffer of files.
static void AddFirewallException(const FireWallException &exception, WixInstallerFile &file)
Adds a firewall exception entry to the WiX file.
void createInstallerProject()
Creates the complete installer project from the module list.
File in_dir
The input directory containing module resources.
File out_dir
The output directory for the installer project.
void calculateFeature(WixInstallerFeature &feature, WixFragment &fragment, Set< String > &global_features) const
Calculates the full set of files and components for a feature.
LogPtr log
Log pipe for progress and error reporting.
void createModuleWXS()
Creates the main module WXS source files.
static void WriteImage(const StringView &image, File folder_location)
Writes an image resource to a folder.
void addFragment(WixFragment &fragment, WixInstallerFile &wix)
Writes a complete fragment to the WiX file.
void writeHeaderFile()
Writes the WiX header include file.
File module_list
The file listing modules to include in the installer.
static String OutputName(const String &language)
Gets the output MSI file name for a language.
static String CreateWixGUID(const String &input)
Creates a deterministic GUID from a string input.
static String WixTranslationID(String translation_id)
Converts a translation ID to a WiX-compatible translation identifier.
void writePlatformSetup()
Writes platform-specific setup configuration.
static void AddRegistryAction(const RegistryKeyAction &exception, WixInstallerFile &file)
Adds a registry action entry to the WiX file.
String fileIDName(const File &file) const
Generates a WiX-safe file ID name from a file path.
static void AddString(const TranslatedString &string, WixInstallerFile &wix, const String &language)
Adds a translated string entry to the WiX file.
static void AddFeature(const WixInstallerFeature &feature, WixInstallerFile &wix)
Writes a complete feature element including all its components.
The primary namespace for the NDEVR SDK.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
@ file
The source file path associated with this object.
Stores information relating to a particular FireWallException needed by a Module or feature.
Manages module resources for building installers, including file offloading and icon retrieval.
static String MainAppIcon()
Gets the main application icon resource name.
Dictionary< String, Buffer< File > > other_files
Additional files by directory.
static File OffloadResource(StringView resource, File folder_location, bool to_root=false)
Extracts a resource to a folder location.
Module module
The module being packaged.
static bool ResourceExists(String resource)
Checks whether a resource exists.
Dictionary< String, Buffer< File > > global_files
Globally shared files by directory.
Base class for extensions, typically added as external DLL's that can modify or enhance the behavior ...
Information about a specific registry action to be taken, typically at install-time.
Represents a directory tree structure within a WiX installer project.
WixDirectory(const StringView &id)
Constructs a WixDirectory with the given ID.
String id
The directory identifier.
~WixDirectory()
Destructor.
void addFromResource(const String &resource)
Adds child directories from a resource string.
Dictionary< String, WixDirectory * > children
Child directories by name.
Collects all data for a WiX installer fragment including directories, features, and files.
Dictionary< String, WixInstallerFeature > features
Sub-features by ID.
Dictionary< String, Buffer< RegistryKeyAction > > registry_actions
Registry actions by feature.
Dictionary< String, Buffer< File > > install_exe
Executables by directory.
Dictionary< String, Buffer< FireWallException > > firewall_exceptions
Firewall exceptions by feature.
Dictionary< String, Buffer< File > > files
Files by directory.
WixDirectory directories
The root directory tree.
WixInstallerFeature container
The top-level feature container.
Describes a feature within a WiX installer, including its files and components.
TranslatedString decription
The description of the feature.
Buffer< String > components
Component IDs belonging to this feature.
Dictionary< String, Set< File > > install_exe
Executable files to install for this feature.
Buffer< RegistryKeyAction > registry_actions
Registry actions for this feature.
TranslatedString title
The display title for the feature.
Dictionary< String, Set< File > > files
Files grouped by directory for this feature.
bool display
Whether the feature is shown in the installer UI.
Buffer< FireWallException > firewall_exceptions
Firewall exceptions for this feature.
String id
The unique feature identifier.
uint04 level
The install level (1 = default install).
bool allow_advertise
Whether the feature can be advertised.
bool allow_absent
Whether the feature can be left uninstalled.
Represents a WiX installer XML file being written, with indentation tracking.
void addLine(const StringView &line)
Adds a line of content to the file at the current indentation level.
void end()
Closes the root element and finalizes the file.
File file
The output file being written.
uint04 tab_depth
The current indentation depth.
void begin()
Writes the XML file header and opens the root element.