use new components functions so SetCurInstType will take affect immediately and so setting a section group's flags will affect its children too
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3856 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
c73d4d43b4
commit
d8225671ad
2 changed files with 38 additions and 31 deletions
|
@ -5,6 +5,7 @@
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "state.h"
|
#include "state.h"
|
||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
|
#include "components.h"
|
||||||
#include "exec.h"
|
#include "exec.h"
|
||||||
#include "lang.h"
|
#include "lang.h"
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
|
@ -161,10 +162,6 @@ static int NSISCALL ExecuteEntry(entry *entry_)
|
||||||
//char *var4;
|
//char *var4;
|
||||||
//char *var5;
|
//char *var5;
|
||||||
|
|
||||||
#ifdef NSIS_CONFIG_COMPONENTPAGE
|
|
||||||
HWND hwSectionHack = g_SectionHack;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT
|
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT
|
||||||
// Saves 8 bytes
|
// Saves 8 bytes
|
||||||
HWND mainHwnd = g_hwnd;
|
HWND mainHwnd = g_hwnd;
|
||||||
|
@ -1483,13 +1480,13 @@ static int NSISCALL ExecuteEntry(entry *entry_)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// setting text, send the message to do it
|
// setting text, send the message to do it
|
||||||
SendMessage(hwSectionHack,WM_NOTIFY_SECTEXT,x,parm1);
|
SendMessage(g_SectionHack,WM_NOTIFY_SECTEXT,x,parm1);
|
||||||
}
|
}
|
||||||
((int*)sec)[parm2]=parm1;
|
((int*)sec)[parm2]=parm1;
|
||||||
if (parm2)
|
|
||||||
|
if (parm3) // update flags
|
||||||
{
|
{
|
||||||
// update tree view
|
SectionFlagsChanged(x);
|
||||||
SendMessage(hwSectionHack,WM_NOTIFY_SECFLAGS,x,0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1498,22 +1495,32 @@ static int NSISCALL ExecuteEntry(entry *entry_)
|
||||||
break;
|
break;
|
||||||
case EW_INSTTYPESET:
|
case EW_INSTTYPESET:
|
||||||
{
|
{
|
||||||
int x=GetIntFromParm(0);
|
int x = GetIntFromParm(0);
|
||||||
|
|
||||||
if (parm3)
|
if ((unsigned int)x < (unsigned int)NSIS_MAX_INST_TYPES)
|
||||||
{
|
{
|
||||||
g_exec_flags.insttype_changed++;
|
if (parm3) // current install type
|
||||||
SendMessage(hwSectionHack,WM_NOTIFY_INSTTYPE_CHANGE,0,0);
|
|
||||||
}
|
|
||||||
else if ((unsigned int)x < (unsigned int)NSIS_MAX_INST_TYPES)
|
|
||||||
{
|
|
||||||
if (parm2) // set text
|
|
||||||
{
|
{
|
||||||
g_header->install_types[x] = parm1;
|
if (parm2) // set install type
|
||||||
|
{
|
||||||
|
SetInstType(x);
|
||||||
|
RefreshSectionGroups(0);
|
||||||
|
}
|
||||||
|
else // get install type
|
||||||
|
{
|
||||||
|
myitoa(var1, GetInstType(0));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else // get text
|
else // install type text
|
||||||
{
|
{
|
||||||
GetNSISString(var1,g_header->install_types[x]);
|
if (parm2) // set text
|
||||||
|
{
|
||||||
|
g_header->install_types[x] = parm1;
|
||||||
|
}
|
||||||
|
else // get text
|
||||||
|
{
|
||||||
|
GetNSISString(var1,g_header->install_types[x]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else exec_error++;
|
else exec_error++;
|
||||||
|
|
|
@ -5210,6 +5210,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
||||||
ent.offsets[0]=add_string(line.gettoken_str(1));
|
ent.offsets[0]=add_string(line.gettoken_str(1));
|
||||||
ent.offsets[1]=add_string(line.gettoken_str(2));
|
ent.offsets[1]=add_string(line.gettoken_str(2));
|
||||||
ent.offsets[2]=SECTION_FIELD_SET(flags);
|
ent.offsets[2]=SECTION_FIELD_SET(flags);
|
||||||
|
ent.offsets[3]=1;
|
||||||
SCRIPT_MSG("SectionSetFlags: %s->%s\n",line.gettoken_str(1),line.gettoken_str(2));
|
SCRIPT_MSG("SectionSetFlags: %s->%s\n",line.gettoken_str(1),line.gettoken_str(2));
|
||||||
return add_entry(&ent);
|
return add_entry(&ent);
|
||||||
case TOK_SECTIONGETFLAGS:
|
case TOK_SECTIONGETFLAGS:
|
||||||
|
@ -5266,19 +5267,19 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
||||||
SCRIPT_MSG("SectionGetSize: %s->%s\n",line.gettoken_str(1),line.gettoken_str(2));
|
SCRIPT_MSG("SectionGetSize: %s->%s\n",line.gettoken_str(1),line.gettoken_str(2));
|
||||||
return add_entry(&ent);
|
return add_entry(&ent);
|
||||||
case TOK_SETCURINSTTYPE:
|
case TOK_SETCURINSTTYPE:
|
||||||
{
|
ent.which=EW_INSTTYPESET;
|
||||||
int ret;
|
ent.offsets[0]=add_string(line.gettoken_str(1));
|
||||||
|
ent.offsets[1]=0;
|
||||||
|
ent.offsets[2]=1;
|
||||||
|
ent.offsets[3]=1;
|
||||||
SCRIPT_MSG("SetCurInstType: %s\n",line.gettoken_str(1));
|
SCRIPT_MSG("SetCurInstType: %s\n",line.gettoken_str(1));
|
||||||
ret = add_entry_direct(EW_SETFLAG, FLAG_OFFSET(cur_insttype), add_string(line.gettoken_str(1)));
|
return add_entry(&ent);
|
||||||
if (ret != PS_OK) return ret;
|
|
||||||
ret = add_entry_direct(EW_INSTTYPESET, 0, 0, 0, 1);
|
|
||||||
if (ret != PS_OK) return ret;
|
|
||||||
}
|
|
||||||
return PS_OK;
|
|
||||||
case TOK_GETCURINSTTYPE:
|
case TOK_GETCURINSTTYPE:
|
||||||
ent.which=EW_GETFLAG;
|
ent.which=EW_INSTTYPESET;
|
||||||
ent.offsets[0]=GetUserVarIndex(line, 1);
|
ent.offsets[0]=0;
|
||||||
ent.offsets[1]=FLAG_OFFSET(cur_insttype);
|
ent.offsets[1]=GetUserVarIndex(line,1);
|
||||||
|
ent.offsets[2]=0;
|
||||||
|
ent.offsets[3]=1;
|
||||||
if (line.gettoken_str(1)[0] && ent.offsets[0]<0) PRINTHELP()
|
if (line.gettoken_str(1)[0] && ent.offsets[0]<0) PRINTHELP()
|
||||||
SCRIPT_MSG("GetCurInstType: %s\n",line.gettoken_str(1));
|
SCRIPT_MSG("GetCurInstType: %s\n",line.gettoken_str(1));
|
||||||
return add_entry(&ent);
|
return add_entry(&ent);
|
||||||
|
@ -5296,7 +5297,6 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
||||||
ERROR_MSG("Error: %s specified, NSIS_CONFIG_COMPONENTPAGE not defined.\n", line.gettoken_str(0));
|
ERROR_MSG("Error: %s specified, NSIS_CONFIG_COMPONENTPAGE not defined.\n", line.gettoken_str(0));
|
||||||
return PS_ERROR;
|
return PS_ERROR;
|
||||||
#endif//!NSIS_CONFIG_COMPONENTPAGE
|
#endif//!NSIS_CONFIG_COMPONENTPAGE
|
||||||
// Added by Amir Szekely 29th July 2002
|
|
||||||
#ifdef NSIS_CONFIG_ENHANCEDUI_SUPPORT
|
#ifdef NSIS_CONFIG_ENHANCEDUI_SUPPORT
|
||||||
case TOK_SETBRANDINGIMAGE:
|
case TOK_SETBRANDINGIMAGE:
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue