MakeNSIS can now generate Unicode or Ansi installers based on a script attribute. SCons generates both Ansi and Unicode stubs and plugins.

The official plugins are now stored in architecture specific subdirectories under NSIS\Plugins. !AddPluginDir also gained a new (optional) architecture flag because MakeNSIS now stores separate plugin information for each target architecture. Storing plugins in the root of the Plugins directory is no longer supported.

MinGW does not implement the unicode CRT startup functions so the entry point functions and linker parameters had to be changed. The unicode tools use the ansi entry point and a small helper function that calls into the real code: _tmain has full argc+argv emulation while wWinMain does not pass the command line parameters. The stubs do not use any CRT functions and have no CRT or unicode helper code, they call our entry point directly.



git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6269 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2012-10-13 01:47:50 +00:00
parent 8f330bbbdf
commit 7cc150c464
73 changed files with 936 additions and 713 deletions

View file

@ -13,35 +13,59 @@
* This software is provided 'as-is', without any express or implied
* warranty.
*
* Unicode support by Jim Park -- 08/21/2007
*/
#ifndef __X18_PLUGINS_H
#define __X18_PLUGINS_H
#ifndef NSIS_EXEHEADPLUGINS_H
#define NSIS_EXEHEADPLUGINS_H
#include <map>
#include <set>
#include "tstring.h"
namespace STLHelpers
{
template<class S, class C>
struct string_nocasecmpless : std::binary_function<S, S, bool>
{
struct cmp : public std::binary_function<C, C, bool>
{
bool operator() (const C&a, const C&b) const
{
return tolower(a) < tolower(b);
}
};
bool operator() (const S&a,const S&b) const
{
return std::lexicographical_compare(a.begin(), a.end(), b.begin(), b.end(), cmp());
}
};
}
class Plugins
{
public:
void FindCommands(const tstring& path, bool displayInfo);
typedef STLHelpers::string_nocasecmpless<tstring, tstring::value_type> strnocasecmp;
Plugins() : m_initialized(false) {}
bool Initialize(const TCHAR*arcsubdir, bool displayInfo);
void AddPluginsDir(const tstring& path, bool displayInfo);
bool IsPluginCommand(const tstring& command) const;
tstring NormalizedCommand(const tstring& command) const;
int GetPluginHandle(bool uninst, const tstring& command) const;
tstring GetPluginPath(const tstring& command) const;
tstring UseUnicodeVariant(const tstring& lcsig) const;
void SetDllDataHandle(bool uninst, const tstring& command, int dataHandle);
bool GetCommandInfo(const tstring&command, tstring&canoniccmd, tstring&dllPath);
int GetDllDataHandle(bool uninst, const tstring& command) const;
void SetDllDataHandle(bool uninst, tstring&canoniccmd, int dataHandle);
private: // methods
void GetExports(const tstring &pathToDll, bool displayInfo);
bool DllHasDataHandle(const tstring& dllnamelowercase) const;
private: // data members
std::map<tstring, tstring> m_command_lowercase_to_command;
std::map<tstring, tstring> m_command_to_path;
std::map<tstring, tstring> m_unicode_variant;
std::map<tstring, int> m_command_to_data_handle;
std::map<tstring, int> m_command_to_uninstall_data_handle;
std::set<tstring, strnocasecmp> m_commands;
std::map<tstring, tstring, strnocasecmp> m_dllname_to_path;
std::map<tstring, int, strnocasecmp> m_dllname_to_inst_datahandle;
std::map<tstring, int, strnocasecmp> m_dllname_to_unst_datahandle;
std::set<tstring, strnocasecmp> m_dllname_conflicts;
bool m_initialized;
};
#endif