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

@ -56,7 +56,8 @@ TCHAR *ValidateTempDir()
void *g_SHGetFolderPath;
int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPTSTR lpszCmdParam, int nCmdShow)
NSIS_ENTRYPOINT_GUINOCRT
EXTERN_C void NSISWinMainNOCRT()
{
int ret = 0;
const TCHAR *m_Err = _LANG_ERRORWRITINGTEMP;
@ -307,7 +308,6 @@ end:
{
my_MessageBox(m_Err, MB_OK | MB_ICONSTOP | (IDOK << 21));
ExitProcess(2);
return 0;
}
#ifdef NSIS_SUPPORT_REBOOT
@ -341,7 +341,6 @@ end:
ret = g_exec_flags.errlvl;
ExitProcess(ret);
return 0;
}
void NSISCALL CleanUp()

View file

@ -59,6 +59,8 @@ env.Append(CPPDEFINES = ['_WIN32_IE=0x0500'])
if 'NSIS_CONFIG_LOG_STDOUT' in env['NSIS_CPPDEFINES']:
env.Append(LINKFLAGS = env['SUBSYS_CON'])
else:
env.Append(LINKFLAGS = env['SUBSYS_WIN'])
### Compression specific configuration

View file

@ -714,7 +714,7 @@ skipPage:
#include <richedit.h>
#undef _RICHEDIT_VER
static DWORD dwRead;
DWORD CALLBACK StreamLicense(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
DWORD CALLBACK StreamLicense(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
{
lstrcpyn((LPTSTR)pbBuff,(LPTSTR)(dwCookie+dwRead),cb/sizeof(TCHAR));
*pcb=lstrlen((LPTSTR)pbBuff)*sizeof(TCHAR);
@ -723,11 +723,11 @@ DWORD CALLBACK StreamLicense(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
}
#ifdef _UNICODE
// on-the-fly conversion of Unicode to ANSI (because Windows doesn't recognize Unicode RTF data)
DWORD CALLBACK StreamLicenseRTF(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
DWORD CALLBACK StreamLicenseRTF(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
{
size_t len = lstrlen(((LPWSTR) dwCookie)+dwRead);
len = min(len, cb/sizeof(WCHAR));
*pcb=WideCharToMultiByte(CP_ACP,0,((LPWSTR) dwCookie)+dwRead,len,pbBuff,cb,NULL,NULL);
*pcb=WideCharToMultiByte(CP_ACP,0,((LPWSTR) dwCookie)+dwRead,len,(char*)pbBuff,cb,NULL,NULL);
// RTF uses only ASCII characters, so we can assume "number of output bytes" = "number of source WChar consumed"
dwRead+=*pcb;
return 0;

View file

@ -49,7 +49,7 @@ NSIS_STRING g_usrvarssection[1];
# ifdef __GNUC__
// GCC does not treat g_usrvarssection as a bss section so we keep the size as small as possible.
// NSIS_STRING g_usrvarssection[31] is required to remove this hack but that really bloats the exehead.
char g_usrvarssection[1] __attribute__((section (NSIS_VARS_SECTION)));
TCHAR g_usrvarssection[1] __attribute__((section (NSIS_VARS_SECTION)));
const NSIS_STRING*const g_usrvarsstart = (const NSIS_STRING*const) g_usrvarssection;
# else
# error Unknown compiler. You must implement the seperate PE section yourself.