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

@ -80,6 +80,7 @@ int GetTLBVersion(tstring& filepath, DWORD& high, DWORD & low)
#endif
}
NSIS_ENTRYPOINT_TMAIN
int _tmain(int argc, TCHAR* argv[])
{

View file

@ -1,5 +1,6 @@
// Unicode support by Jim Park & Olivier Marcoux
#include "../../../Source/Platform.h"
#include <windows.h>
#include <tchar.h>
@ -15,7 +16,8 @@ void RegDll(TCHAR *file);
void RegTypeLib(TCHAR *file);
void DeleteFileOnReboot(TCHAR *pszFile);
int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
NSIS_ENTRYPOINT_GUINOCRT
EXTERN_C void NSISWinMainNOCRT()
{
TCHAR *cmdline;
TCHAR seekchar = _T(' ');
@ -33,7 +35,6 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdL
if (*cmdline++ != _T('/'))
{
ExitProcess(1);
return 0;
}
if (*cmdline == _T('S'))
@ -113,7 +114,6 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdL
}
ExitProcess(0);
return 0;
}
void SafeWow64EnableWow64FsRedirection(BOOL Wow64FsEnableRedirection)

View file

@ -13,6 +13,5 @@ libs = Split("""
""")
Import('BuildUtil')
Import('_tWinMain')
BuildUtil(target, files, libs, entry = _tWinMain, nodeflib = True, file_name = 'RegTool.bin')
BuildUtil(target, files, libs, entry = 'NSISWinMainNOCRT', nodeflib = True, file_name = 'RegTool.bin')

View file

@ -13,7 +13,7 @@
#define NSISFunction(funcname) extern "C" void __declspec(dllexport) funcname(HWND hwndParent, int string_size, TCHAR *variables, stack_t **stacktop)
extern "C" BOOL WINAPI DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved) {
extern "C" BOOL WINAPI DllMain(HINSTANCE hInst, ULONG ul_reason_for_call, LPVOID lpReserved) {
return TRUE;
}