summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorDidier Raboud <odyx@debian.org>2018-03-31 20:38:18 +0200
committerDidier Raboud <odyx@debian.org>2018-03-31 20:38:18 +0200
commit59c41c0897494001ced424157660d4ee59bb5426 (patch)
treee45bf4b81a685aa86735244d6fc7716b0fcaf9a2 /Source
parent13406335997bbe6a887c9b30dcd58df39b83b44e (diff)
Import Upstream version 2.31
Diffstat (limited to 'Source')
-rwxr-xr-xSource/build.cpp2
-rwxr-xr-xSource/exehead/Ui.c8
-rwxr-xr-xSource/exehead/exec.c34
-rwxr-xr-xSource/exehead/exec.h1
-rwxr-xr-xSource/exehead/fileform.c4
-rwxr-xr-xSource/exehead/fileform.h1
-rwxr-xr-xSource/exehead/ui.h1
-rwxr-xr-xSource/script.cpp49
-rwxr-xr-xSource/tokens.cpp2
9 files changed, 45 insertions, 57 deletions
diff --git a/Source/build.cpp b/Source/build.cpp
index a335c08..b9caba1 100755
--- a/Source/build.cpp
+++ b/Source/build.cpp
@@ -3216,7 +3216,7 @@ again:
zero_offset=add_string("$0");
// SetDetailsPrint none
- ret=add_entry_direct(EW_UPDATETEXT, 0, 16);
+ ret=add_entry_direct(EW_SETFLAG, FLAG_OFFSET(status_update), add_intstring(6));
if (ret != PS_OK) return ret;
// StrCmp $PLUGINSDIR ""
diff --git a/Source/exehead/Ui.c b/Source/exehead/Ui.c
index c1c89f5..65f5f5f 100755
--- a/Source/exehead/Ui.c
+++ b/Source/exehead/Ui.c
@@ -1450,15 +1450,13 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
#endif//NSIS_CONFIG_VISIBLE_SUPPORT
-int ui_st_updateflag=0x6;
-
void NSISCALL update_status_text(int strtab, const char *text) {
static char tmp[NSIS_MAX_STRLEN*2];
LVITEM new_item;
HWND linsthwnd = insthwnd;
if (linsthwnd)
{
- int updateflag = ui_st_updateflag;
+ int updateflag = g_exec_flags.status_update;
int tmplen;
if (!(updateflag & 1))
@@ -1472,8 +1470,8 @@ void NSISCALL update_status_text(int strtab, const char *text) {
mystrcat(tmp, text);
}
- if ((updateflag & 4)) my_SetWindowText(insthwnd2, tmp);
- if ((updateflag & 2))
+ if ((updateflag & 4) == 0) my_SetWindowText(insthwnd2, tmp);
+ if ((updateflag & 2) == 0)
{
new_item.mask = LVIF_TEXT;
new_item.pszText = tmp;
diff --git a/Source/exehead/exec.c b/Source/exehead/exec.c
index d4adab4..3b22e29 100755
--- a/Source/exehead/exec.c
+++ b/Source/exehead/exec.c
@@ -42,6 +42,7 @@ static stack_t *g_st;
#endif
exec_flags g_exec_flags;
+exec_flags g_exec_flags_last_used;
struct {
exec_flags *flags;
@@ -258,23 +259,8 @@ static int NSISCALL ExecuteEntry(entry *entry_)
return ExecuteCodeSegment(v,NULL);
}
case EW_UPDATETEXT:
- {
- static int old_st_updateflag=6;
- if (parm2)
- {
- ui_st_updateflag=old_st_updateflag;
- }
- else if (parm1)
- {
- old_st_updateflag=ui_st_updateflag;
- ui_st_updateflag=parm1;
- }
- else
- {
- log_printf2("detailprint: %s",GetStringFromParm(0x00));
- update_status_text(parm0,0);
- }
- }
+ log_printf2("detailprint: %s",GetStringFromParm(0x00));
+ update_status_text(parm0,0);
break;
case EW_SLEEP:
{
@@ -290,7 +276,15 @@ static int NSISCALL ExecuteEntry(entry *entry_)
break;
#endif//NSIS_CONFIG_VISIBLE_SUPPORT
case EW_SETFLAG:
- FIELDN(g_exec_flags,parm0)=GetIntFromParm(1);
+ if (!parm2)
+ {
+ FIELDN(g_exec_flags_last_used,parm0)=FIELDN(g_exec_flags,parm0);
+ FIELDN(g_exec_flags,parm0)=GetIntFromParm(1);
+ }
+ else
+ {
+ FIELDN(g_exec_flags,parm0)=FIELDN(g_exec_flags_last_used,parm0);
+ }
break;
case EW_IFFLAG:
{
@@ -513,9 +507,9 @@ static int NSISCALL ExecuteEntry(entry *entry_)
update_status_text(LANG_EXTRACT,buf3);
{
- ui_st_updateflag++;
+ g_exec_flags.status_update++;
ret=GetCompressedDataFromDataBlock(parm2,hOut);
- ui_st_updateflag--;
+ g_exec_flags.status_update--;
}
log_printf3("File: wrote %d to \"%s\"",ret,buf0);
diff --git a/Source/exehead/exec.h b/Source/exehead/exec.h
index dd9368b..b49b91d 100755
--- a/Source/exehead/exec.h
+++ b/Source/exehead/exec.h
@@ -18,6 +18,7 @@
#define _EXEC_H_
extern exec_flags g_exec_flags;
+extern exec_flags g_exec_flags_last_used;
int NSISCALL ExecuteCodeSegment(int pos, HWND hwndProgress); // returns 0 on success
int NSISCALL ExecuteCallbackFunction(int num); // returns 0 on success
diff --git a/Source/exehead/fileform.c b/Source/exehead/fileform.c
index 5c6a234..43f7706 100755
--- a/Source/exehead/fileform.c
+++ b/Source/exehead/fileform.c
@@ -96,7 +96,7 @@ BOOL CALLBACK verProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
}
#ifdef NSIS_COMPRESS_WHOLE
- if (ui_st_updateflag & 1)
+ if (g_exec_flags.status_update & 1)
{
wsprintf(bt, "... %d%%", percent);
update_status_text(0, bt);
@@ -367,7 +367,7 @@ int NSISCALL _dodecomp(int offset, HANDLE hFileOut, char *outbuf, int outbuflen)
u=(char*)g_inflate_stream.next_out - outbuffer;
tc = GetTickCount();
- if (ui_st_updateflag & 1 && (tc - ltc > 200 || !input_len))
+ if (g_exec_flags.status_update & 1 && (tc - ltc > 200 || !input_len))
{
wsprintf(progress, "... %d%%", MulDiv(input_len_total - input_len, 100, input_len_total));
update_status_text(0, progress);
diff --git a/Source/exehead/fileform.h b/Source/exehead/fileform.h
index f2c5d53..982be84 100755
--- a/Source/exehead/fileform.h
+++ b/Source/exehead/fileform.h
@@ -510,6 +510,7 @@ typedef struct
int rtl;
int errlvl;
int alter_reg_view;
+ int status_update;
} exec_flags;
#define FIELDN(x, y) (((int *)&x)[y])
diff --git a/Source/exehead/ui.h b/Source/exehead/ui.h
index d863ee1..9160e3d 100755
--- a/Source/exehead/ui.h
+++ b/Source/exehead/ui.h
@@ -22,7 +22,6 @@ extern int *cur_langtable;
extern int NSISCALL ui_doinstall(void);
void NSISCALL update_status_text(int strtab, const char *text2);
-extern int ui_st_updateflag;
extern int ui_dlg_visible;
extern HWND m_curwnd;
diff --git a/Source/script.cpp b/Source/script.cpp
index 25ebcdc..69144c3 100755
--- a/Source/script.cpp
+++ b/Source/script.cpp
@@ -3573,12 +3573,14 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
ent.which=EW_SETFLAG;
ent.offsets[0]=FLAG_OFFSET(alter_reg_view);
// "64" results in setting the flag to 1 which alters the view
- int k=line.gettoken_enum(1,"32\0" "64\0");
+ int k=line.gettoken_enum(1,"32\0" "64\0lastused\0");
if (k<0) PRINTHELP()
if (k == 0) // 32
ent.offsets[1]=add_intstring(0);
else if (k == 1) // 64
ent.offsets[1]=add_intstring(KEY_WOW64_64KEY);
+ else if (k == 2) // last used
+ ent.offsets[2]=1;
SCRIPT_MSG("SetRegView: %s\n",line.gettoken_str(1));
}
return add_entry(&ent);
@@ -4554,24 +4556,25 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
}
return add_entry(&ent);
case TOK_SETDETAILSPRINT:
- ent.which=EW_UPDATETEXT;
- ent.offsets[0] = 0;
- ent.offsets[1] = line.gettoken_enum(1,"lastused\0listonly\0textonly\0both\0none\0");
- if (ent.offsets[1] < 0) PRINTHELP();
- switch (ent.offsets[1]) {
- case 0:
- ent.offsets[2]=1;
- break;
- case 1:
- case 2:
- case 3:
- ent.offsets[1]<<=1;
- break;
- case 4:
- ent.offsets[1]=16;
- break;
+ {
+ ent.which=EW_SETFLAG;
+ ent.offsets[0]=FLAG_OFFSET(status_update);
+ int k=line.gettoken_enum(1,"both\0textonly\0listonly\0none\0lastused\0");
+ if (k<0) PRINTHELP()
+ if (k == 4)
+ {
+ ent.offsets[2]=1;
+ }
+ else
+ {
+ // both 0
+ // textonly 2
+ // listonly 4
+ // none 6
+ ent.offsets[1]=add_intstring(k*2);
}
SCRIPT_MSG("SetDetailsPrint: %s\n",line.gettoken_str(1));
+ }
return add_entry(&ent);
case TOK_SETAUTOCLOSE:
{
@@ -5701,11 +5704,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
}
// SetDetailsPrint lastused
- ent.which=EW_UPDATETEXT;
- ent.offsets[0]=0;
- ent.offsets[1]=0;
- ent.offsets[2]=1; // lastused
- ret=add_entry(&ent);
+ ret=add_entry_direct(EW_SETFLAG, FLAG_OFFSET(status_update), 0, 1);
if (ret != PS_OK) {
return ret;
}
@@ -5773,11 +5772,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
ret=add_entry(&ent);
if (ret != PS_OK) return ret;
// SetDetailsPrint lastused
- ent.which=EW_UPDATETEXT;
- ent.offsets[0]=0;
- ent.offsets[1]=0;
- ent.offsets[2]=1; // lastused
- ret=add_entry(&ent);
+ ret=add_entry_direct(EW_SETFLAG, FLAG_OFFSET(status_update), 0, 1);
if (ret != PS_OK) return ret;
}
return PS_OK;
diff --git a/Source/tokens.cpp b/Source/tokens.cpp
index 48a28c9..2f38aa7 100755
--- a/Source/tokens.cpp
+++ b/Source/tokens.cpp
@@ -194,7 +194,7 @@ static tokenType tokenlist[TOK__LAST] =
{TOK_SETOVERWRITE,"SetOverwrite",1,0,"on|off|try|ifnewer|ifdiff",TP_ALL},
{TOK_SETPLUGINUNLOAD,"SetPluginUnload",1,0,"(manual|alwaysoff)",TP_ALL},
{TOK_SETREBOOTFLAG,"SetRebootFlag",1,0,"true|false",TP_CODE},
-{TOK_SETREGVIEW,"SetRegView",1,0,"32|64",TP_CODE},
+{TOK_SETREGVIEW,"SetRegView",1,0,"32|64|lastused",TP_CODE},
{TOK_SETSHELLVARCONTEXT,"SetShellVarContext",1,0,"all|current",TP_CODE},
{TOK_SETSILENT,"SetSilent",1,0,"silent|normal",TP_CODE},
{TOK_SHOWDETAILS,"ShowInstDetails",1,0,"(hide|show|nevershow)",TP_GLOBAL},