added NSIS_CONFIG_LOG_STDOUT
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4510 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
cfec122ba1
commit
94f7f3b673
11 changed files with 45 additions and 10 deletions
|
@ -11,6 +11,7 @@ defenv['NODEFLIBS_FLAG'] = ''
|
|||
defenv['C_FLAG'] = ''
|
||||
defenv['CPP_FLAG'] = ''
|
||||
defenv['CPP_REQUIRES_STDLIB'] = 0
|
||||
defenv['SUBSYS_CON'] = ''
|
||||
|
||||
### stub environment
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ defenv['C_FLAG'] = '-x c'
|
|||
defenv['CPP_FLAG'] = '-x c++'
|
||||
defenv['ALIGN_FLAG'] = '-Wl,--file-alignment,512'
|
||||
defenv['CPP_REQUIRES_STDLIB'] = 1
|
||||
defenv['SUBSYS_CON'] = '-Wl,--subsystem,console'
|
||||
|
||||
### debug
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ defenv['NODEFLIBS_FLAG'] = '/NODEFAULTLIB'
|
|||
defenv['C_FLAG'] = '/TC'
|
||||
defenv['CPP_FLAG'] = '/TP'
|
||||
defenv['CPP_REQUIRES_STDLIB'] = 0
|
||||
defenv['SUBSYS_CON'] = '/subsystem:console'
|
||||
|
||||
### debug
|
||||
|
||||
|
|
|
@ -141,6 +141,14 @@ cfg.Add(
|
|||
)
|
||||
)
|
||||
|
||||
cfg.Add(
|
||||
BoolOption(
|
||||
'NSIS_CONFIG_LOG_STDOUT',
|
||||
'makes the logging facility use stdout instead of a file.',
|
||||
'no'
|
||||
)
|
||||
)
|
||||
|
||||
cfg.Add(
|
||||
BoolOption(
|
||||
'NSIS_SUPPORT_BGBG',
|
||||
|
@ -443,6 +451,7 @@ AddBoolDefine('NSIS_CONFIG_CRC_SUPPORT')
|
|||
AddBoolDefine('NSIS_CONFIG_CRC_ANAL')
|
||||
AddBoolDefine('NSIS_CONFIG_LOG')
|
||||
AddBoolDefine('NSIS_CONFIG_LOG_ODS')
|
||||
AddBoolDefine('NSIS_CONFIG_LOG_STDOUT')
|
||||
AddBoolDefine('NSIS_SUPPORT_BGBG')
|
||||
AddBoolDefine('NSIS_SUPPORT_CODECALLBACKS')
|
||||
AddBoolDefine('NSIS_SUPPORT_MOVEONREBOOT')
|
||||
|
|
|
@ -130,6 +130,9 @@ CEXEBuild::CEXEBuild() :
|
|||
#ifdef NSIS_CONFIG_LOG_ODS
|
||||
definedlist.add("NSIS_CONFIG_LOG_ODS");
|
||||
#endif
|
||||
#ifdef NSIS_CONFIG_LOG_STDOUT
|
||||
definedlist.add("NSIS_CONFIG_LOG_STDOUT");
|
||||
#endif
|
||||
#ifdef NSIS_CONFIG_PLUGIN_SUPPORT
|
||||
definedlist.add("NSIS_CONFIG_PLUGIN_SUPPORT");
|
||||
#endif
|
||||
|
|
|
@ -272,9 +272,9 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam,
|
|||
ret = ui_doinstall();
|
||||
|
||||
#ifdef NSIS_CONFIG_LOG
|
||||
#ifndef NSIS_CONFIG_LOG_ODS
|
||||
#if !defined(NSIS_CONFIG_LOG_ODS) && !defined(NSIS_CONFIG_LOG_STDOUT)
|
||||
log_write(1);
|
||||
#endif//!NSIS_CONFIG_LOG_ODS
|
||||
#endif//!NSIS_CONFIG_LOG_ODS && !NSIS_CONFIG_LOG_STDOUT
|
||||
#endif//NSIS_CONFIG_LOG
|
||||
end:
|
||||
|
||||
|
|
|
@ -76,6 +76,11 @@ env.Append(CPPDEFINES = ['WIN32_LEAN_AND_MEAN'])
|
|||
env.Append(CPPDEFINES = ['_WIN32_IE=0x0500'])
|
||||
env.Append(CPPDEFINES = env['NSIS_CPPDEFINES'])
|
||||
|
||||
### Some other settings
|
||||
|
||||
if 'NSIS_CONFIG_LOG_STDOUT' in env['NSIS_CPPDEFINES']:
|
||||
env.Append(LINKFLAGS = env['SUBSYS_CON'])
|
||||
|
||||
### Compression specific configuration
|
||||
|
||||
if compression == 'bzip2':
|
||||
|
|
|
@ -165,7 +165,7 @@ static BOOL NSISCALL _HandleStaticBkColor(UINT uMsg, WPARAM wParam, LPARAM lPara
|
|||
#endif//!NSIS_CONFIG_ENHANCEDUI_SUPPORT
|
||||
|
||||
#ifdef NSIS_CONFIG_LOG
|
||||
#ifndef NSIS_CONFIG_LOG_ODS
|
||||
#if !defined(NSIS_CONFIG_LOG_ODS) && !defined(NSIS_CONFIG_LOG_STDOUT)
|
||||
void NSISCALL build_g_logfile()
|
||||
{
|
||||
mystrcat(addtrailingslash(mystrcpy(g_log_file,state_install_directory)),"install.log");
|
||||
|
@ -329,7 +329,7 @@ FORCE_INLINE int NSISCALL ui_doinstall(void)
|
|||
#ifdef NSIS_CONFIG_LOG
|
||||
if (g_flags & CH_FLAGS_SILENT_LOG && !g_is_uninstaller)
|
||||
{
|
||||
#ifndef NSIS_CONFIG_LOG_ODS
|
||||
#if !defined(NSIS_CONFIG_LOG_ODS) && !defined(NSIS_CONFIG_LOG_STDOUT)
|
||||
build_g_logfile();
|
||||
#endif
|
||||
log_dolog=1;
|
||||
|
@ -882,7 +882,7 @@ static BOOL CALLBACK DirProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
|
|||
GetUIText(IDC_DIR,dir);
|
||||
validate_filename(dir);
|
||||
#ifdef NSIS_CONFIG_LOG
|
||||
#ifndef NSIS_CONFIG_LOG_ODS
|
||||
#if !defined(NSIS_CONFIG_LOG_ODS) && !defined(NSIS_CONFIG_LOG_STDOUT)
|
||||
build_g_logfile();
|
||||
#endif
|
||||
if (GetUIItem(IDC_CHECK1) != NULL)
|
||||
|
|
|
@ -30,6 +30,12 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef NSIS_CONFIG_LOG_STDOUT
|
||||
#ifndef NSIS_CONFIG_LOG
|
||||
#error NSIS_CONFIG_LOG_STDOUT relies on NSIS_CONFIG_LOG, but NSIS_CONFIG_LOG is not defined
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(NSIS_CONFIG_CRC_SUPPORT) && defined(NSIS_CONFIG_VISIBLE_SUPPORT)
|
||||
#define _NSIS_CONFIG_VERIFYDIALOG
|
||||
#endif
|
||||
|
|
|
@ -1482,7 +1482,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
|
|||
log_printf2("settings logging to %d",parm1);
|
||||
log_dolog=parm1;
|
||||
log_printf2("logging set to %d",parm1);
|
||||
#ifndef NSIS_CONFIG_LOG_ODS
|
||||
#if !defined(NSIS_CONFIG_LOG_ODS) && !defined(NSIS_CONFIG_LOG_STDOUT)
|
||||
if (parm1) build_g_logfile();
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include "ui.h"
|
||||
|
||||
#ifdef NSIS_CONFIG_LOG
|
||||
#ifndef NSIS_CONFIG_LOG_ODS
|
||||
#if !defined(NSIS_CONFIG_LOG_ODS) && !defined(NSIS_CONFIG_LOG_STDOUT)
|
||||
char g_log_file[1024];
|
||||
#endif
|
||||
#endif
|
||||
|
@ -730,7 +730,7 @@ void NSISCALL validate_filename(char *in) {
|
|||
int log_dolog;
|
||||
char log_text[NSIS_MAX_STRLEN*4];
|
||||
|
||||
#ifndef NSIS_CONFIG_LOG_ODS
|
||||
#if !defined(NSIS_CONFIG_LOG_ODS) && !defined(NSIS_CONFIG_LOG_STDOUT)
|
||||
void NSISCALL log_write(int close)
|
||||
{
|
||||
static HANDLE fp=INVALID_HANDLE_VALUE;
|
||||
|
@ -759,7 +759,7 @@ void NSISCALL log_write(int close)
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif//!NSIS_CONFIG_LOG_ODS
|
||||
#endif//!NSIS_CONFIG_LOG_ODS && !NSIS_CONFIG_LOG_STDOUT
|
||||
|
||||
const char * _RegKeyHandleToName(HKEY hKey)
|
||||
{
|
||||
|
@ -817,7 +817,16 @@ void log_printf(char *format, ...)
|
|||
#ifdef NSIS_CONFIG_LOG_ODS
|
||||
if (log_dolog)
|
||||
OutputDebugString(log_text);
|
||||
#else
|
||||
#endif
|
||||
#ifdef NSIS_CONFIG_LOG_STDOUT
|
||||
if (GetStdHandle(STD_OUTPUT_HANDLE) != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
DWORD dwBytes;
|
||||
WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), log_text, lstrlen(log_text), &dwBytes, NULL);
|
||||
WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), "\n", 1, &dwBytes, NULL);
|
||||
}
|
||||
#endif
|
||||
#if !defined(NSIS_CONFIG_LOG_ODS) && !defined(NSIS_CONFIG_LOG_STDOUT)
|
||||
log_write(0);
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue