Jim Park's Unicode NSIS merging - Step 4 : merging more TCHAR stuff that shouldn't have any impact
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6041 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
8ab72b9ece
commit
acf9a8c21f
41 changed files with 937 additions and 586 deletions
|
@ -351,7 +351,7 @@ HRESULT CEncoder::Create()
|
|||
|
||||
static int FindMatchFinder(const wchar_t *s)
|
||||
{
|
||||
for (int m = 0; m < (int)(sizeof(kMatchFinderIDs) / sizeof(kMatchFinderIDs[0])); m++)
|
||||
for (int m = 0; m < (int)(_countof(kMatchFinderIDs)); m++)
|
||||
if (AreStringsEqual(kMatchFinderIDs[m], s))
|
||||
return m;
|
||||
return -1;
|
||||
|
|
|
@ -436,12 +436,6 @@ void CDialogTemplate::ConvertToRTL() {
|
|||
for (unsigned int i = 0; i < m_vItems.size(); i++) {
|
||||
bool addExStyle = false;
|
||||
bool addExLeftScrollbar = true;
|
||||
char *szClass;
|
||||
|
||||
if (IS_INTRESOURCE(m_vItems[i]->szClass))
|
||||
szClass = (char *) m_vItems[i]->szClass;
|
||||
else
|
||||
szClass = winchar_toansi(m_vItems[i]->szClass);
|
||||
|
||||
// Button
|
||||
if ((ULONG_PTR)(m_vItems[i]->szClass) == 0x80) {
|
||||
|
@ -474,18 +468,18 @@ void CDialogTemplate::ConvertToRTL() {
|
|||
m_vItems[i]->dwStyle |= SS_CENTERIMAGE;
|
||||
}
|
||||
}
|
||||
else if (!IS_INTRESOURCE(m_vItems[i]->szClass) && !stricmp(szClass, "RichEdit20A")) {
|
||||
else if (!IS_INTRESOURCE(m_vItems[i]->szClass) && !_wcsicmp(m_vItems[i]->szClass, L"RichEdit20A")) {
|
||||
if ((m_vItems[i]->dwStyle & ES_CENTER) == 0) {
|
||||
m_vItems[i]->dwStyle ^= ES_RIGHT;
|
||||
}
|
||||
}
|
||||
else if (!IS_INTRESOURCE(m_vItems[i]->szClass) && !stricmp(szClass, "SysTreeView32")) {
|
||||
else if (!IS_INTRESOURCE(m_vItems[i]->szClass) && !_wcsicmp(m_vItems[i]->szClass, L"SysTreeView32")) {
|
||||
m_vItems[i]->dwStyle |= TVS_RTLREADING;
|
||||
m_vItems[i]->dwExtStyle |= WS_EX_LAYOUTRTL;
|
||||
addExStyle = true;
|
||||
addExLeftScrollbar = false;
|
||||
}
|
||||
else if (!IS_INTRESOURCE(m_vItems[i]->szClass) && !stricmp(szClass, "SysListView32")) {
|
||||
else if (!IS_INTRESOURCE(m_vItems[i]->szClass) && !_wcsicmp(m_vItems[i]->szClass, L"SysListView32")) {
|
||||
m_vItems[i]->dwExtStyle |= WS_EX_LAYOUTRTL;
|
||||
addExLeftScrollbar = false;
|
||||
}
|
||||
|
@ -499,9 +493,6 @@ void CDialogTemplate::ConvertToRTL() {
|
|||
m_vItems[i]->dwExtStyle |= WS_EX_RTLREADING;
|
||||
|
||||
m_vItems[i]->sX = m_sWidth - m_vItems[i]->sWidth - m_vItems[i]->sX;
|
||||
|
||||
if (!IS_INTRESOURCE(m_vItems[i]->szClass))
|
||||
delete [] szClass;
|
||||
}
|
||||
m_dwExtStyle |= WS_EX_RIGHT | WS_EX_RTLREADING | WS_EX_LEFTSCROLLBAR;
|
||||
}
|
||||
|
|
|
@ -76,7 +76,9 @@ size_t file_size(ifstream& file) {
|
|||
return (size_t)result;
|
||||
}
|
||||
|
||||
vector<unsigned char> read_file(const string& filename) {
|
||||
// This function slurps the whole file into the vector.
|
||||
// Modified so the huge vector isn't returned by value.
|
||||
void read_file(const tstring& filename, vector<unsigned char>& data) {
|
||||
ifstream file(filename.c_str(), ios::binary);
|
||||
|
||||
if (!file) {
|
||||
|
@ -86,16 +88,13 @@ vector<unsigned char> read_file(const string& filename) {
|
|||
// get the file size
|
||||
size_t filesize = file_size(file);
|
||||
|
||||
vector<unsigned char> result;
|
||||
result.resize(filesize);
|
||||
data.resize(filesize);
|
||||
|
||||
file.read(reinterpret_cast<TCHAR*>(&result[0]), filesize);
|
||||
file.read(reinterpret_cast<char*>(&data[0]), filesize);
|
||||
|
||||
if (size_t(file.tellg()) != filesize) { // ifstream::eof doesn't return true here
|
||||
throw NSISException("Couldn't read entire file '" + filename + "'");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -104,7 +103,7 @@ void Plugins::GetExports(const tstring &pathToDll, bool displayInfo)
|
|||
vector<unsigned char> dlldata;
|
||||
PIMAGE_NT_HEADERS NTHeaders;
|
||||
try {
|
||||
dlldata = read_file(pathToDll);
|
||||
read_file(pathToDll, dlldata);
|
||||
NTHeaders = CResourceEditor::GetNTHeaders(&dlldata[0]);
|
||||
} catch (std::runtime_error&) {
|
||||
return;
|
||||
|
|
|
@ -201,9 +201,7 @@ void CResourceVersionInfo::ExportToStream(GrowBuf &strm, int Index)
|
|||
WCHAR *KeyName, *KeyValue;
|
||||
|
||||
strm.resize(0);
|
||||
KeyName = winchar_fromansi(_T("VS_VERSION_INFO"));
|
||||
SaveVersionHeader (strm, 0, sizeof (VS_FIXEDFILEINFO), 0, KeyName, &m_FixedInfo);
|
||||
delete [] KeyName;
|
||||
SaveVersionHeader (strm, 0, sizeof (VS_FIXEDFILEINFO), 0, L"VS_VERSION_INFO", &m_FixedInfo);
|
||||
|
||||
DefineList *pChildStrings = m_ChildStringLists.get_strings(Index);
|
||||
if ( pChildStrings->getnum() > 0 )
|
||||
|
@ -211,11 +209,9 @@ void CResourceVersionInfo::ExportToStream(GrowBuf &strm, int Index)
|
|||
GrowBuf stringInfoStream;
|
||||
int codepage = m_ChildStringLists.get_codepage(Index);
|
||||
LANGID langid = m_ChildStringLists.get_lang(Index);
|
||||
TCHAR Buff[16];
|
||||
sprintf(Buff, _T("%04x%04x"), langid, codepage);
|
||||
KeyName = winchar_fromansi(Buff, CP_ACP);
|
||||
SaveVersionHeader (stringInfoStream, 0, 0, 0, KeyName, &ZEROS);
|
||||
delete [] KeyName;
|
||||
WCHAR Buff[16];
|
||||
swprintf(Buff, _countof(Buff), L"%04x%04x", langid, codepage);
|
||||
SaveVersionHeader (stringInfoStream, 0, 0, 0, Buff, &ZEROS);
|
||||
|
||||
for ( int i = 0; i < pChildStrings->getnum(); i++ )
|
||||
{
|
||||
|
@ -237,9 +233,7 @@ void CResourceVersionInfo::ExportToStream(GrowBuf &strm, int Index)
|
|||
|
||||
PadStream (strm);
|
||||
p = strm.getlen();
|
||||
KeyName = winchar_fromansi(_T("StringFileInfo"), CP_ACP);
|
||||
SaveVersionHeader (strm, 0, 0, 0, KeyName, &ZEROS);
|
||||
delete [] KeyName;
|
||||
SaveVersionHeader (strm, 0, 0, 0, L"StringFileInfo", &ZEROS);
|
||||
strm.add (stringInfoStream.get(), stringInfoStream.getlen());
|
||||
wSize = WORD(strm.getlen() - p);
|
||||
|
||||
|
@ -251,15 +245,11 @@ void CResourceVersionInfo::ExportToStream(GrowBuf &strm, int Index)
|
|||
{
|
||||
PadStream (strm);
|
||||
p = strm.getlen();
|
||||
KeyName = winchar_fromansi(_T("VarFileInfo"), CP_ACP);
|
||||
SaveVersionHeader (strm, 0, 0, 0, KeyName, &ZEROS);
|
||||
delete [] KeyName;
|
||||
SaveVersionHeader (strm, 0, 0, 0, L"VarFileInfo", &ZEROS);
|
||||
PadStream (strm);
|
||||
|
||||
p1 = strm.getlen();
|
||||
KeyName = winchar_fromansi(_T("Translation"), CP_ACP);
|
||||
SaveVersionHeader (strm, 0, 0, 0, KeyName, &ZEROS);
|
||||
delete [] KeyName;
|
||||
SaveVersionHeader (strm, 0, 0, 0, L"Translation", &ZEROS);
|
||||
|
||||
// First add selected code language translation
|
||||
v = MAKELONG(m_ChildStringLists.get_lang(Index), m_ChildStringLists.get_codepage(Index));
|
||||
|
|
|
@ -76,6 +76,8 @@ TCHAR* ConstantsStringList::idx2name(int idx)
|
|||
int ConstantsStringList::get_internal_idx(int idx)
|
||||
{
|
||||
struct constantstring *data=(struct constantstring *)gr.get();
|
||||
|
||||
// We do a linear search because the strings are sorted.
|
||||
for (int i = 0; i < index; i++)
|
||||
{
|
||||
if (data[i].index == idx)
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* Unicode support added by Jim Park -- 08/07/2007
|
||||
*/
|
||||
|
||||
#include "tchar.h"
|
||||
#include "Platform.h"
|
||||
#include <stdio.h>
|
||||
#include "exehead/config.h"
|
||||
|
@ -114,6 +115,13 @@ CEXEBuild::CEXEBuild() :
|
|||
|
||||
definedlist.add(_T("NSIS_VERSION"), NSIS_VERSION);
|
||||
|
||||
#ifdef _UNICODE
|
||||
definedlist.add(_T("NSIS_UNICODE"));
|
||||
definedlist.add(_T("NSIS_CHAR_SIZE"), _T("2"));
|
||||
#else
|
||||
definedlist.add(_T("NSIS_CHAR_SIZE"), _T("1"));
|
||||
#endif
|
||||
|
||||
// automatically generated header file containing all defines
|
||||
#include <nsis-defines.h>
|
||||
|
||||
|
@ -286,12 +294,12 @@ CEXEBuild::CEXEBuild() :
|
|||
int i;
|
||||
for (i = 0; i < 10; i++) // 0 - 9
|
||||
{
|
||||
sprintf(Aux, _T("%d"), i);
|
||||
wsprintf(Aux, _T("%d"), i);
|
||||
m_UserVarNames.add(Aux,1);
|
||||
}
|
||||
for (i = 0; i < 10; i++) // 10 - 19
|
||||
{
|
||||
sprintf(Aux, _T("R%d"), i);
|
||||
wsprintf(Aux, _T("R%d"), i);
|
||||
m_UserVarNames.add(Aux,1);
|
||||
}
|
||||
m_UserVarNames.add(_T("CMDLINE"),1); // 20 everything before here doesn't have trailing slash removal
|
||||
|
@ -450,7 +458,7 @@ int CEXEBuild::add_string(const TCHAR *string, int process/*=1*/, WORD codepage/
|
|||
|
||||
if (*string == _T('$') && *(string+1) == _T('(')) {
|
||||
int idx = 0;
|
||||
TCHAR *cp = strdup(string+2);
|
||||
TCHAR *cp = _tcsdup(string+2);
|
||||
TCHAR *p = _tcschr(cp, _T(')'));
|
||||
if (p && p[1] == _T('\0') ) { // if string is only a language str identifier
|
||||
*p = 0;
|
||||
|
@ -480,14 +488,19 @@ int CEXEBuild::preprocess_string(TCHAR *out, const TCHAR *in, WORD codepage/*=CP
|
|||
const TCHAR *p=in;
|
||||
while (*p)
|
||||
{
|
||||
const TCHAR *np = CharNextExA(codepage, p, 0);
|
||||
const TCHAR *np;
|
||||
#ifdef _UNICODE
|
||||
np = CharNext(p);
|
||||
#else
|
||||
np = CharNextExA(codepage, p, 0);
|
||||
#endif
|
||||
if (np - p > 1) // multibyte TCHAR
|
||||
{
|
||||
int l = np - p;
|
||||
while (l--)
|
||||
{
|
||||
_TUCHAR i = (_TUCHAR)*p++;
|
||||
if (i >= NS_CODES_START) {
|
||||
if (NS_IS_CODE(i)) {
|
||||
*out++ = (TCHAR)NS_SKIP_CODE;
|
||||
}
|
||||
*out++=(TCHAR)i;
|
||||
|
@ -500,7 +513,7 @@ int CEXEBuild::preprocess_string(TCHAR *out, const TCHAR *in, WORD codepage/*=CP
|
|||
p=np; // increment p.
|
||||
|
||||
// Test for characters extending into the variable codes
|
||||
if (i >= NS_CODES_START) {
|
||||
if (NS_IS_CODE(i)) {
|
||||
*out++ = (TCHAR)NS_SKIP_CODE;
|
||||
// out does get the NS_CODE as well because of
|
||||
// "*out++=(TCHAR)i" at the end.
|
||||
|
@ -584,7 +597,7 @@ int CEXEBuild::preprocess_string(TCHAR *out, const TCHAR *in, WORD codepage/*=CP
|
|||
if ( !bProceced && *p == _T('(') )
|
||||
{
|
||||
int idx = -1;
|
||||
TCHAR *cp = strdup(p+1); // JP: Bad... should avoid memory alloc.
|
||||
TCHAR *cp = _tcsdup(p+1); // JP: Bad... should avoid memory alloc.
|
||||
TCHAR *pos = _tcschr(cp, _T(')'));
|
||||
if (pos)
|
||||
{
|
||||
|
@ -625,7 +638,7 @@ int CEXEBuild::preprocess_string(TCHAR *out, const TCHAR *in, WORD codepage/*=CP
|
|||
if (_tcschr(tbuf,cBracket)) (_tcschr(tbuf,cBracket)+1)[0]=0;
|
||||
if ( tbuf[0] == _T('{') && tbuf[_tcsclen(tbuf)-1] == _T('}') )
|
||||
{
|
||||
TCHAR *tstIfDefine = strdup(tbuf+1);
|
||||
TCHAR *tstIfDefine = _tcsdup(tbuf+1);
|
||||
tstIfDefine[_tcsclen(tstIfDefine)-1] = _T('\0');
|
||||
bDoWarning = definedlist.find(tstIfDefine) == NULL;
|
||||
// If it's a defined identifier, then don't warn.
|
||||
|
@ -941,7 +954,7 @@ int CEXEBuild::add_label(const TCHAR *name)
|
|||
int cs=build_cursection->code;
|
||||
int ce=cs+build_cursection->code_size;
|
||||
|
||||
TCHAR *p=strdup(name);
|
||||
TCHAR *p=_tcsdup(name);
|
||||
if (p[_tcsclen(p)-1] == _T(':')) p[_tcsclen(p)-1]=0;
|
||||
int offs=ns_label.add(p,0);
|
||||
free(p);
|
||||
|
@ -961,10 +974,10 @@ int CEXEBuild::add_label(const TCHAR *name)
|
|||
if (*name == _T('.')) ERROR_MSG(_T("Error: global label \"%s\" already declared\n"),name);
|
||||
else
|
||||
{
|
||||
const TCHAR *t = _T("section");
|
||||
const TCHAR *szType = _T("section");
|
||||
if (build_cursection_isfunc)
|
||||
t = _T("function");
|
||||
ERROR_MSG(_T("Error: label \"%s\" already declared in %s\n"),name,t);
|
||||
szType = _T("function");
|
||||
ERROR_MSG(_T("Error: label \"%s\" already declared in %s\n"),name,szType);
|
||||
}
|
||||
return PS_ERROR;
|
||||
}
|
||||
|
@ -1003,7 +1016,7 @@ int CEXEBuild::add_function(const TCHAR *funname)
|
|||
return PS_ERROR;
|
||||
}
|
||||
|
||||
set_uninstall_mode(!strnicmp(funname,_T("un."),3));
|
||||
set_uninstall_mode(!_tcsncicmp(funname,_T("un."),3));
|
||||
|
||||
// ns_func contains all the function names defined.
|
||||
int addr=ns_func.add(funname,0);
|
||||
|
@ -1159,13 +1172,13 @@ int CEXEBuild::add_section(const TCHAR *secname, const TCHAR *defname, int expan
|
|||
|
||||
set_uninstall_mode(0);
|
||||
|
||||
if (!strnicmp(name, _T("un."), 3))
|
||||
if (!_tcsncicmp(name, _T("un."), 3))
|
||||
{
|
||||
set_uninstall_mode(1);
|
||||
name += 3;
|
||||
}
|
||||
|
||||
if (!stricmp(name, _T("uninstall")))
|
||||
if (!_tcsicmp(name, _T("uninstall")))
|
||||
{
|
||||
set_uninstall_mode(1);
|
||||
}
|
||||
|
@ -1724,7 +1737,7 @@ int CEXEBuild::AddVersionInfo()
|
|||
}
|
||||
}
|
||||
catch (exception& err) {
|
||||
ERROR_MSG(_T("Error adding version information: %s\n"), err.what());
|
||||
ERROR_MSG(_T("Error adding version information: %s\n"), CtoTString(err.what()));
|
||||
return PS_ERROR;
|
||||
}
|
||||
}
|
||||
|
@ -1735,6 +1748,7 @@ int CEXEBuild::AddVersionInfo()
|
|||
#endif // NSIS_SUPPORT_VERSION_INFO
|
||||
|
||||
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT
|
||||
|
||||
int CEXEBuild::ProcessPages()
|
||||
{
|
||||
SCRIPT_MSG(_T("Processing pages... "));
|
||||
|
@ -2130,7 +2144,7 @@ again:
|
|||
SCRIPT_MSG(_T("Done!\n"));
|
||||
}
|
||||
catch (exception& err) {
|
||||
ERROR_MSG(_T("\nError: %s\n"), err.what());
|
||||
ERROR_MSG(_T("\nError: %s\n"), CtoTString(err.what()));
|
||||
return PS_ERROR;
|
||||
}
|
||||
|
||||
|
@ -2247,7 +2261,7 @@ int CEXEBuild::SetVarsSection()
|
|||
}
|
||||
}
|
||||
catch (exception& err) {
|
||||
ERROR_MSG(_T("\nError: %s\n"), err.what());
|
||||
ERROR_MSG(_T("\nError: %s\n"), CtoTString(err.what()));
|
||||
return PS_ERROR;
|
||||
}
|
||||
|
||||
|
@ -2264,10 +2278,11 @@ int CEXEBuild::SetManifest()
|
|||
if (manifest == "")
|
||||
return PS_OK;
|
||||
|
||||
// Saved directly as binary into the exe.
|
||||
res_editor->UpdateResourceA(MAKEINTRESOURCE(24), MAKEINTRESOURCE(1), NSIS_DEFAULT_LANG, (LPBYTE) manifest.c_str(), manifest.length());
|
||||
}
|
||||
catch (exception& err) {
|
||||
ERROR_MSG(_T("Error setting manifest: %s\n"), err.what());
|
||||
ERROR_MSG(_T("Error setting manifest: %s\n"), CtoTString(err.what()));
|
||||
return PS_ERROR;
|
||||
}
|
||||
|
||||
|
@ -2284,7 +2299,7 @@ int CEXEBuild::UpdatePEHeader()
|
|||
// terminal services aware
|
||||
headers->OptionalHeader.DllCharacteristics |= IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE;
|
||||
} catch (std::runtime_error& err) {
|
||||
ERROR_MSG(_T("Error updating PE headers: %s\n"), err.what());
|
||||
ERROR_MSG(_T("Error updating PE headers: %s\n"), CtoTString(err.what()));
|
||||
return PS_ERROR;
|
||||
}
|
||||
|
||||
|
@ -2479,7 +2494,7 @@ int CEXEBuild::write_output(void)
|
|||
close_res_editor();
|
||||
}
|
||||
catch (exception& err) {
|
||||
ERROR_MSG(_T("\nError: %s\n"), err.what());
|
||||
ERROR_MSG(_T("\nError: %s\n"), CtoTString(err.what()));
|
||||
return PS_ERROR;
|
||||
}
|
||||
|
||||
|
@ -3192,6 +3207,7 @@ void CEXEBuild::warning(const TCHAR *s, ...)
|
|||
_vsntprintf(buf,NSIS_MAX_STRLEN*10,s,val);
|
||||
#endif
|
||||
va_end(val);
|
||||
|
||||
m_warnings.add(buf,0);
|
||||
notify(MAKENSIS_NOTIFY_WARNING,buf);
|
||||
if (display_warnings)
|
||||
|
|
|
@ -199,7 +199,7 @@ int CLZMA::Init(int level, unsigned int dicSize)
|
|||
NCoderPropID::kDictionarySize,
|
||||
NCoderPropID::kNumFastBytes
|
||||
};
|
||||
const int kNumProps = sizeof(propdIDs) / sizeof(propdIDs[0]);
|
||||
const int kNumProps = _countof(propdIDs);
|
||||
PROPVARIANT props[kNumProps];
|
||||
// NCoderPropID::kAlgorithm
|
||||
props[0].vt = VT_UI4;
|
||||
|
|
|
@ -145,7 +145,7 @@ bool dir_reader::is_excluded(const tstring& name) const {
|
|||
iterator e = m_excluded.end();
|
||||
|
||||
for (; i != e; i++) {
|
||||
if (!::stricmp(name.c_str(), i->c_str())) {
|
||||
if (!::_tcsicmp(name.c_str(), i->c_str())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -146,8 +146,7 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPTSTR lpszCmdPara
|
|||
{
|
||||
cmdline++;
|
||||
|
||||
// this only works with spaces because they have just one bit on
|
||||
#define END_OF_ARG(c) (((c)|_T(' '))==_T(' '))
|
||||
#define END_OF_ARG(c) (c == _T(' ') || c == _T('\0'))
|
||||
|
||||
#if defined(NSIS_CONFIG_VISIBLE_SUPPORT) && defined(NSIS_CONFIG_SILENT_SUPPORT)
|
||||
if (cmdline[0] == _T('S') && END_OF_ARG(cmdline[1]))
|
||||
|
|
|
@ -249,7 +249,9 @@ FORCE_INLINE int NSISCALL ui_doinstall(void)
|
|||
static const TCHAR reg_nt_locale_key[] = _T(".DEFAULT\\Control Panel\\International");
|
||||
const TCHAR *reg_nt_locale_val = ®_9x_locale[30]; // = _T("Locale") with opt
|
||||
|
||||
*(DWORD*)state_language = CHAR4_TO_DWORD(_T('0'), _T('x'), 0, 0);
|
||||
state_language[0] = _T('0');
|
||||
state_language[1] = _T('x');
|
||||
state_language[2] = 0;
|
||||
|
||||
{
|
||||
// Windows 9x
|
||||
|
@ -318,7 +320,6 @@ FORCE_INLINE int NSISCALL ui_doinstall(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
mystrcpy(state_install_directory,addtrailingslash(p));
|
||||
}
|
||||
}
|
||||
|
@ -343,20 +344,20 @@ FORCE_INLINE int NSISCALL ui_doinstall(void)
|
|||
#ifdef NSIS_SUPPORT_BGBG
|
||||
if (header->bg_color1 != -1)
|
||||
{
|
||||
DWORD cn = CHAR4_TO_DWORD(_T('_'), _T('N'), _T('b'), 0);
|
||||
LPCTSTR cn = _T("_Nb");
|
||||
RECT vp;
|
||||
extern LRESULT CALLBACK BG_WndProc(HWND, UINT, WPARAM, LPARAM);
|
||||
wc.lpfnWndProc = BG_WndProc;
|
||||
wc.hInstance = g_hInstance;
|
||||
wc.hIcon = g_hIcon;
|
||||
//wc.hCursor = LoadCursor(NULL,IDC_ARROW);
|
||||
wc.lpszClassName = (LPCTSTR)&cn;
|
||||
wc.lpszClassName = cn;
|
||||
|
||||
if (!RegisterClass(&wc)) return 0;
|
||||
|
||||
SystemParametersInfo(SPI_GETWORKAREA, 0, &vp, 0);
|
||||
|
||||
m_bgwnd = CreateWindowEx(WS_EX_TOOLWINDOW,(LPCTSTR)&cn,0,WS_POPUP,
|
||||
m_bgwnd = CreateWindowEx(WS_EX_TOOLWINDOW,cn,0,WS_POPUP,
|
||||
vp.left,vp.top,vp.right-vp.left,vp.bottom-vp.top,0,NULL,g_hInstance,NULL);
|
||||
}
|
||||
|
||||
|
@ -399,6 +400,7 @@ FORCE_INLINE int NSISCALL ui_doinstall(void)
|
|||
RegisterClass(&wc);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
{
|
||||
|
@ -434,7 +436,6 @@ FORCE_INLINE int NSISCALL ui_doinstall(void)
|
|||
#endif//NSIS_CONFIG_SILENT_SUPPORT
|
||||
}
|
||||
|
||||
|
||||
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT
|
||||
static int CALLBACK WINAPI BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData)
|
||||
{
|
||||
|
@ -894,6 +895,7 @@ static BOOL CALLBACK DirProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
|
|||
page *thispage = g_this_page;
|
||||
TCHAR *dir = g_usrvars[thispage->parms[4]];
|
||||
int browse_text = thispage->parms[3];
|
||||
|
||||
if (uMsg == WM_NOTIFY_INIGO_MONTOYA)
|
||||
{
|
||||
GetUIText(IDC_DIR,dir);
|
||||
|
@ -1026,7 +1028,6 @@ static BOOL CALLBACK DirProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
|
|||
* 6. `dir' is never modified.
|
||||
*
|
||||
*/
|
||||
|
||||
mystrcpy(s,dir);
|
||||
|
||||
// Test for and use the GetDiskFreeSpaceEx API
|
||||
|
@ -1038,8 +1039,8 @@ static BOOL CALLBACK DirProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
|
|||
ULARGE_INTEGER available64;
|
||||
ULARGE_INTEGER a, b;
|
||||
TCHAR *p;
|
||||
WORD *pw = NULL;
|
||||
while ((TCHAR *) pw != s) // trimslashtoend() cut the entire string
|
||||
TCHAR *pw = NULL;
|
||||
while (pw != s) // trimslashtoend() cut the entire string
|
||||
{
|
||||
if (GDFSE(s, &available64, &a, &b))
|
||||
{
|
||||
|
@ -1057,8 +1058,11 @@ static BOOL CALLBACK DirProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
|
|||
*pw = 0;
|
||||
|
||||
p = trimslashtoend(s); // trim last backslash
|
||||
pw = (LPWORD) (p - 1);
|
||||
*pw = CHAR2_TO_WORD(_T('\\'), 0); // bring it back, but make the next TCHAR null
|
||||
// bring it back, but make the next char null
|
||||
pw = p;
|
||||
*pw = 0;
|
||||
--pw;
|
||||
*pw = _T('\\');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1730,12 +1734,16 @@ static BOOL CALLBACK InstProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
|
|||
do {
|
||||
item.pszText = ptr;
|
||||
ptr += SendMessage(linsthwnd,LVM_GETITEMTEXT,i,(LPARAM)&item);
|
||||
*(WORD*)ptr = CHAR2_TO_WORD(_T('\r'),_T('\n'));
|
||||
ptr+=2;
|
||||
*ptr++ = _T('\r');
|
||||
*ptr++ = _T('\n');
|
||||
} while (++i < count);
|
||||
// memory is auto zeroed when allocated with GHND - *ptr = 0;
|
||||
GlobalUnlock(memory);
|
||||
#ifdef _UNICODE
|
||||
SetClipboardData(CF_UNICODETEXT,memory);
|
||||
#else
|
||||
SetClipboardData(CF_TEXT,memory);
|
||||
#endif
|
||||
CloseClipboard();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1067,10 +1067,14 @@ static int NSISCALL ExecuteEntry(entry *entry_)
|
|||
|
||||
if (SUCCEEDED(hres))
|
||||
{
|
||||
static WCHAR wsz[1024];
|
||||
hres=E_FAIL;
|
||||
if (MultiByteToWideChar(CP_ACP, 0, buf1, -1, wsz, 1024))
|
||||
hres=ppf->lpVtbl->Save(ppf,(const WCHAR*)wsz,TRUE);
|
||||
#ifdef _UNICODE
|
||||
hres=ppf->lpVtbl->Save(ppf,(const WCHAR*)buf1,TRUE);
|
||||
#else
|
||||
static WCHAR wsz[1024];
|
||||
hres=E_FAIL;
|
||||
if (MultiByteToWideChar(CP_ACP, 0, buf1, -1, wsz, 1024))
|
||||
hres=ppf->lpVtbl->Save(ppf,(const WCHAR*)wsz,TRUE);
|
||||
#endif
|
||||
}
|
||||
ppf->lpVtbl->Release(ppf);
|
||||
}
|
||||
|
|
|
@ -483,6 +483,7 @@ typedef struct {
|
|||
#define NS_SHELL_CODE 254
|
||||
#define NS_LANG_CODE 255
|
||||
#define NS_CODES_START NS_SKIP_CODE
|
||||
#define NS_IS_CODE(x) ((x) >= NS_SKIP_CODE)
|
||||
|
||||
// We are doing this to store an integer value into a char string and we
|
||||
// don't want false end of string values so we shift then OR with 0x8080
|
||||
|
|
|
@ -285,7 +285,8 @@ TCHAR * NSISCALL trimslashtoend(TCHAR *buf)
|
|||
int NSISCALL validpathspec(TCHAR *ubuf)
|
||||
{
|
||||
TCHAR dl = ubuf[0] | 0x20; // convert alleged drive letter to lower case
|
||||
return ((*(WORD*)ubuf==CHAR2_TO_WORD(_T('\\'),_T('\\'))) || (dl >= _T('a') && dl <= _T('z') && ubuf[1]==_T(':')));
|
||||
return ((ubuf[0] == _T('\\') && ubuf[1] == _T('\\')) ||
|
||||
(dl >= _T('a') && dl <= _T('z') && ubuf[1] == _T(':')));
|
||||
}
|
||||
|
||||
TCHAR * NSISCALL skip_root(TCHAR *path)
|
||||
|
@ -293,11 +294,11 @@ TCHAR * NSISCALL skip_root(TCHAR *path)
|
|||
TCHAR *p = CharNext(path);
|
||||
TCHAR *p2 = CharNext(p);
|
||||
|
||||
if (*path && *(WORD*)p == CHAR2_TO_WORD(_T(':'), _T('\\')))
|
||||
if (*path && p[0] == _T(':') && p[1] == _T('\\'))
|
||||
{
|
||||
return CharNext(p2);
|
||||
}
|
||||
else if (*(WORD*)path == CHAR2_TO_WORD(_T('\\'),_T('\\')))
|
||||
else if (path[0] == _T('\\') && path[1] == _T('\\'))
|
||||
{
|
||||
// skip host and share name
|
||||
int x = 2;
|
||||
|
@ -357,20 +358,21 @@ int NSISCALL is_valid_instpath(TCHAR *s)
|
|||
return 1;
|
||||
}
|
||||
|
||||
TCHAR * NSISCALL mystrstri(TCHAR *a, const TCHAR *b)
|
||||
// Used strictly for the wininit.ini file which is an ASCII file.
|
||||
char * NSISCALL mystrstriA(char *a, const char *b)
|
||||
{
|
||||
int l = mystrlen(b);
|
||||
while (mystrlen(a) >= l)
|
||||
int l = lstrlenA(b);
|
||||
while (lstrlenA(a) >= l)
|
||||
{
|
||||
TCHAR c = a[l];
|
||||
char c = a[l];
|
||||
a[l] = 0;
|
||||
if (!lstrcmpi(a, b))
|
||||
if (!lstrcmpiA(a, b))
|
||||
{
|
||||
a[l] = c;
|
||||
return a;
|
||||
}
|
||||
a[l] = c;
|
||||
a = CharNext(a);
|
||||
a = CharNextA(a);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
@ -413,8 +415,7 @@ TCHAR * NSISCALL my_GetTempFileName(TCHAR *buf, const TCHAR *dir)
|
|||
int n = 100;
|
||||
while (n--)
|
||||
{
|
||||
TCHAR prefix[4];
|
||||
*(LPDWORD)prefix = CHAR4_TO_DWORD(_T('n'), _T('s'), _T('a'), 0);
|
||||
TCHAR prefix[4] = _T("nsa");
|
||||
prefix[2] += (TCHAR)(GetTickCount() % 26);
|
||||
if (GetTempFileName(dir, prefix, 0, buf))
|
||||
return buf;
|
||||
|
@ -424,6 +425,106 @@ TCHAR * NSISCALL my_GetTempFileName(TCHAR *buf, const TCHAR *dir)
|
|||
}
|
||||
|
||||
#ifdef NSIS_SUPPORT_MOVEONREBOOT
|
||||
/** Modifies the wininit.ini file to rename / delete a file.
|
||||
*
|
||||
* @param prevName The previous / current name of the file.
|
||||
* @param newName The new name to move the file to. If NULL, the current file
|
||||
* will be deleted.
|
||||
*/
|
||||
void RenameViaWininit(const TCHAR* prevName, const TCHAR* newName)
|
||||
{
|
||||
static char szRenameLine[1024];
|
||||
static TCHAR wininit[1024];
|
||||
static TCHAR tmpbuf[1024];
|
||||
|
||||
int cchRenameLine;
|
||||
LPCSTR szRenameSec = "[Rename]\r\n"; // rename section marker
|
||||
HANDLE hfile;
|
||||
DWORD dwFileSize;
|
||||
DWORD dwBytes;
|
||||
DWORD dwRenameLinePos;
|
||||
char *pszWinInit; // Contains the file contents of wininit.ini
|
||||
|
||||
int spn; // length of the short path name in TCHARs.
|
||||
|
||||
lstrcpy(tmpbuf, _T("NUL"));
|
||||
|
||||
if (newName) {
|
||||
// create the file if it's not already there to prevent GetShortPathName from failing
|
||||
CloseHandle(myOpenFile(newName,0,CREATE_NEW));
|
||||
spn = GetShortPathName(newName,tmpbuf,1024);
|
||||
if (!spn || spn > 1024)
|
||||
return;
|
||||
}
|
||||
// wininit is used as a temporary here
|
||||
spn = GetShortPathName(prevName,wininit,1024);
|
||||
if (!spn || spn > 1024)
|
||||
return;
|
||||
cchRenameLine = wsprintfA(szRenameLine, "%s=%s\r\n", tmpbuf, wininit);
|
||||
// Get the path to the wininit.ini file.
|
||||
GetNSISString(wininit, g_header->str_wininit);
|
||||
|
||||
hfile = myOpenFile(wininit, GENERIC_READ | GENERIC_WRITE, OPEN_ALWAYS);
|
||||
|
||||
if (hfile != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
// We are now working on the Windows wininit file
|
||||
dwFileSize = GetFileSize(hfile, NULL);
|
||||
pszWinInit = (char*) GlobalAlloc(GPTR, dwFileSize + cchRenameLine + 10);
|
||||
|
||||
if (pszWinInit != NULL)
|
||||
{
|
||||
if (ReadFile(hfile, pszWinInit, dwFileSize, &dwBytes, NULL) && dwFileSize == dwBytes)
|
||||
{
|
||||
// Look for the rename section in the current file.
|
||||
LPSTR pszRenameSecInFile = mystrstriA(pszWinInit, szRenameSec);
|
||||
if (pszRenameSecInFile == NULL)
|
||||
{
|
||||
// No rename section. So we add it to the end of file.
|
||||
lstrcpyA(pszWinInit+dwFileSize, szRenameSec);
|
||||
dwFileSize += 10;
|
||||
dwRenameLinePos = dwFileSize;
|
||||
}
|
||||
else
|
||||
{
|
||||
// There is a rename section, but is there another section after it?
|
||||
char *pszFirstRenameLine = pszRenameSecInFile+10;
|
||||
char *pszNextSec = mystrstriA(pszFirstRenameLine,"\n[");
|
||||
if (pszNextSec)
|
||||
{
|
||||
TCHAR *p = ++pszNextSec;
|
||||
while (p < pszWinInit + dwFileSize) {
|
||||
p[cchRenameLine] = *p;
|
||||
p++;
|
||||
}
|
||||
|
||||
dwRenameLinePos = pszNextSec - pszWinInit;
|
||||
}
|
||||
// rename section is last, stick item at end of file
|
||||
else dwRenameLinePos = dwFileSize;
|
||||
}
|
||||
|
||||
mini_memcpy(&pszWinInit[dwRenameLinePos], szRenameLine, cchRenameLine);
|
||||
dwFileSize += cchRenameLine;
|
||||
|
||||
SetFilePointer(hfile, 0, NULL, FILE_BEGIN);
|
||||
WriteFile(hfile, pszWinInit, dwFileSize, &dwBytes, NULL);
|
||||
|
||||
GlobalFree(pszWinInit);
|
||||
}
|
||||
}
|
||||
|
||||
CloseHandle(hfile);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* MoveFileOnReboot tries to move a file by the name of pszExisting to the
|
||||
* name pszNew.
|
||||
*
|
||||
* @param pszExisting The old name of the file.
|
||||
* @param pszNew The new name of the file.
|
||||
*/
|
||||
void NSISCALL MoveFileOnReboot(LPCTSTR pszExisting, LPCTSTR pszNew)
|
||||
{
|
||||
BOOL fOk = 0;
|
||||
|
@ -434,86 +535,10 @@ void NSISCALL MoveFileOnReboot(LPCTSTR pszExisting, LPCTSTR pszNew)
|
|||
{
|
||||
fOk=mfea(pszExisting, pszNew, MOVEFILE_DELAY_UNTIL_REBOOT|MOVEFILE_REPLACE_EXISTING);
|
||||
}
|
||||
|
||||
|
||||
if (!fOk)
|
||||
{
|
||||
static TCHAR szRenameLine[1024];
|
||||
static TCHAR wininit[1024];
|
||||
static TCHAR tmpbuf[1024];
|
||||
int cchRenameLine;
|
||||
static const TCHAR szRenameSec[] = _T("[Rename]\r\n");
|
||||
HANDLE hfile;
|
||||
DWORD dwFileSize;
|
||||
DWORD dwBytes;
|
||||
DWORD dwRenameLinePos;
|
||||
TCHAR *pszWinInit;
|
||||
|
||||
int spn;
|
||||
|
||||
*(DWORD*)tmpbuf = CHAR4_TO_DWORD(_T('N'), _T('U'), _T('L'), 0);
|
||||
|
||||
if (pszNew) {
|
||||
// create the file if it's not already there to prevent GetShortPathName from failing
|
||||
CloseHandle(myOpenFile(pszNew,0,CREATE_NEW));
|
||||
spn = GetShortPathName(pszNew,tmpbuf,1024);
|
||||
if (!spn || spn > 1024)
|
||||
return;
|
||||
}
|
||||
// wininit is used as a temporary here
|
||||
spn = GetShortPathName(pszExisting,wininit,1024);
|
||||
if (!spn || spn > 1024)
|
||||
return;
|
||||
cchRenameLine = wsprintf(szRenameLine,_T("%s=%s\r\n"),tmpbuf,wininit);
|
||||
|
||||
GetNSISString(wininit, g_header->str_wininit);
|
||||
hfile = myOpenFile(wininit, GENERIC_READ | GENERIC_WRITE, OPEN_ALWAYS);
|
||||
|
||||
if (hfile != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
dwFileSize = GetFileSize(hfile, NULL);
|
||||
pszWinInit = GlobalAlloc(GPTR, dwFileSize + cchRenameLine + 10);
|
||||
|
||||
if (pszWinInit != NULL)
|
||||
{
|
||||
if (ReadFile(hfile, pszWinInit, dwFileSize, &dwBytes, NULL) && dwFileSize == dwBytes)
|
||||
{
|
||||
LPTSTR pszRenameSecInFile = mystrstri(pszWinInit, szRenameSec);
|
||||
if (pszRenameSecInFile == NULL)
|
||||
{
|
||||
mystrcpy(pszWinInit+dwFileSize, szRenameSec);
|
||||
dwFileSize += 10;
|
||||
dwRenameLinePos = dwFileSize;
|
||||
}
|
||||
else
|
||||
{
|
||||
TCHAR *pszFirstRenameLine = pszRenameSecInFile+10;
|
||||
TCHAR *pszNextSec = mystrstri(pszFirstRenameLine,_T("\n["));
|
||||
if (pszNextSec)
|
||||
{
|
||||
TCHAR *p = ++pszNextSec;
|
||||
while (p < pszWinInit + dwFileSize) {
|
||||
p[cchRenameLine] = *p;
|
||||
p++;
|
||||
}
|
||||
|
||||
dwRenameLinePos = pszNextSec - pszWinInit;
|
||||
}
|
||||
// rename section is last, stick item at end of file
|
||||
else dwRenameLinePos = dwFileSize;
|
||||
}
|
||||
|
||||
mini_memcpy(&pszWinInit[dwRenameLinePos], szRenameLine, cchRenameLine);
|
||||
dwFileSize += cchRenameLine;
|
||||
|
||||
SetFilePointer(hfile, 0, NULL, FILE_BEGIN);
|
||||
WriteFile(hfile, pszWinInit, dwFileSize, &dwBytes, NULL);
|
||||
|
||||
GlobalFree(pszWinInit);
|
||||
}
|
||||
}
|
||||
|
||||
CloseHandle(hfile);
|
||||
}
|
||||
RenameViaWininit(pszExisting, pszNew);
|
||||
}
|
||||
|
||||
#ifdef NSIS_SUPPORT_REBOOT
|
||||
|
@ -622,11 +647,16 @@ TCHAR * NSISCALL GetNSISString(TCHAR *outbuf, int strtab)
|
|||
// indexes into the language
|
||||
TCHAR *in = (TCHAR*)GetNSISStringNP(GetNSISTab(strtab));
|
||||
TCHAR *out = ps_tmpbuf;
|
||||
if ((unsigned int) (outbuf - ps_tmpbuf) < sizeof(ps_tmpbuf))
|
||||
|
||||
// Still working within ps_tmpbuf, so set out to the
|
||||
// current position that is passed in.
|
||||
if (outbuf >= ps_tmpbuf &&
|
||||
(size_t) (outbuf - ps_tmpbuf) < _countof(ps_tmpbuf))
|
||||
{
|
||||
out = outbuf;
|
||||
outbuf = 0;
|
||||
}
|
||||
|
||||
while (*in && out - ps_tmpbuf < NSIS_MAX_STRLEN)
|
||||
{
|
||||
_TUCHAR nVarIdx = (_TUCHAR)*in++;
|
||||
|
@ -949,6 +979,19 @@ struct MGA_FUNC
|
|||
const char *func;
|
||||
};
|
||||
|
||||
#ifdef _UNICODE
|
||||
struct MGA_FUNC MGA_FUNCS[] = {
|
||||
{"KERNEL32", "GetDiskFreeSpaceExW"},
|
||||
{"KERNEL32", "MoveFileExW"},
|
||||
{"ADVAPI32", "RegDeleteKeyExW"},
|
||||
{"ADVAPI32", "OpenProcessToken"},
|
||||
{"ADVAPI32", "LookupPrivilegeValueW"},
|
||||
{"ADVAPI32", "AdjustTokenPrivileges"},
|
||||
{"KERNEL32", "GetUserDefaultUILanguage"},
|
||||
{"SHLWAPI", "SHAutoComplete"},
|
||||
{"SHFOLDER", "SHGetFolderPathW"}
|
||||
};
|
||||
#else
|
||||
struct MGA_FUNC MGA_FUNCS[] = {
|
||||
{"KERNEL32", "GetDiskFreeSpaceExA"},
|
||||
{"KERNEL32", "MoveFileExA"},
|
||||
|
@ -960,6 +1003,7 @@ struct MGA_FUNC MGA_FUNCS[] = {
|
|||
{"SHLWAPI", "SHAutoComplete"},
|
||||
{"SHFOLDER", "SHGetFolderPathA"}
|
||||
};
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Given a function enum, it will load the appropriate DLL and get the
|
||||
|
|
|
@ -416,7 +416,7 @@ int generate_unicons_offsets(LPBYTE exeHeader, size_t exeHeaderSize, LPBYTE unin
|
|||
catch (const exception& e)
|
||||
{
|
||||
if (g_display_errors)
|
||||
fprintf(g_output, _T("\nError generating uninstaller icon: %s -- failing!\n"), e.what());
|
||||
_ftprintf(g_output, _T("\nError generating uninstaller icon: %s -- failing!\n"), CtoTString(e.what()));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "tchar.h"
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
//#include "tstring.h"
|
||||
#include "tstring.h"
|
||||
|
||||
LineParser::LineParser(bool bCommentBlock)
|
||||
{
|
||||
|
@ -126,7 +126,7 @@ int LineParser::gettoken_enum(int token, const TCHAR *strlist) // null seperated
|
|||
TCHAR *tt=gettoken_str(token);
|
||||
if (tt && *tt) while (*strlist)
|
||||
{
|
||||
if (!stricmp(tt,strlist)) return x;
|
||||
if (!_tcsicmp(tt,strlist)) return x;
|
||||
strlist+=_tcsclen(strlist)+1;
|
||||
x++;
|
||||
}
|
||||
|
|
|
@ -189,7 +189,7 @@ static tstring get_home()
|
|||
|
||||
static int process_config(CEXEBuild& build, tstring& conf)
|
||||
{
|
||||
FILE *cfg=fopen(conf.c_str(),_T("rt"));
|
||||
FILE *cfg=FOPENTEXT(conf.c_str(),_T("rt"));
|
||||
if (cfg)
|
||||
{
|
||||
if (build.display_script)
|
||||
|
@ -227,7 +227,7 @@ static int change_to_script_dir(CEXEBuild& build, tstring& script)
|
|||
_ftprintf(g_output,_T("Changing directory to: \"%s\"\n"),dir.c_str());
|
||||
fflush(g_output);
|
||||
}
|
||||
if (chdir(dir.c_str()))
|
||||
if (_tchdir(dir.c_str()))
|
||||
{
|
||||
if (build.display_errors)
|
||||
{
|
||||
|
@ -274,34 +274,34 @@ int _tmain(int argc, TCHAR **argv)
|
|||
}
|
||||
catch (exception& err)
|
||||
{
|
||||
fprintf(g_output, _T("Error initalizing CEXEBuild: %s\n"), err.what());
|
||||
_ftprintf(g_output, _T("Error initalizing CEXEBuild: %s\n"), CtoTString(err.what()));
|
||||
fflush(g_output);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (argc > 1 && IS_OPT(argv[1]) && !stricmp(&argv[1][1],_T("VERSION")))
|
||||
if (argc > 1 && IS_OPT(argv[tmpargpos]) && !_tcsicmp(&argv[tmpargpos][1],_T("VERSION")))
|
||||
{
|
||||
fprintf(g_output,NSIS_VERSION);
|
||||
_ftprintf(g_output,NSIS_VERSION);
|
||||
fflush(g_output);
|
||||
return 0;
|
||||
}
|
||||
if (argc > 1 && IS_OPT(argv[1]) && (argv[1][1]==_T('v') || argv[1][1]==_T('V')))
|
||||
if (argc > 1 && IS_OPT(argv[tmpargpos]) && (argv[tmpargpos][1]==_T('v') || argv[tmpargpos][1]==_T('V')))
|
||||
{
|
||||
tmpargpos++;
|
||||
if (argv[1][2] <= _T('2') && argv[1][2] >= _T('0'))
|
||||
if (argv[tmpargpos][2] <= _T('2') && argv[tmpargpos][2] >= _T('0'))
|
||||
{
|
||||
no_logo=1;
|
||||
}
|
||||
tmpargpos++;
|
||||
}
|
||||
|
||||
if (!no_logo)
|
||||
{
|
||||
if (argc > tmpargpos && IS_OPT(argv[tmpargpos]) && (argv[tmpargpos][1]==_T('o') || argv[tmpargpos][1]==_T('O')) && argv[tmpargpos][2])
|
||||
{
|
||||
g_output=fopen(argv[tmpargpos]+2,_T("w"));
|
||||
g_output=FOPENTEXT(argv[tmpargpos]+2,_T("w"));
|
||||
if (!g_output)
|
||||
{
|
||||
printf(_T("Error opening output log for writing. Using stdout.\n"));
|
||||
_tprintf(_T("Error opening output log for writing. Using stdout.\n"));
|
||||
g_output=stdout;
|
||||
}
|
||||
outputtried=1;
|
||||
|
@ -321,7 +321,7 @@ int _tmain(int argc, TCHAR **argv)
|
|||
if ((argv[argpos][1]==_T('D') || argv[argpos][1]==_T('d')) && argv[argpos][2])
|
||||
{
|
||||
TCHAR *p=argv[argpos]+2;
|
||||
TCHAR *s=strdup(p),*v;
|
||||
TCHAR *s=_tcsdup(p),*v;
|
||||
if (build.display_script)
|
||||
{
|
||||
_ftprintf(g_output,_T("Command line defined: \"%s\"\n"),p);
|
||||
|
@ -344,7 +344,7 @@ int _tmain(int argc, TCHAR **argv)
|
|||
{
|
||||
if (!outputtried)
|
||||
{
|
||||
g_output=fopen(argv[argpos]+2,_T("w"));
|
||||
g_output=FOPENTEXT(argv[argpos]+2,_T("w"));
|
||||
if (!g_output)
|
||||
{
|
||||
if (build.display_errors) _tprintf(_T("Error opening output log for writing. Using stdout.\n"));
|
||||
|
@ -353,7 +353,7 @@ int _tmain(int argc, TCHAR **argv)
|
|||
outputtried=1;
|
||||
}
|
||||
}
|
||||
else if (!stricmp(&argv[argpos][1],_T("NOCD"))) do_cd=0;
|
||||
else if (!_tcsicmp(&argv[argpos][1],_T("NOCD"))) do_cd=0;
|
||||
else if ((argv[argpos][1] == _T('V') || argv[argpos][1] == _T('v')) &&
|
||||
argv[argpos][2] >= _T('0') && argv[argpos][2] <= _T('4') && !argv[argpos][3])
|
||||
{
|
||||
|
@ -364,9 +364,9 @@ int _tmain(int argc, TCHAR **argv)
|
|||
build.display_errors=v>0;
|
||||
g_display_errors=build.display_errors;
|
||||
}
|
||||
else if (!stricmp(&argv[argpos][1],_T("NOCONFIG"))) g_noconfig=1;
|
||||
else if (!stricmp(&argv[argpos][1],_T("PAUSE"))) g_dopause=1;
|
||||
else if (!stricmp(&argv[argpos][1],_T("LICENSE")))
|
||||
else if (!_tcsicmp(&argv[argpos][1],_T("NOCONFIG"))) g_noconfig=1;
|
||||
else if (!_tcsicmp(&argv[argpos][1],_T("PAUSE"))) g_dopause=1;
|
||||
else if (!_tcsicmp(&argv[argpos][1],_T("LICENSE")))
|
||||
{
|
||||
if (build.display_info)
|
||||
{
|
||||
|
@ -374,7 +374,7 @@ int _tmain(int argc, TCHAR **argv)
|
|||
}
|
||||
nousage++;
|
||||
}
|
||||
else if (!stricmp(&argv[argpos][1],_T("CMDHELP")))
|
||||
else if (!_tcsicmp(&argv[argpos][1],_T("CMDHELP")))
|
||||
{
|
||||
if (argpos < argc-1)
|
||||
build.print_help(argv[++argpos]);
|
||||
|
@ -382,7 +382,7 @@ int _tmain(int argc, TCHAR **argv)
|
|||
build.print_help(NULL);
|
||||
nousage++;
|
||||
}
|
||||
else if (!stricmp(&argv[argpos][1],_T("NOTIFYHWND")))
|
||||
else if (!_tcsicmp(&argv[argpos][1],_T("NOTIFYHWND")))
|
||||
{
|
||||
#ifdef _WIN32
|
||||
build.notify_hwnd=(HWND)_ttol(argv[++argpos]);
|
||||
|
@ -393,7 +393,7 @@ int _tmain(int argc, TCHAR **argv)
|
|||
build.warning(OPT_STR _T("NOTIFYHWND is disabled for non Win32 platforms."));
|
||||
#endif
|
||||
}
|
||||
else if (!stricmp(&argv[argpos][1],_T("HDRINFO")))
|
||||
else if (!_tcsicmp(&argv[argpos][1],_T("HDRINFO")))
|
||||
{
|
||||
print_stub_info(build);
|
||||
nousage++;
|
||||
|
@ -479,11 +479,11 @@ int _tmain(int argc, TCHAR **argv)
|
|||
else
|
||||
{
|
||||
_tcscpy(sfile,argv[argpos]);
|
||||
fp=fopen(sfile,_T("rt"));
|
||||
fp=FOPENTEXT(sfile,_T("rt"));
|
||||
if (!fp)
|
||||
{
|
||||
_stprintf(sfile,_T("%s.nsi"),argv[argpos]);
|
||||
fp=fopen(sfile,_T("rt"));
|
||||
fp=FOPENTEXT(sfile,_T("rt"));
|
||||
if (!fp)
|
||||
{
|
||||
if (build.display_errors)
|
||||
|
|
|
@ -33,7 +33,9 @@ string generate(comctl comctl_selection, exec_level exec_level_selection)
|
|||
if (comctl_selection == comctl_old && exec_level_selection == exec_level_none)
|
||||
return "";
|
||||
|
||||
string xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\"><assemblyIdentity version=\"1.0.0.0\" processorArchitecture=\"X86\" name=\"Nullsoft.NSIS.exehead\" type=\"win32\"/><description>Nullsoft Install System " NSIS_VERSION "</description>";
|
||||
string xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\"><assemblyIdentity version=\"1.0.0.0\" processorArchitecture=\"X86\" name=\"Nullsoft.NSIS.exehead\" type=\"win32\"/><description>Nullsoft Install System ";
|
||||
xml += TtoCString(NSIS_VERSION);
|
||||
xml += "</description>";
|
||||
|
||||
if (comctl_selection == comctl_xp)
|
||||
{
|
||||
|
|
|
@ -57,7 +57,7 @@ TCHAR *CEXEBuild::set_file_predefine(const TCHAR *filename)
|
|||
TCHAR *oldfilename = definedlist.find(_T("__FILE__"));
|
||||
if(oldfilename)
|
||||
{
|
||||
oldfilename = strdup(oldfilename);
|
||||
oldfilename = _tcsdup(oldfilename);
|
||||
definedlist.del(_T("__FILE__"));
|
||||
}
|
||||
const TCHAR *p = _tcsrchr(filename,_T('\\'));
|
||||
|
@ -85,7 +85,7 @@ TCHAR *CEXEBuild::set_timestamp_predefine(const TCHAR *filename)
|
|||
{
|
||||
TCHAR *oldtimestamp = definedlist.find(_T("__TIMESTAMP__"));
|
||||
if(oldtimestamp) {
|
||||
oldtimestamp = strdup(oldtimestamp);
|
||||
oldtimestamp = _tcsdup(oldtimestamp);
|
||||
definedlist.del(_T("__TIMESTAMP__"));
|
||||
}
|
||||
|
||||
|
@ -105,8 +105,8 @@ TCHAR *CEXEBuild::set_timestamp_predefine(const TCHAR *filename)
|
|||
FileTimeToLocalFileTime(&fd.ftLastWriteTime, &floctime);
|
||||
FileTimeToSystemTime(&floctime, &stime);
|
||||
|
||||
GetDateFormat(LOCALE_USER_DEFAULT, DATE_LONGDATE, &stime, NULL, datebuf, sizeof(datebuf)/sizeof(datebuf[0]));
|
||||
GetTimeFormat(LOCALE_USER_DEFAULT, 0, &stime, NULL, timebuf, sizeof(timebuf)/sizeof(timebuf[0]));
|
||||
GetDateFormat(LOCALE_USER_DEFAULT, DATE_LONGDATE, &stime, NULL, datebuf, _countof(datebuf));
|
||||
GetTimeFormat(LOCALE_USER_DEFAULT, 0, &stime, NULL, timebuf, _countof(timebuf));
|
||||
wsprintf(timestampbuf,_T("%s %s"),datebuf,timebuf);
|
||||
|
||||
definedlist.add(_T("__TIMESTAMP__"),timestampbuf);
|
||||
|
@ -139,7 +139,7 @@ TCHAR *CEXEBuild::set_line_predefine(int linecnt, BOOL is_macro)
|
|||
|
||||
TCHAR *oldline = definedlist.find(_T("__LINE__"));
|
||||
if(oldline) {
|
||||
oldline = strdup(oldline);
|
||||
oldline = _tcsdup(oldline);
|
||||
definedlist.del(_T("__LINE__"));
|
||||
}
|
||||
if(is_macro && oldline) {
|
||||
|
@ -147,7 +147,7 @@ TCHAR *CEXEBuild::set_line_predefine(int linecnt, BOOL is_macro)
|
|||
_stprintf(linebuf,_T("%s.%s"),oldline,temp);
|
||||
}
|
||||
else {
|
||||
linebuf = strdup(temp);
|
||||
linebuf = _tcsdup(temp);
|
||||
}
|
||||
definedlist.add(_T("__LINE__"),linebuf);
|
||||
|
||||
|
@ -313,7 +313,7 @@ int CEXEBuild::doParse(const TCHAR *str)
|
|||
|
||||
// escaped quotes should be ignored for compile time commands that set defines
|
||||
// because defines can be inserted in commands at a later stage
|
||||
bool ignore_escaping = (!strnicmp((TCHAR*)m_linebuild.get(),_T("!define"),7) || !strnicmp((TCHAR*)m_linebuild.get(),_T("!insertmacro"),12));
|
||||
bool ignore_escaping = (!_tcsncicmp((TCHAR*)m_linebuild.get(),_T("!define"),7) || !_tcsncicmp((TCHAR*)m_linebuild.get(),_T("!insertmacro"),12));
|
||||
res=line.parse((TCHAR*)m_linebuild.get(), ignore_escaping);
|
||||
|
||||
inside_comment = line.inCommentBlock();
|
||||
|
@ -467,9 +467,9 @@ parse_again:
|
|||
switch(mod) {
|
||||
case 0:
|
||||
case 1:
|
||||
istrue = stricmp(line.gettoken_str(1),line.gettoken_str(3)) == 0; break;
|
||||
istrue = _tcsicmp(line.gettoken_str(1),line.gettoken_str(3)) == 0; break;
|
||||
case 2:
|
||||
istrue = stricmp(line.gettoken_str(1),line.gettoken_str(3)) != 0; break;
|
||||
istrue = _tcsicmp(line.gettoken_str(1),line.gettoken_str(3)) != 0; break;
|
||||
case 3:
|
||||
istrue = line.gettoken_float(1) <= line.gettoken_float(3); break;
|
||||
case 4:
|
||||
|
@ -595,7 +595,7 @@ void CEXEBuild::ps_addtoline(const TCHAR *str, GrowBuf &linedata, StringList &hi
|
|||
}
|
||||
else if (in[0] == _T('{'))
|
||||
{
|
||||
TCHAR *s=strdup(in+1);
|
||||
TCHAR *s=_tcsdup(in+1);
|
||||
MANAGE_WITH(s, free);
|
||||
TCHAR *t=s;
|
||||
unsigned int bn = 0;
|
||||
|
@ -633,7 +633,7 @@ void CEXEBuild::ps_addtoline(const TCHAR *str, GrowBuf &linedata, StringList &hi
|
|||
}
|
||||
else if (in[0] == _T('%'))
|
||||
{
|
||||
TCHAR *s=strdup(in+1);
|
||||
TCHAR *s=_tcsdup(in+1);
|
||||
MANAGE_WITH(s, free);
|
||||
TCHAR *t=s;
|
||||
while (*t)
|
||||
|
@ -668,7 +668,7 @@ void CEXEBuild::ps_addtoline(const TCHAR *str, GrowBuf &linedata, StringList &hi
|
|||
{
|
||||
if (in[1] == _T('{')) // Found $$ before - Don't replace this define
|
||||
{
|
||||
TCHAR *s=strdup(in+2);
|
||||
TCHAR *s=_tcsdup(in+2);
|
||||
MANAGE_WITH(s, free);
|
||||
TCHAR *t=s;
|
||||
unsigned int bn = 0;
|
||||
|
@ -743,7 +743,7 @@ int CEXEBuild::parseScript()
|
|||
int CEXEBuild::includeScript(TCHAR *f)
|
||||
{
|
||||
SCRIPT_MSG(_T("!include: \"%s\"\n"),f);
|
||||
FILE *incfp=FOPEN(f,_T("rt"));
|
||||
FILE *incfp=FOPENTEXT(f,_T("rt"));
|
||||
if (!incfp)
|
||||
{
|
||||
ERROR_MSG(_T("!include: could not open file: \"%s\"\n"),f);
|
||||
|
@ -805,7 +805,7 @@ int CEXEBuild::MacroExists(const TCHAR *macroname)
|
|||
while (m && *m)
|
||||
{
|
||||
// check if macroname matches
|
||||
if (!stricmp(m, macroname))
|
||||
if (!_tcsicmp(m, macroname))
|
||||
return 1;
|
||||
|
||||
// skip macro name
|
||||
|
@ -876,7 +876,7 @@ int CEXEBuild::process_jump(LineParser &line, int wt, int *offs)
|
|||
const TCHAR *s=line.gettoken_str(wt);
|
||||
int v;
|
||||
|
||||
if (!stricmp(s,_T("0")) || !stricmp(s,_T(""))) *offs=0;
|
||||
if (!_tcsicmp(s,_T("0")) || !_tcsicmp(s,_T(""))) *offs=0;
|
||||
else if ((v=GetUserVarIndex(line, wt))>=0)
|
||||
{
|
||||
*offs=-v-1; // to jump to a user variable target, -variable_index-1 is stored.
|
||||
|
@ -930,7 +930,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
TCHAR *t=(TCHAR *)m_macros.get();
|
||||
while (t && *t)
|
||||
{
|
||||
if (!stricmp(t,line.gettoken_str(1))) break;
|
||||
if (!_tcsicmp(t,line.gettoken_str(1))) break;
|
||||
t+=_tcsclen(t)+1;
|
||||
|
||||
// advance over parameters
|
||||
|
@ -961,7 +961,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
int a;
|
||||
for (a=2; a < pc; a ++)
|
||||
{
|
||||
if (!stricmp(line.gettoken_str(pc),line.gettoken_str(a)))
|
||||
if (!_tcsicmp(line.gettoken_str(pc),line.gettoken_str(a)))
|
||||
{
|
||||
ERROR_MSG(_T("!macro: macro parameter named %s is used multiple times!\n"),
|
||||
line.gettoken_str(pc));
|
||||
|
@ -992,12 +992,12 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
LineParser l2(false);
|
||||
if (!l2.parse(str))
|
||||
{
|
||||
if (!stricmp(l2.gettoken_str(0),_T("!macroend")))
|
||||
if (!_tcsicmp(l2.gettoken_str(0),_T("!macroend")))
|
||||
{
|
||||
linecnt++;
|
||||
break;
|
||||
}
|
||||
if (!stricmp(l2.gettoken_str(0),_T("!macro")))
|
||||
if (!_tcsicmp(l2.gettoken_str(0),_T("!macro")))
|
||||
{
|
||||
ERROR_MSG(_T("Error: can't define a macro inside a macro!\n"));
|
||||
return PS_ERROR;
|
||||
|
@ -1020,7 +1020,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
TCHAR *m=t;
|
||||
while (t && *t)
|
||||
{
|
||||
if (!stricmp(t,line.gettoken_str(1))) break;
|
||||
if (!_tcsicmp(t,line.gettoken_str(1))) break;
|
||||
t+=_tcsclen(t)+1;
|
||||
|
||||
// advance over parms
|
||||
|
@ -1170,7 +1170,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
TCHAR *fc = line.gettoken_str(a);
|
||||
if (line.getnumtokens()==3)
|
||||
{
|
||||
if(!stricmp(fc,_T("/nonfatal")))
|
||||
if(!_tcsicmp(fc,_T("/nonfatal")))
|
||||
{
|
||||
fatal = 0;
|
||||
fc = line.gettoken_str(++a);
|
||||
|
@ -1201,7 +1201,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
|
||||
tstring file = basedir + *files_itr;
|
||||
|
||||
int result = unlink(file.c_str());
|
||||
int result = _tunlink(file.c_str());
|
||||
if (result == -1) {
|
||||
ERROR_MSG(_T("!delfile: \"%s\" couldn't be deleted.\n"), file.c_str());
|
||||
if (fatal)
|
||||
|
@ -1222,7 +1222,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
TCHAR *file = line.gettoken_str(1);
|
||||
TCHAR *text = line.gettoken_str(2);
|
||||
|
||||
FILE *fp = FOPEN(file, _T("a"));
|
||||
FILE *fp = FOPENTEXT(file, _T("a"));
|
||||
if (!fp)
|
||||
{
|
||||
ERROR_MSG(_T("!appendfile: \"%s\" couldn't be opened.\n"), file);
|
||||
|
@ -1250,12 +1250,12 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
{
|
||||
if (!uninstall_mode) {
|
||||
enable_last_page_cancel = 0;
|
||||
if (!stricmp(line.gettoken_str(line.getnumtokens()-1),_T("/ENABLECANCEL")))
|
||||
if (!_tcsicmp(line.gettoken_str(line.getnumtokens()-1),_T("/ENABLECANCEL")))
|
||||
enable_last_page_cancel = 1;
|
||||
}
|
||||
else {
|
||||
uenable_last_page_cancel = 0;
|
||||
if (!stricmp(line.gettoken_str(line.getnumtokens()-1),_T("/ENABLECANCEL")))
|
||||
if (!_tcsicmp(line.gettoken_str(line.getnumtokens()-1),_T("/ENABLECANCEL")))
|
||||
uenable_last_page_cancel = 1;
|
||||
}
|
||||
|
||||
|
@ -1395,7 +1395,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
{
|
||||
if (*line.gettoken_str(2))
|
||||
{
|
||||
if (strnicmp(line.gettoken_str(2), _T("un."), 3))
|
||||
if (_tcsncicmp(line.gettoken_str(2), _T("un."), 3))
|
||||
{
|
||||
if (uninstall_mode)
|
||||
{
|
||||
|
@ -1418,7 +1418,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
{
|
||||
if (*line.gettoken_str(1))
|
||||
{
|
||||
if (strnicmp(line.gettoken_str(1), _T("un."), 3))
|
||||
if (_tcsncicmp(line.gettoken_str(1), _T("un."), 3))
|
||||
{
|
||||
if (uninstall_mode)
|
||||
{
|
||||
|
@ -1447,7 +1447,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
{
|
||||
if (*line.gettoken_str(3))
|
||||
{
|
||||
if (strnicmp(line.gettoken_str(3), _T("un."), 3))
|
||||
if (_tcsncicmp(line.gettoken_str(3), _T("un."), 3))
|
||||
{
|
||||
if (uninstall_mode)
|
||||
{
|
||||
|
@ -1470,7 +1470,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
{
|
||||
if (*line.gettoken_str(2))
|
||||
{
|
||||
if (strnicmp(line.gettoken_str(2), _T("un."), 3))
|
||||
if (_tcsncicmp(line.gettoken_str(2), _T("un."), 3))
|
||||
{
|
||||
if (uninstall_mode)
|
||||
{
|
||||
|
@ -1493,7 +1493,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
{
|
||||
if (*line.gettoken_str(1))
|
||||
{
|
||||
if (strnicmp(line.gettoken_str(1), _T("un."), 3))
|
||||
if (_tcsncicmp(line.gettoken_str(1), _T("un."), 3))
|
||||
{
|
||||
if (uninstall_mode)
|
||||
{
|
||||
|
@ -1652,7 +1652,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
installer_icon = load_icon_file(line.gettoken_str(1));
|
||||
}
|
||||
catch (exception& err) {
|
||||
ERROR_MSG(_T("Error while loading icon from \"%s\": %s\n"), line.gettoken_str(1), err.what());
|
||||
ERROR_MSG(_T("Error while loading icon from \"%s\": %s\n"), line.gettoken_str(1), CtoTString(err.what()));
|
||||
return PS_ERROR;
|
||||
}
|
||||
return PS_OK;
|
||||
|
@ -1681,7 +1681,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
}
|
||||
}
|
||||
catch (exception& err) {
|
||||
ERROR_MSG(_T("Error while replacing bitmap: %s\n"), err.what());
|
||||
ERROR_MSG(_T("Error while replacing bitmap: %s\n"), CtoTString(err.what()));
|
||||
return PS_ERROR;
|
||||
}
|
||||
return PS_OK;
|
||||
|
@ -1783,17 +1783,17 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
{
|
||||
int x;
|
||||
|
||||
if (!stricmp(line.gettoken_str(1),_T("/NOCUSTOM")))
|
||||
if (!_tcsicmp(line.gettoken_str(1),_T("/NOCUSTOM")))
|
||||
{
|
||||
build_header.flags|=CH_FLAGS_NO_CUSTOM;
|
||||
SCRIPT_MSG(_T("InstType: disabling custom install type\n"));
|
||||
}
|
||||
else if (!stricmp(line.gettoken_str(1),_T("/COMPONENTSONLYONCUSTOM")))
|
||||
else if (!_tcsicmp(line.gettoken_str(1),_T("/COMPONENTSONLYONCUSTOM")))
|
||||
{
|
||||
build_header.flags|=CH_FLAGS_COMP_ONLY_ON_CUSTOM;
|
||||
SCRIPT_MSG(_T("InstType: making components viewable only on custom install type\n"));
|
||||
}
|
||||
else if (!strnicmp(line.gettoken_str(1),_T("/CUSTOMSTRING="),14))
|
||||
else if (!_tcsncicmp(line.gettoken_str(1),_T("/CUSTOMSTRING="),14))
|
||||
{
|
||||
SCRIPT_MSG(_T("InstType: setting custom text to: \"%s\"\n"),line.gettoken_str(1)+14);
|
||||
if (SetInnerString(NLF_COMP_CUSTOM,line.gettoken_str(1)+14) == PS_WARNING)
|
||||
|
@ -1807,7 +1807,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
{
|
||||
TCHAR *itname = line.gettoken_str(1);
|
||||
|
||||
if (!strnicmp(itname, _T("un."), 3)) {
|
||||
if (!_tcsncicmp(itname, _T("un."), 3)) {
|
||||
set_uninstall_mode(1);
|
||||
itname += 3;
|
||||
}
|
||||
|
@ -1864,7 +1864,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
|
||||
if (file[0] == _T('$') && file[1] == _T('('))
|
||||
{
|
||||
TCHAR *cp = strdup(file+2);
|
||||
TCHAR *cp = _tcsdup(file+2);
|
||||
MANAGE_WITH(cp, free);
|
||||
TCHAR *p = _tcschr(cp, _T(')'));
|
||||
if (p && p[1] == 0) { // if string is only a language str identifier
|
||||
|
@ -1994,12 +1994,12 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
case TOK_LICENSEBKCOLOR:
|
||||
{
|
||||
TCHAR *p = line.gettoken_str(1);
|
||||
if (!strcmpi(p,_T("/windows")))
|
||||
if (!_tcsicmp(p,_T("/windows")))
|
||||
{
|
||||
build_header.license_bg=-COLOR_WINDOW;
|
||||
SCRIPT_MSG(_T("LicenseBkColor: /windows\n"));
|
||||
}
|
||||
else if (!strcmpi(p,_T("/grey")) || !strcmpi(p,_T("/gray")))
|
||||
else if (!_tcsicmp(p,_T("/grey")) || !_tcsicmp(p,_T("/gray")))
|
||||
{
|
||||
build_header.license_bg=-COLOR_BTNFACE;
|
||||
SCRIPT_MSG(_T("LicenseBkColor: /grey\n"));
|
||||
|
@ -2150,8 +2150,8 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
build_header.flags&=~CH_FLAGS_PROGRESS_COLORED;
|
||||
for (x = 1; x < line.getnumtokens(); x ++)
|
||||
{
|
||||
if (!stricmp(line.gettoken_str(x),_T("smooth"))) smooth=1;
|
||||
else if (!stricmp(line.gettoken_str(x),_T("colored"))) build_header.flags|=CH_FLAGS_PROGRESS_COLORED;
|
||||
if (!_tcsicmp(line.gettoken_str(x),_T("smooth"))) smooth=1;
|
||||
else if (!_tcsicmp(line.gettoken_str(x),_T("colored"))) build_header.flags|=CH_FLAGS_PROGRESS_COLORED;
|
||||
else PRINTHELP()
|
||||
}
|
||||
try {
|
||||
|
@ -2177,7 +2177,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
delete [] dlg;
|
||||
}
|
||||
catch (exception& err) {
|
||||
ERROR_MSG(_T("Error setting smooth progress bar: %s\n"), err.what());
|
||||
ERROR_MSG(_T("Error setting smooth progress bar: %s\n"), CtoTString(err.what()));
|
||||
return PS_ERROR;
|
||||
}
|
||||
SCRIPT_MSG(_T("InstProgressFlags: smooth=%d, colored=%d\n"),smooth,
|
||||
|
@ -2294,15 +2294,15 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
for (int i = 2; i < line.getnumtokens(); i++) {
|
||||
TCHAR *tok=line.gettoken_str(i);
|
||||
if (tok[0]==_T('/')) {
|
||||
if (!strcmpi(tok,_T("/ITALIC"))) {
|
||||
if (!_tcsicmp(tok,_T("/ITALIC"))) {
|
||||
SCRIPT_MSG(_T(" /ITALIC"));
|
||||
newfont.lfItalic=TRUE;
|
||||
}
|
||||
else if (!strcmpi(tok,_T("/UNDERLINE"))) {
|
||||
else if (!_tcsicmp(tok,_T("/UNDERLINE"))) {
|
||||
SCRIPT_MSG(_T(" /UNDERLINE"));
|
||||
newfont.lfUnderline=TRUE;
|
||||
}
|
||||
else if (!strcmpi(tok,_T("/STRIKE"))) {
|
||||
else if (!_tcsicmp(tok,_T("/STRIKE"))) {
|
||||
SCRIPT_MSG(_T(" /STRIKE"));
|
||||
newfont.lfStrikeOut=TRUE;
|
||||
}
|
||||
|
@ -2344,7 +2344,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
build_header.bg_color1=0;
|
||||
build_header.bg_color2=RGB(0,0,255);
|
||||
}
|
||||
else if (!stricmp(line.gettoken_str(1),_T("off")))
|
||||
else if (!_tcsicmp(line.gettoken_str(1),_T("off")))
|
||||
{
|
||||
build_header.bg_color1=build_header.bg_color2=build_header.bg_textcolor=-1;
|
||||
SCRIPT_MSG(_T("BGGradient: off\n"));
|
||||
|
@ -2363,7 +2363,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
p=line.gettoken_str(3);
|
||||
if (*p)
|
||||
{
|
||||
if (!stricmp(p,_T("notext"))) build_header.bg_textcolor=-1;
|
||||
if (!_tcsicmp(p,_T("notext"))) build_header.bg_textcolor=-1;
|
||||
else
|
||||
{
|
||||
v3=_tcstoul(p,&p,16);
|
||||
|
@ -2387,7 +2387,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
TCHAR *p = line.gettoken_str(1);
|
||||
if (p[0]==_T('/'))
|
||||
{
|
||||
if (stricmp(p,_T("/windows")) || line.getnumtokens()!=2) PRINTHELP()
|
||||
if (_tcsicmp(p,_T("/windows")) || line.getnumtokens()!=2) PRINTHELP()
|
||||
build_header.lb_fg=build_header.lb_bg=-1;
|
||||
SCRIPT_MSG(_T("InstallColors: windows default colors\n"));
|
||||
}
|
||||
|
@ -2500,9 +2500,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
check = true;
|
||||
}
|
||||
} else {
|
||||
TCHAR *szClass = winchar_toansi(dlgItem->szClass);
|
||||
check = stricmp(szClass, _T("Static")) == 0;
|
||||
delete [] szClass;
|
||||
check = _wcsicmp(dlgItem->szClass, L"Static") == 0;
|
||||
}
|
||||
|
||||
if (check) {
|
||||
|
@ -2557,7 +2555,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
SCRIPT_MSG(_T("ChangeUI: %s %s%s\n"), line.gettoken_str(1), line.gettoken_str(2), branding_image_found?_T(" (branding image holder found)"):_T(""));
|
||||
}
|
||||
catch (exception& err) {
|
||||
ERROR_MSG(_T("Error while changing UI: %s\n"), err.what());
|
||||
ERROR_MSG(_T("Error while changing UI: %s\n"), CtoTString(err.what()));
|
||||
return PS_ERROR;
|
||||
}
|
||||
return PS_OK;
|
||||
|
@ -2631,7 +2629,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
branding_image_id = IDC_BRANDIMAGE;
|
||||
}
|
||||
catch (exception& err) {
|
||||
ERROR_MSG(_T("Error while adding image branding support: %s\n"), err.what());
|
||||
ERROR_MSG(_T("Error while adding image branding support: %s\n"), CtoTString(err.what()));
|
||||
return PS_ERROR;
|
||||
}
|
||||
return PS_OK;
|
||||
|
@ -2641,7 +2639,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
#endif
|
||||
case TOK_SETFONT:
|
||||
{
|
||||
if (!strnicmp(line.gettoken_str(1), _T("/LANG="), 6))
|
||||
if (!_tcsncicmp(line.gettoken_str(1), _T("/LANG="), 6))
|
||||
{
|
||||
LANGID lang_id = _ttoi(line.gettoken_str(1) + 6);
|
||||
LanguageTable *table = GetLangTable(lang_id);
|
||||
|
@ -2653,7 +2651,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
}
|
||||
else
|
||||
{
|
||||
_tcsnccpy(build_font, line.gettoken_str(1), sizeof(build_font)/sizeof(TCHAR));
|
||||
_tcsnccpy(build_font, line.gettoken_str(1), _countof(build_font));
|
||||
build_font_size = line.gettoken_int(2);
|
||||
|
||||
SCRIPT_MSG(_T("SetFont: \"%s\" %s\n"), line.gettoken_str(1), line.gettoken_str(2));
|
||||
|
@ -2714,12 +2712,12 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
|
||||
while (line.gettoken_str(a)[0] == _T('/'))
|
||||
{
|
||||
if (!strcmpi(line.gettoken_str(a),_T("/FINAL")))
|
||||
if (!_tcsicmp(line.gettoken_str(a),_T("/FINAL")))
|
||||
{
|
||||
build_compressor_final = true;
|
||||
a++;
|
||||
}
|
||||
else if (!strcmpi(line.gettoken_str(a),_T("/SOLID")))
|
||||
else if (!_tcsicmp(line.gettoken_str(a),_T("/SOLID")))
|
||||
{
|
||||
build_compress_whole = true;
|
||||
a++;
|
||||
|
@ -2807,7 +2805,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
TCHAR datebuf[256];
|
||||
TCHAR mathbuf[256];
|
||||
|
||||
if (!stricmp(define,_T("/date")) || !stricmp(define,_T("/utcdate"))) {
|
||||
if (!_tcsicmp(define,_T("/date")) || !_tcsicmp(define,_T("/utcdate"))) {
|
||||
if (line.getnumtokens()!=4) PRINTHELP()
|
||||
|
||||
TCHAR *date_type = define;
|
||||
|
@ -2818,11 +2816,11 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
time_t rawtime;
|
||||
time(&rawtime);
|
||||
|
||||
if (!stricmp(date_type,_T("/utcdate")))
|
||||
if (!_tcsicmp(date_type,_T("/utcdate")))
|
||||
rawtime = mktime(gmtime(&rawtime));
|
||||
|
||||
datebuf[0]=0;
|
||||
size_t s=strftime(datebuf,sizeof(datebuf),value,localtime(&rawtime));
|
||||
size_t s=_tcsftime(datebuf,_countof(datebuf),value,localtime(&rawtime));
|
||||
|
||||
if (s == 0)
|
||||
datebuf[0]=0;
|
||||
|
@ -2830,15 +2828,15 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
datebuf[max(s,sizeof(datebuf)-1)]=0;
|
||||
|
||||
value=datebuf;
|
||||
} else if (!stricmp(define,_T("/file")) || !stricmp(define,_T("/file_noerr"))) {
|
||||
} else if (!_tcsicmp(define,_T("/file")) || !_tcsicmp(define,_T("/file_noerr"))) {
|
||||
|
||||
if (line.getnumtokens()!=4) PRINTHELP()
|
||||
|
||||
define=line.gettoken_str(2);
|
||||
const TCHAR *filename=line.gettoken_str(3);
|
||||
FILE *fp=fopen(filename,_T("r"));
|
||||
FILE *fp=FOPENTEXT(filename,_T("r"));
|
||||
|
||||
if (!fp && stricmp(define,_T("/file_noerr"))) {
|
||||
if (!fp && _tcsicmp(define,_T("/file_noerr"))) {
|
||||
ERROR_MSG(_T("!define /file: file not found (\"%s\")\n"),filename);
|
||||
return PS_ERROR;
|
||||
}
|
||||
|
@ -2857,14 +2855,14 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
while (p >= str && (*p == _T('\r') || *p == _T('\n'))) p--;
|
||||
*++p=0;
|
||||
if (file_buf.getlen()) file_buf.add(_T("\n"),1);
|
||||
file_buf.add(str,strlen(str));
|
||||
file_buf.add(str,_tcsclen(str));
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
file_buf.add(_T("\0"),1);
|
||||
value = (TCHAR *)file_buf.get();
|
||||
|
||||
} else if (!stricmp(define,_T("/math"))) {
|
||||
} else if (!_tcsicmp(define,_T("/math"))) {
|
||||
|
||||
int value1;
|
||||
int value2;
|
||||
|
@ -2927,8 +2925,8 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
SCRIPT_MSG(_T("!undef: \"%s\"\n"),line.gettoken_str(1));
|
||||
return PS_OK;
|
||||
case TOK_P_PACKEXEHEADER:
|
||||
_tcsnccpy(build_packname,line.gettoken_str(1),sizeof(build_packname)/sizeof(TCHAR)-1);
|
||||
_tcsnccpy(build_packcmd,line.gettoken_str(2),sizeof(build_packcmd)/sizeof(TCHAR)-1);
|
||||
_tcsnccpy(build_packname,line.gettoken_str(1),_countof(build_packname)-1);
|
||||
_tcsnccpy(build_packcmd,line.gettoken_str(2),_countof(build_packcmd)-1);
|
||||
SCRIPT_MSG(_T("!packhdr: filename=\"%s\", command=\"%s\"\n"),
|
||||
build_packname, build_packcmd);
|
||||
return PS_OK;
|
||||
|
@ -2994,7 +2992,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
|
||||
TCHAR *f = line.gettoken_str(1);
|
||||
|
||||
if(!stricmp(f,_T("/nonfatal"))) {
|
||||
if(!_tcsicmp(f,_T("/nonfatal"))) {
|
||||
if (line.getnumtokens()!=3)
|
||||
PRINTHELP();
|
||||
|
||||
|
@ -3085,7 +3083,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
}
|
||||
return PS_OK;
|
||||
case TOK_P_CD:
|
||||
if (!line.gettoken_str(1)[0] || chdir(line.gettoken_str(1)))
|
||||
if (!line.gettoken_str(1)[0] || _tchdir(line.gettoken_str(1)))
|
||||
{
|
||||
ERROR_MSG(_T("!cd: error changing to: \"%s\"\n"),line.gettoken_str(1));
|
||||
return PS_ERROR;
|
||||
|
@ -3108,9 +3106,9 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
int parmOffs=1;
|
||||
while (parmOffs < line.getnumtokens())
|
||||
{
|
||||
if (!stricmp(line.gettoken_str(parmOffs),_T("/ignorecase"))) { ignCase=true; parmOffs++; }
|
||||
else if (!stricmp(line.gettoken_str(parmOffs),_T("/noerrors"))) { noErrors=true; parmOffs++; }
|
||||
else if (!stricmp(line.gettoken_str(parmOffs),_T("/file"))) { isFile=true; parmOffs++; }
|
||||
if (!_tcsicmp(line.gettoken_str(parmOffs),_T("/ignorecase"))) { ignCase=true; parmOffs++; }
|
||||
else if (!_tcsicmp(line.gettoken_str(parmOffs),_T("/noerrors"))) { noErrors=true; parmOffs++; }
|
||||
else if (!_tcsicmp(line.gettoken_str(parmOffs),_T("/file"))) { isFile=true; parmOffs++; }
|
||||
else break;
|
||||
}
|
||||
if (parmOffs+3 > line.getnumtokens())
|
||||
|
@ -3124,7 +3122,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
|
||||
if (isFile)
|
||||
{
|
||||
FILE *fp=fopen(source_string,_T("r"));
|
||||
FILE *fp=FOPENTEXT(source_string,_T("r"));
|
||||
if (!fp)
|
||||
{
|
||||
ERROR_MSG(_T("!searchparse /file: error opening \"%s\"\n"),source_string);
|
||||
|
@ -3150,8 +3148,8 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
while (p >= str && (*p == _T('\r') || *p == _T('\n'))) p--;
|
||||
*++p=0;
|
||||
|
||||
bool endSlash = (str[0] && str[strlen(str)-1] == _T('\\'));
|
||||
if (tmpstr.getlen() || endSlash) tmpstr.add(str,strlen(str));
|
||||
bool endSlash = (str[0] && str[_tcsclen(str)-1] == _T('\\'));
|
||||
if (tmpstr.getlen() || endSlash) tmpstr.add(str,_tcsclen(str));
|
||||
|
||||
// if we have valid contents and not ending on slash, then done
|
||||
if (!endSlash && (str[0] || tmpstr.getlen())) break;
|
||||
|
@ -3220,7 +3218,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
return PS_OK;
|
||||
case TOK_P_SEARCHREPLACESTRING:
|
||||
{
|
||||
int ignoreCase=!stricmp(line.gettoken_str(1),_T("/ignorecase"));
|
||||
int ignoreCase=!_tcsicmp(line.gettoken_str(1),_T("/ignorecase"));
|
||||
if (line.getnumtokens()!=5+ignoreCase) PRINTHELP()
|
||||
|
||||
TCHAR *define=line.gettoken_str(1+ignoreCase);
|
||||
|
@ -3239,7 +3237,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
|
||||
while (*src)
|
||||
{
|
||||
if (ignoreCase ? strnicmp(src,search,searchlen) : _tcsncmp(src,search,searchlen))
|
||||
if (ignoreCase ? _tcsncicmp(src,search,searchlen) : _tcsncmp(src,search,searchlen))
|
||||
valout.add(src++,1);
|
||||
else
|
||||
{
|
||||
|
@ -3334,7 +3332,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
uninstaller_icon = load_icon_file(line.gettoken_str(1));
|
||||
}
|
||||
catch (exception& err) {
|
||||
ERROR_MSG(_T("Error while loading icon from \"%s\": %s\n"), line.gettoken_str(1), err.what());
|
||||
ERROR_MSG(_T("Error while loading icon from \"%s\": %s\n"), line.gettoken_str(1), CtoTString(err.what()));
|
||||
return PS_ERROR;
|
||||
}
|
||||
return PS_OK;
|
||||
|
@ -3403,7 +3401,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
case TOK_SECTION:
|
||||
{
|
||||
int a=1,unselected = 0;
|
||||
if (!strcmpi(line.gettoken_str(1),_T("/o")))
|
||||
if (!_tcsicmp(line.gettoken_str(1),_T("/o")))
|
||||
{
|
||||
unselected = 1;
|
||||
a++;
|
||||
|
@ -3414,7 +3412,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
if (line.gettoken_str(a+1)[0]) SCRIPT_MSG(_T(" ->(%s)"),line.gettoken_str(a+1));
|
||||
SCRIPT_MSG(_T("\n"));
|
||||
#ifndef NSIS_CONFIG_UNINSTALL_SUPPORT
|
||||
if (!stricmp(line.gettoken_str(a),_T("uninstall")))
|
||||
if (!_tcsicmp(line.gettoken_str(a),_T("uninstall")))
|
||||
{
|
||||
ERROR_MSG(_T("Error: Uninstall section declared, no NSIS_CONFIG_UNINSTALL_SUPPORT\n"));
|
||||
return PS_ERROR;
|
||||
|
@ -3425,7 +3423,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
|
||||
if (line.gettoken_str(a)[0]==_T('-'))
|
||||
{
|
||||
if (!strnicmp(line.gettoken_str(a)+1,_T("un."),3))
|
||||
if (!_tcsncicmp(line.gettoken_str(a)+1,_T("un."),3))
|
||||
ret=add_section(_T("un."),line.gettoken_str(a+1));
|
||||
else
|
||||
ret=add_section(_T(""),line.gettoken_str(a+1));
|
||||
|
@ -3448,7 +3446,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
for (wt = 1; wt < line.getnumtokens(); wt ++)
|
||||
{
|
||||
TCHAR *p=line.gettoken_str(wt);
|
||||
if (!stricmp(p, _T("RO")))
|
||||
if (!_tcsicmp(p, _T("RO")))
|
||||
{
|
||||
if (section_add_flags(SF_RO) != PS_OK) return PS_ERROR;
|
||||
SCRIPT_MSG(_T("[RO] "));
|
||||
|
@ -3483,7 +3481,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
{
|
||||
TCHAR buf[1024];
|
||||
int a=1,ex = 0;
|
||||
if (!strcmpi(line.gettoken_str(1),_T("/e")))
|
||||
if (!_tcsicmp(line.gettoken_str(1),_T("/e")))
|
||||
{
|
||||
ex = 1;
|
||||
a++;
|
||||
|
@ -3492,7 +3490,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
if (which_token == TOK_SECTIONGROUP || which_token == TOK_SUBSECTION)
|
||||
{
|
||||
TCHAR *s = line.gettoken_str(a);
|
||||
if (!s[0] || (!strcmpi(s, _T("un.")) && !s[3]))
|
||||
if (!s[0] || (!_tcsicmp(s, _T("un.")) && !s[3]))
|
||||
PRINTHELP();
|
||||
}
|
||||
|
||||
|
@ -3510,7 +3508,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
}
|
||||
SCRIPT_MSG(_T("Function: \"%s\"\n"),line.gettoken_str(1));
|
||||
#ifndef NSIS_CONFIG_UNINSTALL_SUPPORT
|
||||
if (!strnicmp(line.gettoken_str(1),_T("un."),3))
|
||||
if (!_tcsncicmp(line.gettoken_str(1),_T("un."),3))
|
||||
{
|
||||
ERROR_MSG(_T("Error: Uninstall function declared, no NSIS_CONFIG_UNINSTALL_SUPPORT\n"));
|
||||
return PS_ERROR;
|
||||
|
@ -3654,10 +3652,10 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
int a = 1;
|
||||
int trim = 0;
|
||||
while (line.gettoken_str(a)[0] == _T('/')) {
|
||||
if (!strnicmp(line.gettoken_str(a),_T("/TRIM"),5)) {
|
||||
if (!stricmp(line.gettoken_str(a)+5,_T("LEFT"))) trim = 1;
|
||||
else if (!stricmp(line.gettoken_str(a)+5,_T("RIGHT"))) trim = 2;
|
||||
else if (!stricmp(line.gettoken_str(a)+5,_T("CENTER"))) trim = 3;
|
||||
if (!_tcsncicmp(line.gettoken_str(a),_T("/TRIM"),5)) {
|
||||
if (!_tcsicmp(line.gettoken_str(a)+5,_T("LEFT"))) trim = 1;
|
||||
else if (!_tcsicmp(line.gettoken_str(a)+5,_T("RIGHT"))) trim = 2;
|
||||
else if (!_tcsicmp(line.gettoken_str(a)+5,_T("CENTER"))) trim = 3;
|
||||
else PRINTHELP();
|
||||
a++;
|
||||
}
|
||||
|
@ -3677,7 +3675,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
if (trim) {
|
||||
TCHAR str[512];
|
||||
if (line.getnumtokens()==a+1 && line.gettoken_str(a)[0])
|
||||
strcpy(str, line.gettoken_str(a));
|
||||
_tcscpy(str, line.gettoken_str(a));
|
||||
else
|
||||
wsprintf(str, _T("Nullsoft Install System %s"), NSIS_VERSION);
|
||||
|
||||
|
@ -3701,7 +3699,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
res_editor->FreeResource(dlg);
|
||||
}
|
||||
catch (exception& err) {
|
||||
ERROR_MSG(_T("Error while triming branding text control: %s\n"), err.what());
|
||||
ERROR_MSG(_T("Error while triming branding text control: %s\n"), CtoTString(err.what()));
|
||||
return PS_ERROR;
|
||||
}
|
||||
#else
|
||||
|
@ -3725,7 +3723,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
return PS_OK;
|
||||
case TOK_SPACETEXTS:
|
||||
{
|
||||
if (!strcmpi(line.gettoken_str(1), _T("none"))) {
|
||||
if (!_tcsicmp(line.gettoken_str(1), _T("none"))) {
|
||||
no_space_texts=true;
|
||||
SCRIPT_MSG(_T("SpaceTexts: none\n"));
|
||||
}
|
||||
|
@ -3831,13 +3829,13 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
case TOK_CALL:
|
||||
if (!line.gettoken_str(1)[0] || (line.gettoken_str(1)[0]==_T(':') && !line.gettoken_str(1)[1] )) PRINTHELP()
|
||||
#ifdef NSIS_CONFIG_UNINSTALL_SUPPORT
|
||||
if (uninstall_mode && strnicmp(line.gettoken_str(1),_T("un."),3)
|
||||
if (uninstall_mode && _tcsncicmp(line.gettoken_str(1),_T("un."),3)
|
||||
&& (GetUserVarIndex(line,1) < 0) && line.gettoken_str(1)[0]!=_T(':'))
|
||||
{
|
||||
ERROR_MSG(_T("Call must be used with function names starting with \"un.\" in the uninstall section.\n"));
|
||||
PRINTHELP()
|
||||
}
|
||||
if (!uninstall_mode && !strnicmp(line.gettoken_str(1),_T("un."),3))
|
||||
if (!uninstall_mode && !_tcsncicmp(line.gettoken_str(1),_T("un."),3))
|
||||
{
|
||||
ERROR_MSG(_T("Call must not be used with functions starting with \"un.\" in the non-uninstall sections.\n"));
|
||||
PRINTHELP()
|
||||
|
@ -3886,9 +3884,9 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
else
|
||||
{
|
||||
if (p[0] == _T('\\') && p[1] != _T('\\')) p++;
|
||||
strncpy(out_path,p,1024-1);
|
||||
if (*CharPrev(out_path,out_path+strlen(out_path))==_T('\\'))
|
||||
*CharPrev(out_path,out_path+strlen(out_path))=0; // remove trailing slash
|
||||
_tcsnccpy(out_path,p,1024-1);
|
||||
if (*CharPrev(out_path,out_path+_tcsclen(out_path))==_T('\\'))
|
||||
*CharPrev(out_path,out_path+_tcsclen(out_path))=0; // remove trailing slash
|
||||
}
|
||||
if (!*out_path) PRINTHELP()
|
||||
SCRIPT_MSG(_T("CreateDirectory: \"%s\"\n"),out_path);
|
||||
|
@ -3962,7 +3960,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
else if (which_token == TOK_CALLINSTDLL)
|
||||
{
|
||||
int a = 2;
|
||||
if (!stricmp(line.gettoken_str(a), _T("/NOUNLOAD"))) {
|
||||
if (!_tcsicmp(line.gettoken_str(a), _T("/NOUNLOAD"))) {
|
||||
ent.offsets[3]=1;
|
||||
a++;
|
||||
}
|
||||
|
@ -3991,7 +3989,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
{
|
||||
int a=1;
|
||||
ent.which=EW_RENAME;
|
||||
if (!stricmp(line.gettoken_str(1),_T("/REBOOTOK")))
|
||||
if (!_tcsicmp(line.gettoken_str(1),_T("/REBOOTOK")))
|
||||
{
|
||||
ent.offsets[2]=1;
|
||||
a++;
|
||||
|
@ -4061,8 +4059,8 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
TCHAR *np=p;
|
||||
while (*np && *np != _T('|')) np++;
|
||||
if (*np) *np++=0;
|
||||
for (x = 0 ; (unsigned) x < sizeof(list) / sizeof(list[0]) && strcmpi(list[x].str, p); x++);
|
||||
if ((unsigned) x < sizeof(list) / sizeof(list[0]))
|
||||
for (x = 0 ; (unsigned) x < _countof(list) && _tcsicmp(list[x].str, p); x++);
|
||||
if ((unsigned) x < _countof(list))
|
||||
{
|
||||
r|=list[x].id;
|
||||
}
|
||||
|
@ -4080,7 +4078,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
int a=3;
|
||||
if (line.getnumtokens() > 3)
|
||||
{
|
||||
if (!strcmpi(line.gettoken_str(3),_T("/SD")))
|
||||
if (!_tcsicmp(line.gettoken_str(3),_T("/SD")))
|
||||
{
|
||||
int k=line.gettoken_enum(4,retstr);
|
||||
if (k <= 0) PRINTHELP();
|
||||
|
@ -4153,9 +4151,9 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
TCHAR *s=(line.gettoken_str(7));
|
||||
|
||||
TCHAR b[255];
|
||||
for (unsigned int spos=0; (spos <= strlen(s)) && (spos <= 255); spos++)
|
||||
b[spos]=toupper(*(s+spos));
|
||||
strcpy(s,b);
|
||||
for (unsigned int spos=0; (spos <= _tcsclen(s)) && (spos <= 255); spos++)
|
||||
b[spos]=_totupper(*(s+spos));
|
||||
_tcscpy(s,b);
|
||||
|
||||
if (*s)
|
||||
{
|
||||
|
@ -4284,7 +4282,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
|
||||
int a = 2;
|
||||
|
||||
if (!strcmpi(line.gettoken_str(2),_T("/BRANDING")))
|
||||
if (!_tcsicmp(line.gettoken_str(2),_T("/BRANDING")))
|
||||
a++;
|
||||
|
||||
{
|
||||
|
@ -4295,7 +4293,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
return PS_ERROR;
|
||||
}
|
||||
|
||||
if (!strcmpi(line.gettoken_str(a+1),_T("transparent"))) {
|
||||
if (!_tcsicmp(line.gettoken_str(a+1),_T("transparent"))) {
|
||||
c.flags|=CC_BKB;
|
||||
c.lbStyle=BS_NULL;
|
||||
c.bkmode=TRANSPARENT;
|
||||
|
@ -4366,15 +4364,15 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
for (int i = 3; i < line.getnumtokens(); i++) {
|
||||
TCHAR *tok=line.gettoken_str(i);
|
||||
if (tok[0]=='/') {
|
||||
if (!strcmpi(tok,_T("/ITALIC"))) {
|
||||
if (!_tcsicmp(tok,_T("/ITALIC"))) {
|
||||
SCRIPT_MSG(_T(" /ITALIC"));
|
||||
flags|=1;
|
||||
}
|
||||
else if (!strcmpi(tok,_T("/UNDERLINE"))) {
|
||||
else if (!_tcsicmp(tok,_T("/UNDERLINE"))) {
|
||||
SCRIPT_MSG(_T(" /UNDERLINE"));
|
||||
flags|=2;
|
||||
}
|
||||
else if (!strcmpi(tok,_T("/STRIKE"))) {
|
||||
else if (!_tcsicmp(tok,_T("/STRIKE"))) {
|
||||
SCRIPT_MSG(_T(" /STRIKE"));
|
||||
flags|=4;
|
||||
}
|
||||
|
@ -4468,7 +4466,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
{
|
||||
int a=1;
|
||||
ent.which=EW_DELETEFILE;
|
||||
if (!stricmp(line.gettoken_str(a),_T("/REBOOTOK")))
|
||||
if (!_tcsicmp(line.gettoken_str(a),_T("/REBOOTOK")))
|
||||
{
|
||||
a++;
|
||||
ent.offsets[1]=DEL_REBOOT;
|
||||
|
@ -4503,13 +4501,13 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
ent.offsets[1]=DEL_DIR;
|
||||
while (line.gettoken_str(a)[0]==_T('/'))
|
||||
{
|
||||
if (!stricmp(line.gettoken_str(a),_T("/r")))
|
||||
if (!_tcsicmp(line.gettoken_str(a),_T("/r")))
|
||||
{
|
||||
if (a == 3) PRINTHELP();
|
||||
a++;
|
||||
ent.offsets[1]|=DEL_RECURSE;
|
||||
}
|
||||
else if (!stricmp(line.gettoken_str(a),_T("/REBOOTOK")))
|
||||
else if (!_tcsicmp(line.gettoken_str(a),_T("/REBOOTOK")))
|
||||
{
|
||||
if (a == 3) PRINTHELP();
|
||||
a++;
|
||||
|
@ -4543,11 +4541,11 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
{
|
||||
set<tstring> excluded;
|
||||
int a=1,attrib=0,rec=0,fatal=1;
|
||||
if (!stricmp(line.gettoken_str(a),_T("/nonfatal"))) {
|
||||
if (!_tcsicmp(line.gettoken_str(a),_T("/nonfatal"))) {
|
||||
fatal=0;
|
||||
a++;
|
||||
}
|
||||
if (which_token == TOK_FILE && !stricmp(line.gettoken_str(a),_T("/a")))
|
||||
if (which_token == TOK_FILE && !_tcsicmp(line.gettoken_str(a),_T("/a")))
|
||||
{
|
||||
#ifdef _WIN32
|
||||
attrib=1;
|
||||
|
@ -4556,12 +4554,12 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
#endif
|
||||
a++;
|
||||
}
|
||||
if (!stricmp(line.gettoken_str(a),_T("/r")))
|
||||
if (!_tcsicmp(line.gettoken_str(a),_T("/r")))
|
||||
{
|
||||
rec=1;
|
||||
a++;
|
||||
}
|
||||
else if (which_token == TOK_FILE && !strnicmp(line.gettoken_str(a),_T("/oname="),7))
|
||||
else if (which_token == TOK_FILE && !_tcsncicmp(line.gettoken_str(a),_T("/oname="),7))
|
||||
{
|
||||
TCHAR *on=line.gettoken_str(a)+7;
|
||||
a++;
|
||||
|
@ -4598,9 +4596,9 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
|
||||
return PS_OK;
|
||||
}
|
||||
if (!strnicmp(line.gettoken_str(a),_T("/x"),2))
|
||||
if (!_tcsncicmp(line.gettoken_str(a),_T("/x"),2))
|
||||
{
|
||||
while (!strnicmp(line.gettoken_str(a),_T("/x"),2))
|
||||
while (!_tcsncicmp(line.gettoken_str(a),_T("/x"),2))
|
||||
{
|
||||
a++;
|
||||
|
||||
|
@ -4661,13 +4659,13 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
int x;
|
||||
for (x = 0; x < 2; x ++)
|
||||
{
|
||||
if (!stricmp(line.gettoken_str(a),_T("/SILENT")))
|
||||
if (!_tcsicmp(line.gettoken_str(a),_T("/SILENT")))
|
||||
{
|
||||
a++;
|
||||
ent.offsets[2]&=~FOF_SIMPLEPROGRESS;
|
||||
ent.offsets[2]|=FOF_SILENT;
|
||||
}
|
||||
else if (!stricmp(line.gettoken_str(a),_T("/FILESONLY")))
|
||||
else if (!_tcsicmp(line.gettoken_str(a),_T("/FILESONLY")))
|
||||
{
|
||||
a++;
|
||||
ent.offsets[2]|=FOF_FILESONLY;
|
||||
|
@ -4731,9 +4729,9 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
TCHAR *np=p;
|
||||
while (*np && *np != _T('|')) np++;
|
||||
if (*np) *np++=0;
|
||||
for (x = 0 ; (unsigned) x < sizeof(list)/sizeof(list[0]) && stricmp(list[x].str,p); x ++);
|
||||
for (x = 0 ; (unsigned) x < _countof(list) && _tcsicmp(list[x].str,p); x ++);
|
||||
|
||||
if ((unsigned) x < sizeof(list)/sizeof(list[0]))
|
||||
if ((unsigned) x < _countof(list))
|
||||
{
|
||||
r|=list[x].id;
|
||||
}
|
||||
|
@ -5079,7 +5077,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
{
|
||||
int a=0;
|
||||
ent.which=EW_GETFULLPATHNAME;
|
||||
if (line.getnumtokens()==4 && !stricmp(line.gettoken_str(1),_T("/SHORT"))) a++;
|
||||
if (line.getnumtokens()==4 && !_tcsicmp(line.gettoken_str(1),_T("/SHORT"))) a++;
|
||||
else if (line.getnumtokens()==4 || *line.gettoken_str(1)==_T('/')) PRINTHELP()
|
||||
ent.offsets[0]=add_string(line.gettoken_str(2+a));
|
||||
ent.offsets[1]=GetUserVarIndex(line, 1+a);
|
||||
|
@ -5206,7 +5204,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
TCHAR *s=line.gettoken_str(a);
|
||||
if (s[0] == _T('/'))
|
||||
{
|
||||
if (stricmp(s,_T("/ifempty"))) PRINTHELP()
|
||||
if (_tcsicmp(s,_T("/ifempty"))) PRINTHELP()
|
||||
a++;
|
||||
ent.offsets[4]=3;
|
||||
}
|
||||
|
@ -5391,9 +5389,9 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
ent.offsets[0]=GetUserVarIndex(line, 1);
|
||||
{
|
||||
TCHAR str[NSIS_MAX_STRLEN];
|
||||
strcpy(str, _T("%"));
|
||||
strcat(str, line.gettoken_str(2));
|
||||
strcat(str, _T("%"));
|
||||
_tcscpy(str, _T("%"));
|
||||
_tcscat(str, line.gettoken_str(2));
|
||||
_tcscat(str, _T("%"));
|
||||
ent.offsets[1]=add_string(str);
|
||||
if (ent.offsets[0] < 0 || _tcsclen(line.gettoken_str(2))<1) PRINTHELP()
|
||||
}
|
||||
|
@ -5453,17 +5451,17 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
ent.offsets[0]=GetUserVarIndex(line, 1); // file handle
|
||||
ent.offsets[3]=add_string(line.gettoken_str(2));
|
||||
ent.offsets[1]=0; //openmode
|
||||
if (!stricmp(line.gettoken_str(3),_T("r")))
|
||||
if (!_tcsicmp(line.gettoken_str(3),_T("r")))
|
||||
{
|
||||
ent.offsets[1]=GENERIC_READ;
|
||||
ent.offsets[2]=OPEN_EXISTING;
|
||||
}
|
||||
else if (!stricmp(line.gettoken_str(3),_T("w")))
|
||||
else if (!_tcsicmp(line.gettoken_str(3),_T("w")))
|
||||
{
|
||||
ent.offsets[1]=GENERIC_WRITE;
|
||||
ent.offsets[2]=CREATE_ALWAYS;
|
||||
}
|
||||
else if (!stricmp(line.gettoken_str(3),_T("a")))
|
||||
else if (!_tcsicmp(line.gettoken_str(3),_T("a")))
|
||||
{
|
||||
ent.offsets[1]=GENERIC_WRITE|GENERIC_READ;
|
||||
ent.offsets[2]=OPEN_ALWAYS;
|
||||
|
@ -5731,11 +5729,11 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
}
|
||||
ent.which=EW_SETBRANDINGIMAGE;
|
||||
for (int i = 1; i < line.getnumtokens(); i++)
|
||||
if (!strnicmp(line.gettoken_str(i),_T("/IMGID="),7)) {
|
||||
if (!_tcsncicmp(line.gettoken_str(i),_T("/IMGID="),7)) {
|
||||
ent.offsets[1]=_ttoi(line.gettoken_str(i)+7);
|
||||
SCRIPT_MSG(_T("/IMGID=%d "),ent.offsets[1]);
|
||||
}
|
||||
else if (!stricmp(line.gettoken_str(i),_T("/RESIZETOFIT"))) {
|
||||
else if (!_tcsicmp(line.gettoken_str(i),_T("/RESIZETOFIT"))) {
|
||||
ent.offsets[2]=1; // must be 1 or 0
|
||||
SCRIPT_MSG(_T("/RESIZETOFIT "));
|
||||
}
|
||||
|
@ -5764,7 +5762,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
{
|
||||
int a=1;
|
||||
|
||||
if (!strcmpi(line.gettoken_str(1),_T("/GLOBAL")))
|
||||
if (!_tcsicmp(line.gettoken_str(1),_T("/GLOBAL")))
|
||||
{
|
||||
a++;
|
||||
}
|
||||
|
@ -5797,7 +5795,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
{
|
||||
LANGID LangID=0;
|
||||
int a = 1;
|
||||
if (!strnicmp(line.gettoken_str(a),_T("/LANG="),6))
|
||||
if (!_tcsncicmp(line.gettoken_str(a),_T("/LANG="),6))
|
||||
LangID=_ttoi(line.gettoken_str(a++)+6);
|
||||
if (line.getnumtokens()!=a+2) PRINTHELP();
|
||||
TCHAR *pKey = line.gettoken_str(a);
|
||||
|
@ -5938,7 +5936,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
|
||||
int i = 1;
|
||||
int nounload = 0;
|
||||
if (!strcmpi(line.gettoken_str(i), _T("/NOUNLOAD"))) {
|
||||
if (!_tcsicmp(line.gettoken_str(i), _T("/NOUNLOAD"))) {
|
||||
i++;
|
||||
nounload++;
|
||||
}
|
||||
|
@ -5951,7 +5949,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
int w=parmst + (line.getnumtokens()-i - 1);
|
||||
ent.which=EW_PUSHPOP;
|
||||
ent.offsets[0]=add_string(line.gettoken_str(w));
|
||||
if (!strcmpi(line.gettoken_str(w), _T("/NOUNLOAD"))) nounloadmisused=1;
|
||||
if (!_tcsicmp(line.gettoken_str(w), _T("/NOUNLOAD"))) nounloadmisused=1;
|
||||
ent.offsets[1]=0;
|
||||
ent.offsets[2]=0;
|
||||
ret=add_entry(&ent);
|
||||
|
@ -6401,7 +6399,7 @@ DefineList *CEXEBuild::searchParseString(const TCHAR *source_string, LineParser
|
|||
if (tok && *tok)
|
||||
{
|
||||
int toklen = _tcsclen(tok);
|
||||
while (*source_string && (ignCase?strnicmp(source_string,tok,toklen):_tcsncmp(source_string,tok,toklen))) source_string++;
|
||||
while (*source_string && (ignCase?_tcsncicmp(source_string,tok,toklen):_tcsncmp(source_string,tok,toklen))) source_string++;
|
||||
|
||||
if (!*source_string)
|
||||
{
|
||||
|
@ -6425,7 +6423,7 @@ DefineList *CEXEBuild::searchParseString(const TCHAR *source_string, LineParser
|
|||
if (tok && *tok)
|
||||
{
|
||||
int toklen = _tcsclen(tok);
|
||||
while (*source_string && (ignCase?strnicmp(source_string,tok,toklen):_tcsncmp(source_string,tok,toklen))) source_string++;
|
||||
while (*source_string && (ignCase?_tcsncicmp(source_string,tok,toklen):_tcsncmp(source_string,tok,toklen))) source_string++;
|
||||
|
||||
maxlen = source_string - src_start;
|
||||
|
||||
|
@ -6446,7 +6444,7 @@ DefineList *CEXEBuild::searchParseString(const TCHAR *source_string, LineParser
|
|||
if (maxlen < 0) ret->add(defout,src_start);
|
||||
else
|
||||
{
|
||||
TCHAR *p=strdup(src_start);
|
||||
TCHAR *p=_tcsdup(src_start);
|
||||
if (p)
|
||||
{
|
||||
p[maxlen]=0;
|
||||
|
|
|
@ -290,7 +290,7 @@ void CEXEBuild::print_help(TCHAR *commandname)
|
|||
int x;
|
||||
for (x = 0; x < TOK__LAST; x ++)
|
||||
{
|
||||
if (!commandname || !stricmp(tokenlist[x].name,commandname))
|
||||
if (!commandname || !_tcsicmp(tokenlist[x].name,commandname))
|
||||
{
|
||||
ERROR_MSG(_T("%s%s %s\n"),commandname?_T("Usage: "):_T(""),tokenlist[x].name,tokenlist[x].usage_str);
|
||||
if (commandname) break;
|
||||
|
@ -306,7 +306,7 @@ void CEXEBuild::print_help(TCHAR *commandname)
|
|||
bool CEXEBuild::is_valid_token(TCHAR *s)
|
||||
{
|
||||
for (int x = 0; x < TOK__LAST; x ++)
|
||||
if (!stricmp(tokenlist[x].name,s))
|
||||
if (!_tcsicmp(tokenlist[x].name,s))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
@ -315,7 +315,7 @@ int CEXEBuild::get_commandtoken(TCHAR *s, int *np, int *op, int *pos)
|
|||
{
|
||||
int x;
|
||||
for (x = 0; x < TOK__LAST; x ++)
|
||||
if (!stricmp(tokenlist[x].name,s))
|
||||
if (!_tcsicmp(tokenlist[x].name,s))
|
||||
{
|
||||
*np=tokenlist[x].num_parms;
|
||||
*op=tokenlist[x].opt_parms;
|
||||
|
|
|
@ -13,7 +13,9 @@
|
|||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty.
|
||||
*/
|
||||
|
||||
/* Unicode support by Jim Park -- 07/23/2007 */
|
||||
|
||||
#include "Platform.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
@ -24,6 +26,7 @@
|
|||
#include "util.h"
|
||||
#include "strlist.h"
|
||||
#include "winchar.h"
|
||||
|
||||
#ifndef _WIN32
|
||||
# include <ctype.h>
|
||||
# include <unistd.h> // for close(2)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue