Jim Park's Unicode NSIS merging - Step 1 : switch to TCHARs where relevant.
Compiler output is identical before & after this step git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/branches/wizou@6036 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
4e48722b63
commit
752d7d239a
209 changed files with 9698 additions and 7658 deletions
|
@ -1,38 +1,44 @@
|
|||
target = "NSIS"
|
||||
Import('BuildUtil env')
|
||||
|
||||
files = Split("""
|
||||
nsismenu/nsismenu.cpp
|
||||
nsismenu/nslinks.cpp
|
||||
nsismenu/nsismenu.cpp
|
||||
nsismenu/nslinks.cpp
|
||||
""")
|
||||
|
||||
resources = Split("""
|
||||
nsismenu/nsisicon.ico
|
||||
nsismenu/nsisicon.ico
|
||||
""")
|
||||
|
||||
rc = 'nsismenu/nsismenu.rc'
|
||||
|
||||
libs = Split("""
|
||||
advapi32
|
||||
comctl32
|
||||
gdi32
|
||||
shell32
|
||||
user32
|
||||
wxbase28
|
||||
wxmsw28_core
|
||||
wxmsw28_html
|
||||
advapi32
|
||||
comctl32
|
||||
gdi32
|
||||
shell32
|
||||
user32
|
||||
""")
|
||||
|
||||
if env['UNICODE']:
|
||||
libs.append(["wxbase28u", "wxmsw28u_core", "wxmsw28u_html"])
|
||||
else:
|
||||
libs.append(["wxbase28", "wxmsw28_core", "wxmsw28_html"])
|
||||
|
||||
html = Split("""
|
||||
#Menu/index.html
|
||||
#Menu/index.html
|
||||
""")
|
||||
|
||||
images = Split("""
|
||||
#Menu/images/header.gif
|
||||
#Menu/images/line.gif
|
||||
#Menu/images/site.gif
|
||||
#Menu/images/line.gif
|
||||
#Menu/images/site.gif
|
||||
""")
|
||||
|
||||
Import('BuildUtil env')
|
||||
|
||||
if env['UNICODE']:
|
||||
images.append("#Menu/images/Unicode/header.gif")
|
||||
else:
|
||||
images.append("#Menu/images/header.gif")
|
||||
|
||||
import os
|
||||
from os.path import join
|
||||
|
@ -40,56 +46,60 @@ from os.path import join
|
|||
if env['PLATFORM'] != 'win32' and WhereIs('wx-config') or \
|
||||
env['PLATFORM'] == 'win32' and os.environ.has_key('WXWIN'):
|
||||
|
||||
# build
|
||||
# build
|
||||
|
||||
if env['PLATFORM'] != 'win32':
|
||||
rc = libs = []
|
||||
if env['PLATFORM'] != 'win32':
|
||||
rc = libs = []
|
||||
|
||||
nsis_menu = BuildUtil(
|
||||
target,
|
||||
files,
|
||||
libs,
|
||||
res = rc,
|
||||
resources = resources,
|
||||
flags = ['$MSVCRT_FLAG', '$EXCEPTION_FLAG'],
|
||||
root_util = True,
|
||||
cross_platform = True
|
||||
)
|
||||
nsis_menu = BuildUtil(
|
||||
target,
|
||||
files,
|
||||
libs,
|
||||
res = rc,
|
||||
resources = resources,
|
||||
flags = ['$MSVCRT_FLAG', '$EXCEPTION_FLAG'],
|
||||
root_util = True,
|
||||
cross_platform = True
|
||||
)
|
||||
|
||||
# manifest
|
||||
# manifest
|
||||
|
||||
if env.has_key('MSVS_VERSION'):
|
||||
if float(env['MSVS_VERSION'].replace('Exp','')) >= 8.0:
|
||||
manifest = env.SideEffect('%s.exe.manifest' % target, nsis_menu)
|
||||
env.DistributeBin(manifest, alias='install-utils')
|
||||
if env.has_key('MSVS_VERSION'):
|
||||
if float(env['MSVS_VERSION'].replace('Exp','')) >= 8.0:
|
||||
manifest = env.SideEffect('%s.exe.manifest' % target, nsis_menu)
|
||||
env.DistributeBin(manifest, alias='install-utils')
|
||||
|
||||
# set directories
|
||||
# set directories
|
||||
|
||||
if nsis_menu[0].env['PLATFORM'] == 'win32':
|
||||
wxlib = [join(os.environ['WXWIN'], 'lib', 'vc_libnsis')]
|
||||
wxinc = [
|
||||
join(os.environ['WXWIN'], 'include'),
|
||||
join(os.environ['WXWIN'], 'lib', 'vc_libnsis', 'msw')
|
||||
]
|
||||
nsis_menu[0].env.Append(LIBPATH = wxlib)
|
||||
nsis_menu[0].env.Append(CPPPATH = wxinc)
|
||||
else:
|
||||
nsis_menu[0].env.ParseConfig('wx-config --cxxflags --libs')
|
||||
if nsis_menu[0].env['PLATFORM'] == 'win32':
|
||||
wxinc = [join(os.environ['WXWIN'], 'include')]
|
||||
|
||||
# install menu files
|
||||
if env['UNICODE']:
|
||||
wxlib = [join(os.environ['WXWIN'], 'lib', 'vc_libunsis')]
|
||||
wxinc.append(join(os.environ['WXWIN'], 'lib', 'vc_libunsis', 'mswu'))
|
||||
else:
|
||||
wxlib = [join(os.environ['WXWIN'], 'lib', 'vc_libnsis')]
|
||||
wxinc.append(join(os.environ['WXWIN'], 'lib', 'vc_libnsis', 'msw'))
|
||||
|
||||
env.DistributeMenu(html, alias='install-utils')
|
||||
env.DistributeMenu(images, path='images', alias='install-utils')
|
||||
nsis_menu[0].env.Append(LIBPATH = wxlib)
|
||||
nsis_menu[0].env.Append(CPPPATH = wxinc)
|
||||
else:
|
||||
nsis_menu[0].env.ParseConfig('wx-config --cxxflags --libs')
|
||||
|
||||
# install menu files
|
||||
|
||||
env.DistributeMenu(html, alias='install-utils')
|
||||
env.DistributeMenu(images, path='images', alias='install-utils')
|
||||
|
||||
else:
|
||||
|
||||
# no wxWidgets
|
||||
def err(target, source, env):
|
||||
if env['PLATFORM'] == 'win32':
|
||||
print '*** error: WXWIN must be set to build NSIS Menu!'
|
||||
else:
|
||||
print '*** error: wx-config must be in the PATH to build NSIS Menu!'
|
||||
return 1
|
||||
|
||||
# no wxWidgets
|
||||
def err(target, source, env):
|
||||
if env['PLATFORM'] == 'win32':
|
||||
print '*** error: WXWIN must be set to build NSIS Menu!'
|
||||
else:
|
||||
print '*** error: wx-config must be in the PATH to build NSIS Menu!'
|
||||
return 1
|
||||
|
||||
cmd = env.Command(target, files, Action(err, ''))
|
||||
env.Alias('NSIS Menu', cmd)
|
||||
cmd = env.Command(target, files, Action(err, ''))
|
||||
env.Alias('NSIS Menu', cmd)
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// NSIS MENU
|
||||
//
|
||||
// Reviewed for Unicode support by Jim Park -- 08/23/2007
|
||||
// Basically, compiling wxWidgets as Unicode should do it.
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// For compilers that support precompilation, includes "wx/wx.h".
|
||||
|
@ -100,7 +103,7 @@ private:
|
|||
|
||||
// Create the main application window
|
||||
MyFrame *frame = new MyFrame(_("NSIS Menu"),
|
||||
wxPoint(50, 50), wxSize(600 + wxSystemSettings::GetMetric(wxSYS_FRAMESIZE_X), 355 + wxSystemSettings::GetMetric(wxSYS_FRAMESIZE_X)));
|
||||
wxPoint(50, 50), wxSize(600 + wxSystemSettings::GetMetric(wxSYS_FRAMESIZE_X), 365 + wxSystemSettings::GetMetric(wxSYS_FRAMESIZE_X)));
|
||||
|
||||
// Show it and tell the application that it's our main window
|
||||
|
||||
|
@ -154,10 +157,10 @@ void MyFrame::OnLink(wxHtmlLinkEvent& event)
|
|||
if (e == NULL || e->LeftUp())
|
||||
{
|
||||
const wxString href = event.GetLinkInfo().GetHref();
|
||||
if (href.Left(3).IsSameAs((const wxChar*)"EX:", false))
|
||||
if (href.Left(3).IsSameAs((const wxChar*) wxT("EX:"), false))
|
||||
{
|
||||
wxString url = href.Mid(3);
|
||||
if (url.Left(7).IsSameAs((const wxChar*)"http://", false) || url.Left(6).IsSameAs((const wxChar*)"irc://", false))
|
||||
if (url.Left(7).IsSameAs((const wxChar*) wxT("http://"), false) || url.Left(6).IsSameAs((const wxChar*) wxT("irc://"), false))
|
||||
{
|
||||
::wxLaunchDefaultBrowser(url);
|
||||
}
|
||||
|
|
|
@ -2,9 +2,12 @@
|
|||
// Name: src/html/m_links.cpp
|
||||
// Purpose: wxHtml module for links & anchors
|
||||
// Author: Vaclav Slavik
|
||||
// RCS-ID: $Id: nslinks.cpp,v 1.1 2007/02/24 18:57:09 kichik Exp $
|
||||
// RCS-ID: $Id: nslinks.cpp,v 1.2 2007/03/08 01:47:14 pabs3 Exp $
|
||||
// Copyright: (c) 1999 Vaclav Slavik
|
||||
// Licence: wxWindows licence
|
||||
//
|
||||
// Reviewed for Unicode support by Jim Park -- 08/23/2007
|
||||
// Basically, compiling wxWidgets as Unicode should do it.
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "wx/wxprec.h"
|
||||
|
@ -60,10 +63,10 @@ TAG_HANDLER_BEGIN(A, "A")
|
|||
wxColour colour = m_WParser->GetLinkColor();
|
||||
wxHtmlLinkInfo linkInfo(name, target);
|
||||
|
||||
if (name.Left(3).IsSameAs((const wxChar*)"EX:", false))
|
||||
if (name.Left(3).IsSameAs((const wxChar*) wxT("EX:"), false))
|
||||
{
|
||||
wxString url = name.Mid(3);
|
||||
if (!url.Left(7).IsSameAs((const wxChar*)"http://", false) && !url.Left(6).IsSameAs((const wxChar*)"irc://", false))
|
||||
if (!url.Left(7).IsSameAs((const wxChar*) wxT("http://"), false) && !url.Left(6).IsSameAs((const wxChar*) wxT("irc://"), false))
|
||||
{
|
||||
wxString exePath = wxStandardPaths::Get().GetExecutablePath();
|
||||
wxString path = ::wxPathOnly(exePath);
|
||||
|
|
|
@ -7,6 +7,9 @@
|
|||
// RCS-ID: $Id: setup0.h,v 1.246 2006/11/09 00:54:51 VZ Exp $
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
//
|
||||
// Reviewed for Unicode support by Jim Park -- 08/01/2007
|
||||
// (This one is the ANSI version.)
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_SETUP_H_
|
||||
|
|
|
@ -1,12 +1,42 @@
|
|||
@echo off
|
||||
if not exist setup.h goto setup_error
|
||||
if not exist "%WXWIN%\build\msw\makefile.vc" goto error
|
||||
set OLDCD=%CD%
|
||||
cd /D "%WXWIN%\build\msw"
|
||||
rem Save the old setup.h as old_setup.h in the starting dir.
|
||||
copy /y "%WXWIN%\include\wx\msw\setup.h" "%OLDCD%\old_setup.h"
|
||||
copy /y "%OLDCD%\setup.h" "%WXWIN%\include\wx\msw\setup.h"
|
||||
|
||||
if "%1" == "unicode" goto unicode
|
||||
if "%1" == "ansi" goto ansi
|
||||
:ansi
|
||||
rem Ask if we want to delete this dir.
|
||||
echo Deleting...
|
||||
rd /S ..\..\lib\vc_libnsis
|
||||
|
||||
echo ### building ANSI version ###
|
||||
rem Copy the ANSI version of setup.h to WXWIN setup.
|
||||
copy /y "%OLDCD%\setup.h" "%WXWIN%\include\wx\msw\setup.h"
|
||||
echo Deleting...
|
||||
rd /S vc_mswnsis
|
||||
nmake -f makefile.vc CFG=nsis BUILD=release RUNTIME_LIBS=dynamic SHARED=0 UNICODE=0 WXUNIV=0 USE_OPENGL=0 USE_ODBC=0 USE_HTML=1 USE_XRC=0
|
||||
nmake -f makefile.vc CFG=nsis BUILD=release RUNTIME_LIBS=static SHARED=0 UNICODE=0 WXUNIV=0 USE_OPENGL=0 USE_ODBC=0 USE_HTML=1 USE_XRC=0
|
||||
if "%1" == "" goto unicode
|
||||
if "%1" == "all" goto unicode
|
||||
goto finish
|
||||
|
||||
:unicode
|
||||
rem Ask if we want to delete this dir.
|
||||
echo Deleting...
|
||||
rd /S ..\..\lib\vc_libunsis
|
||||
|
||||
echo ### building UNICODE version ###
|
||||
rem Copy the UNICODE version of setup.h to WXWIN setup.
|
||||
copy /y "%OLDCD%\setup_unicode.h" "%WXWIN%\include\wx\msw\setup.h"
|
||||
echo Deleting...
|
||||
rd /S vc_mswunsis
|
||||
nmake -f makefile.vc CFG=unsis BUILD=release RUNTIME_LIBS=static SHARED=0 UNICODE=1 WXUNIV=0 USE_OPENGL=0 USE_ODBC=0 USE_HTML=1 USE_XRC=0
|
||||
|
||||
:finish
|
||||
rem Restore the setup.h
|
||||
copy /y "%OLDCD%\old_setup.h" "%WXWIN%\include\wx\msw\setup.h"
|
||||
cd /D "%OLDCD%"
|
||||
goto done
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue