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:
parent
8f330bbbdf
commit
7cc150c464
73 changed files with 936 additions and 713 deletions
|
@ -24,29 +24,31 @@ example = Split("""
|
|||
extdll.inc
|
||||
""")
|
||||
|
||||
Import('env plugin_env plugin_uenv')
|
||||
Import('env plugin_env plugin_uenv GetArcSuffix PerformPluginExtrasDistOperationOnce')
|
||||
|
||||
unicodetarget = 'UNICODE' in env['CPPDEFINES']
|
||||
lib_targetT = lib_target
|
||||
plugin_envT = plugin_env
|
||||
if unicodetarget:
|
||||
plugin_envT = plugin_uenv
|
||||
lib_targetT = lib_target + '-' + GetArcSuffix(plugin_envT, unicodetarget)
|
||||
|
||||
|
||||
|
||||
# build library
|
||||
if unicodetarget:
|
||||
lib_targetT = lib_targetT + 'W'
|
||||
api_uenv = plugin_uenv.Clone()
|
||||
api_uenv.Append(CPPPATH = ['#Source/exehead'])
|
||||
libW = api_uenv.Library(lib_targetT, lib_files)
|
||||
lib = libW
|
||||
else:
|
||||
api_env = plugin_env.Clone()
|
||||
api_env.Append(CPPPATH = ['#Source/exehead'])
|
||||
libA = api_env.Library(lib_targetT, lib_files)
|
||||
lib = libA
|
||||
|
||||
api_envT = plugin_envT.Clone()
|
||||
api_envT.Append(CPPPATH = ['#Source/exehead']) # For api.h
|
||||
lib = api_envT.Library(lib_targetT, lib_files)
|
||||
|
||||
|
||||
# distribute library, files and examples
|
||||
|
||||
if PerformPluginExtrasDistOperationOnce(plugin_envT, unicodetarget):
|
||||
env.DistributeExamples(api_files, path='Plugin/nsis')
|
||||
env.DistributeExamples(example, path='Plugin')
|
||||
|
||||
if env['PLATFORM'] == 'win32':
|
||||
env.DistributeExamples(lib, path='Plugin/nsis')
|
||||
|
||||
else:
|
||||
example += lib_files
|
||||
|
||||
|
@ -56,20 +58,14 @@ else:
|
|||
if env.has_key('PREFIX_PLUGINAPI_LIB'):
|
||||
env.Distribute(lib, None, 'pluginapi_lib', '', 'nsis', 'pluginapi', 'pluginapi')
|
||||
|
||||
if not unicodetarget:
|
||||
env.DistributeExamples(api_files, path='Plugin/nsis')
|
||||
env.DistributeExamples(example, path='Plugin')
|
||||
|
||||
# make sure all the other plug-ins can use the library
|
||||
|
||||
if unicodetarget:
|
||||
envT = plugin_uenv
|
||||
env.Install('#$BUILD_PREFIX/api/nsis', libW)
|
||||
else:
|
||||
envT = plugin_env
|
||||
env.Install('#$BUILD_PREFIX/api/nsis', api_files + libA)
|
||||
if PerformPluginExtrasDistOperationOnce(plugin_envT, unicodetarget):
|
||||
env.Install('#$BUILD_PREFIX/api/nsis', api_files)
|
||||
|
||||
envT.Append(CPPPATH = ['#$BUILD_PREFIX/api'])
|
||||
envT.Append(LIBPATH = ['#$BUILD_PREFIX/api/nsis'])
|
||||
envT.Append(LIBS = [lib_targetT])
|
||||
env.Install('#$BUILD_PREFIX/api/nsis', lib)
|
||||
plugin_envT.Append(CPPPATH = ['#$BUILD_PREFIX/api'])
|
||||
plugin_envT.Append(LIBPATH = ['#$BUILD_PREFIX/api/nsis'])
|
||||
plugin_envT.Append(LIBS = [lib_targetT])
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ void __declspec(dllexport) myFunction(HWND hwndParent, int string_size,
|
|||
|
||||
|
||||
|
||||
BOOL WINAPI DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)
|
||||
BOOL WINAPI DllMain(HINSTANCE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)
|
||||
{
|
||||
g_hInstance=hInst;
|
||||
return TRUE;
|
||||
|
|
|
@ -22,19 +22,25 @@
|
|||
#define _T(x) __T(x)
|
||||
#define _TEXT(x) __T(x)
|
||||
#endif
|
||||
|
||||
#ifndef _TCHAR_DEFINED
|
||||
#define _TCHAR_DEFINED
|
||||
#if !defined(_NATIVE_WCHAR_T_DEFINED) && !defined(_WCHAR_T_DEFINED)
|
||||
typedef unsigned short TCHAR;
|
||||
#else
|
||||
typedef wchar_t TCHAR;
|
||||
typedef wchar_t _TUCHAR;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
// program
|
||||
#define _tmain wmain
|
||||
#define _tWinMain wWinMain
|
||||
#define _tenviron _wenviron
|
||||
#define __targv __wargv
|
||||
|
||||
// printfs
|
||||
#define _ftprintf fwprintf
|
||||
#define _sntprintf _snwprintf
|
||||
#if defined(_MSC_VER) && (_MSC_VER<=1200)
|
||||
#if (defined(_MSC_VER) && (_MSC_VER<=1310)) || defined(__MINGW32__)
|
||||
# define _stprintf swprintf
|
||||
#else
|
||||
# define _stprintf _swprintf
|
||||
|
@ -42,7 +48,11 @@ typedef wchar_t _TUCHAR;
|
|||
#define _tprintf wprintf
|
||||
#define _vftprintf vfwprintf
|
||||
#define _vsntprintf _vsnwprintf
|
||||
#define _vstprintf _vswprintf
|
||||
#if defined(_MSC_VER) && (_MSC_VER<=1310)
|
||||
# define _vstprintf vswprintf
|
||||
#else
|
||||
# define _vstprintf _vswprintf
|
||||
#endif
|
||||
|
||||
// scanfs
|
||||
#define _tscanf wscanf
|
||||
|
@ -119,12 +129,13 @@ typedef wchar_t _TUCHAR;
|
|||
#define _T(x) x
|
||||
#define _TEXT(x) x
|
||||
#endif
|
||||
typedef char TCHAR;
|
||||
typedef unsigned char _TUCHAR;
|
||||
|
||||
#ifndef _TCHAR_DEFINED
|
||||
#define _TCHAR_DEFINED
|
||||
typedef char TCHAR;
|
||||
#endif
|
||||
|
||||
// program
|
||||
#define _tmain main
|
||||
#define _tWinMain WinMain
|
||||
#define _tenviron environ
|
||||
#define __targv __argv
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue