Shaved off another 104 bytes of code.
exehead_bzip2 is now 37.5K. git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1057 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
24977f45d0
commit
0910f0dd75
3 changed files with 24 additions and 24 deletions
|
@ -399,7 +399,7 @@ int NSISCALL ui_doinstall(void)
|
|||
#ifdef NSIS_SUPPORT_CODECALLBACKS
|
||||
g_hwnd=m_bgwnd;
|
||||
// Select language
|
||||
if (ExecuteCodeSegment(g_inst_entry,g_inst_cmnheader->code_onInit,NULL)) return 1;
|
||||
if (ExecuteCodeSegment(g_inst_cmnheader->code_onInit,NULL)) return 1;
|
||||
set_language();
|
||||
g_hwnd=NULL;
|
||||
ShowWindow(m_bgwnd, SW_SHOW);
|
||||
|
@ -438,18 +438,18 @@ int NSISCALL ui_doinstall(void)
|
|||
#endif
|
||||
{
|
||||
#ifdef NSIS_SUPPORT_CODECALLBACKS
|
||||
if (ExecuteCodeSegment(g_inst_entry,g_inst_cmnheader->code_onInit,NULL)) return 1;
|
||||
if (ExecuteCodeSegment(g_inst_cmnheader->code_onInit,NULL)) return 1;
|
||||
set_language();
|
||||
#endif//NSIS_SUPPORT_CODECALLBACKS
|
||||
if (install_thread(NULL))
|
||||
{
|
||||
#ifdef NSIS_SUPPORT_CODECALLBACKS
|
||||
if (!g_quit_flag) ExecuteCodeSegment(g_inst_entry,g_inst_cmnheader->code_onInstFailed,NULL);
|
||||
if (!g_quit_flag) ExecuteCodeSegment(g_inst_cmnheader->code_onInstFailed,NULL);
|
||||
#endif//NSIS_SUPPORT_CODECALLBACKS
|
||||
return 1;
|
||||
}
|
||||
#ifdef NSIS_SUPPORT_CODECALLBACKS
|
||||
ExecuteCodeSegment(g_inst_entry,g_inst_cmnheader->code_onInstSuccess,NULL);
|
||||
ExecuteCodeSegment(g_inst_cmnheader->code_onInstSuccess,NULL);
|
||||
#endif//NSIS_SUPPORT_CODECALLBACKS
|
||||
|
||||
return 0;
|
||||
|
@ -538,7 +538,7 @@ static BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
|
|||
!((g_inst_cmnheader->misc_flags&2) &&
|
||||
is_valid_instpath(state_install_directory)
|
||||
#ifdef NSIS_SUPPORT_CODECALLBACKS
|
||||
&& !ExecuteCodeSegment(g_inst_entry,g_inst_header->code_onVerifyInstDir,NULL)
|
||||
&& !ExecuteCodeSegment(g_inst_header->code_onVerifyInstDir,NULL)
|
||||
#endif//NSIS_SUPPORT_CODECALLBACKS
|
||||
)) isdp++;
|
||||
}
|
||||
|
@ -549,7 +549,7 @@ static BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
|
|||
int count=1; // Number of pages to move by
|
||||
#ifdef NSIS_SUPPORT_CODECALLBACKS
|
||||
// Call onNext|PrevPage for every not-definitely-disabled page
|
||||
if (ExecuteCodeSegment(g_inst_entry,delta>0?g_inst_cmnheader->code_onNextPage:g_inst_header->code_onPrevPage,NULL))
|
||||
if (ExecuteCodeSegment(delta>0?g_inst_cmnheader->code_onNextPage:g_inst_header->code_onPrevPage,NULL))
|
||||
{
|
||||
if (g_quit_flag) // Quit instruction used?
|
||||
m_page=count=-1;
|
||||
|
@ -565,7 +565,7 @@ static BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
|
|||
} while ((m_page >= 0) && (m_page <= g_max_page) && (m_page==2 && !isdp));
|
||||
|
||||
#ifdef NSIS_SUPPORT_CODECALLBACKS
|
||||
if (m_page>g_max_page) ExecuteCodeSegment(g_inst_entry,g_inst_cmnheader->code_onInstSuccess,NULL);
|
||||
if (m_page>g_max_page) ExecuteCodeSegment(g_inst_cmnheader->code_onInstSuccess,NULL);
|
||||
#endif//NSIS_SUPPORT_CODECALLBACKS
|
||||
|
||||
if (m_curwnd && (m_page!=prev_page))
|
||||
|
@ -604,7 +604,7 @@ static BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
|
|||
ScreenToClient(hwndDlg,(LPPOINT)&r);
|
||||
SetWindowPos(m_curwnd,0,r.left,r.top,0,0,SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOZORDER);
|
||||
#ifdef NSIS_SUPPORT_CODECALLBACKS
|
||||
ExecuteCodeSegment(g_inst_entry,g_inst_cmnheader->code_onInitDialog,NULL);
|
||||
ExecuteCodeSegment(g_inst_cmnheader->code_onInitDialog,NULL);
|
||||
#endif //NSIS_SUPPORT_CODECALLBACKS
|
||||
SendMessage(m_curwnd, WM_NOTIFY_START, 0, 0);
|
||||
ShowWindow(m_curwnd,SW_SHOWNA);
|
||||
|
@ -648,14 +648,14 @@ static BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
|
|||
if (m_abort)
|
||||
{
|
||||
#ifdef NSIS_SUPPORT_CODECALLBACKS
|
||||
ExecuteCodeSegment(g_inst_entry,g_inst_cmnheader->code_onInstFailed,NULL);
|
||||
ExecuteCodeSegment(g_inst_cmnheader->code_onInstFailed,NULL);
|
||||
#endif//NSIS_SUPPORT_CODECALLBACKS
|
||||
EndDialog(hwndDlg,2);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef NSIS_SUPPORT_CODECALLBACKS
|
||||
if (!ExecuteCodeSegment(g_inst_entry,g_inst_cmnheader->code_onUserAbort,NULL))
|
||||
if (!ExecuteCodeSegment(g_inst_cmnheader->code_onUserAbort,NULL))
|
||||
#endif//NSIS_SUPPORT_CODECALLBACKS
|
||||
{
|
||||
EndDialog(hwndDlg,1);
|
||||
|
@ -907,7 +907,7 @@ static BOOL CALLBACK DirProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
|
|||
EnableWindow(GetDlgItem(g_hwnd,IDOK),
|
||||
is_valid_path && (available >= total || available == -1)
|
||||
#ifdef NSIS_SUPPORT_CODECALLBACKS
|
||||
&& !ExecuteCodeSegment(g_inst_entry,g_inst_header->code_onVerifyInstDir,NULL)
|
||||
&& !ExecuteCodeSegment(g_inst_header->code_onVerifyInstDir,NULL)
|
||||
#endif
|
||||
);
|
||||
}
|
||||
|
@ -966,7 +966,7 @@ static DWORD WINAPI newTreeWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l
|
|||
mystrcpy(g_tmp, g_usrvars[0]);
|
||||
|
||||
myitoa(g_usrvars[0], last_item);
|
||||
ExecuteCodeSegment(g_inst_entry,g_inst_header->code_onMouseOverSection,NULL);
|
||||
ExecuteCodeSegment(g_inst_header->code_onMouseOverSection,NULL);
|
||||
|
||||
mystrcpy(g_usrvars[0], g_tmp);
|
||||
}
|
||||
|
@ -1175,7 +1175,7 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
|
|||
{
|
||||
extern HWND g_SectionHack;
|
||||
g_SectionHack=hwndDlg;
|
||||
ExecuteCodeSegment(g_inst_entry,g_inst_header->code_onSelChange,NULL);
|
||||
ExecuteCodeSegment(g_inst_header->code_onSelChange,NULL);
|
||||
g_SectionHack=0;
|
||||
}
|
||||
#endif//NSIS_SUPPORT_CODECALLBACKS && NSIS_CONFIG_COMPONENTPAGE
|
||||
|
@ -1332,7 +1332,7 @@ static DWORD WINAPI install_thread(LPVOID p)
|
|||
#ifdef NSIS_CONFIG_UNINSTALL_SUPPORT
|
||||
if (g_is_uninstaller)
|
||||
{
|
||||
if (ExecuteCodeSegment(g_inst_entry,g_inst_uninstheader->code,g_progresswnd)) m_abort++;
|
||||
if (ExecuteCodeSegment(g_inst_uninstheader->code,g_progresswnd)) m_abort++;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1349,7 +1349,7 @@ static DWORD WINAPI install_thread(LPVOID p)
|
|||
#endif
|
||||
{
|
||||
log_printf2("Section: \"%s\"",GetStringFromStringTab(g_inst_section[m_inst_sec].name_ptr));
|
||||
if (ExecuteCodeSegment(g_inst_entry,g_inst_section[m_inst_sec].code,g_progresswnd)) m_abort++;
|
||||
if (ExecuteCodeSegment(g_inst_section[m_inst_sec].code,g_progresswnd)) m_abort++;
|
||||
}
|
||||
#ifdef NSIS_CONFIG_COMPONENTPAGE
|
||||
else
|
||||
|
|
|
@ -82,7 +82,7 @@ static LONG NSISCALL myRegDeleteKeyEx(HKEY thiskey, LPCTSTR lpSubKey, int onlyif
|
|||
|
||||
extern char g_all_user_var_flag;
|
||||
|
||||
static int NSISCALL ExecuteEntry(entry *entries, int pos);
|
||||
static int NSISCALL ExecuteEntry(entry *entry_);
|
||||
|
||||
static int NSISCALL resolveaddr(int v)
|
||||
{
|
||||
|
@ -90,13 +90,13 @@ static int NSISCALL resolveaddr(int v)
|
|||
return v;
|
||||
}
|
||||
|
||||
int NSISCALL ExecuteCodeSegment(entry *entries, int pos, HWND hwndProgress)
|
||||
int NSISCALL ExecuteCodeSegment(int pos, HWND hwndProgress)
|
||||
{
|
||||
while (pos >= 0)
|
||||
{
|
||||
int rv;
|
||||
if (entries[pos].which == EW_RET) return 0;
|
||||
rv=ExecuteEntry(entries,pos);
|
||||
if (g_inst_entry[pos].which == EW_RET) return 0;
|
||||
rv=ExecuteEntry(g_inst_entry + pos);
|
||||
if (rv == EXEC_ERROR) return EXEC_ERROR;
|
||||
|
||||
rv=resolveaddr(rv);
|
||||
|
@ -138,11 +138,11 @@ static void NSISCALL process_string_fromparm_tobuf(int id_)
|
|||
// returns EXEC_ERROR on error
|
||||
// returns 0, advance position by 1
|
||||
// otherwise, returns new_position+1
|
||||
static int NSISCALL ExecuteEntry(entry *entries, int pos)
|
||||
static int NSISCALL ExecuteEntry(entry *entry_)
|
||||
{
|
||||
// changed by Amir Szekely 28 August 2002
|
||||
// shaves off 0.5KB
|
||||
int parm0 = (parms = entries[pos].offsets)[0];
|
||||
int parm0 = (parms = entry_->offsets)[0];
|
||||
int parm1 = parms[1];
|
||||
int parm2 = parms[2];
|
||||
int parm3 = parms[3];
|
||||
|
@ -158,7 +158,7 @@ static int NSISCALL ExecuteEntry(entry *entries, int pos)
|
|||
char *buf1 = bufs[1];
|
||||
char *buf2 = bufs[2];
|
||||
char *buf3 = bufs[3];
|
||||
int which = entries[pos].which;
|
||||
int which = entry_->which;
|
||||
switch (which)
|
||||
{
|
||||
case EW_NOP:
|
||||
|
@ -179,7 +179,7 @@ static int NSISCALL ExecuteEntry(entry *entries, int pos)
|
|||
{
|
||||
int v=resolveaddr(parm0)-1; // address is -1, since we encode it as +1
|
||||
log_printf2("Call: %d",v);
|
||||
return ExecuteCodeSegment(entries,v,NULL);
|
||||
return ExecuteCodeSegment(v,NULL);
|
||||
}
|
||||
case EW_UPDATETEXT:
|
||||
if (parm1) ui_st_updateflag=parm1;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef _EXEC_H_
|
||||
#define _EXEC_H_
|
||||
|
||||
int NSISCALL ExecuteCodeSegment(entry *entries, int pos, HWND hwndProgress); // returns 0 on success
|
||||
int NSISCALL ExecuteCodeSegment(int pos, HWND hwndProgress); // returns 0 on success
|
||||
|
||||
|
||||
#endif//_EXEC_H_
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue