(kichik) MakeNSIS now sends output directly to MakeNSISw, faster, and no

more problems with foreign languages in the output.


git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1996 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
joostverburg 2002-12-24 20:35:26 +00:00
parent db21b77527
commit 763d9a15b9
5 changed files with 281 additions and 265 deletions

View file

@ -313,6 +313,8 @@ CEXEBuild::CEXEBuild()
build_last_page_define[0]=0;
ubuild_last_page_define[0]=0;
notify_hwnd=0;
}
int CEXEBuild::getcurdbsize() { return cur_datablock->getlen(); }
@ -1619,6 +1621,7 @@ int CEXEBuild::write_output(void)
{
char buffer[1024],*p;
GetFullPathName(build_output_filename,1024,buffer,&p);
notify(MAKENSIS_NOTIFY_OUTPUT, buffer);
INFO_MSG("\nOutput: \"%s\"\n",buffer);
}
FILE *fp = fopen(build_output_filename,"w+b");
@ -2133,6 +2136,7 @@ void CEXEBuild::warning(const char *s, ...)
vsprintf(buf,s,val);
va_end(val);
m_warnings.add(buf,-1);
notify(MAKENSIS_NOTIFY_WARNING,buf);
if (display_warnings)
{
fprintf(g_output,"warning: %s\n",buf);
@ -2142,15 +2146,19 @@ void CEXEBuild::warning(const char *s, ...)
void CEXEBuild::ERROR_MSG(const char *s, ...)
{
if (display_errors)
if (display_errors || notify_hwnd)
{
char buf[4096];
va_list val;
va_start(val,s);
vsprintf(buf,s,val);
va_end(val);
fprintf(g_output,"%s",buf);
fflush(g_output);
notify(MAKENSIS_NOTIFY_ERROR,buf);
if (display_errors)
{
fprintf(g_output,"%s",buf);
fflush(g_output);
}
}
}
@ -2197,6 +2205,15 @@ void CEXEBuild::print_warnings()
fflush(g_output);
}
void CEXEBuild::notify(int code, char *data)
{
if (notify_hwnd)
{
COPYDATASTRUCT cds = {(DWORD)code, strlen(data)+1, data};
SendMessage(notify_hwnd, WM_COPYDATA, 0, (LPARAM)&cds);
}
}
// Added by Ximon Eighteen 5th August 2002
#ifdef NSIS_CONFIG_PLUGIN_SUPPORT
void CEXEBuild::build_plugin_table(void)

View file

@ -41,6 +41,13 @@ extern "C"
#define PS_ERROR 50
#define IS_PS_ELSE(x) (( x ) >= PS_ELSE && ( x ) <= PS_ELSE_IF1)
enum {
MAKENSIS_NOTIFY_SCRIPT,
MAKENSIS_NOTIFY_WARNING,
MAKENSIS_NOTIFY_ERROR,
MAKENSIS_NOTIFY_OUTPUT
};
class CEXEBuild {
public:
CEXEBuild();
@ -75,6 +82,9 @@ class CEXEBuild {
int display_warnings;
int display_info;
HWND notify_hwnd;
void notify(int code, char *data);
private:
// tokens.cpp
int get_commandtoken(char *s, int *np, int *op);
@ -87,15 +97,14 @@ class CEXEBuild {
int do_add_file(const char *lgss, int attrib, int recurse, int linecnt, int *total_files, const char *name_override=0, int generatecode=1, int *data_handle=0);
GrowBuf m_linebuild; // used for concatenating lines
#ifdef NSIS_CONFIG_PLUGIN_SUPPORT
// Added by Amir Szekely 9th August 2002
int add_plugins_dir_initializer(void);
#endif //NSIS_CONFIG_PLUGIN_SUPPORT
void ERROR_MSG(const char *s, ...);
void SCRIPT_MSG(const char *s, ...);
void INFO_MSG(const char *s, ...);
#ifdef NSIS_CONFIG_PLUGIN_SUPPORT
int add_plugins_dir_initializer(void);
#endif //NSIS_CONFIG_PLUGIN_SUPPORT
// build.cpp functions used mostly by script.cpp
int getcurdbsize();
int add_section(const char *secname, const char *file, int line, const char *defname, int expand);