Unicode port: Unicode version of NSIS can now generate both ANSI & Unicode installers (using new instruction UnicodeInstaller on/off).

Stubs & Plugins differentiation is done automatically using a 'W' suffix.
SConscripts need to be reviewed to generate both variants of Plugins & pluginapi.lib under Unicode compilation.

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6100 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
wizou 2010-06-14 10:07:22 +00:00
parent fbc7cb8fd0
commit 57f7ff8a1c
24 changed files with 376 additions and 112 deletions

View file

@ -54,18 +54,29 @@ void writer_sink::write_int_array(const int i[], const size_t len)
void writer_sink::write_string(const TCHAR *s, size_t size)
{
#ifdef _UNICODE
bool strEnd = false;
TCHAR ch;
for (; size ; size--)
if (m_build_unicode)
{
if (!strEnd)
bool strEnd = false;
TCHAR ch;
for (; size ; size--)
{
ch = *s++;
if (ch == _T('\0'))
strEnd = true;
if (!strEnd)
{
ch = *s++;
if (ch == _T('\0'))
strEnd = true;
}
write_short(ch);
}
write_short(ch);
}
else
{
char *wb = new char[size];
memset(wb, 0, size);
WideCharToMultiByte(CP_ACP, 0, s, -1, wb, size, NULL, NULL);
write_data(wb, size);
delete [] wb;
}
#else
char *wb = new char[size];
memset(wb, 0, size);