diff --git a/Source/exehead/exec.c b/Source/exehead/exec.c index 4cd95d21..c21d740a 100644 --- a/Source/exehead/exec.c +++ b/Source/exehead/exec.c @@ -5,6 +5,7 @@ #include "util.h" #include "state.h" #include "ui.h" +#include "components.h" #include "exec.h" #include "lang.h" #include "resource.h" @@ -161,10 +162,6 @@ static int NSISCALL ExecuteEntry(entry *entry_) //char *var4; //char *var5; -#ifdef NSIS_CONFIG_COMPONENTPAGE - HWND hwSectionHack = g_SectionHack; -#endif - #ifdef NSIS_CONFIG_VISIBLE_SUPPORT // Saves 8 bytes HWND mainHwnd = g_hwnd; @@ -1483,13 +1480,13 @@ static int NSISCALL ExecuteEntry(entry *entry_) else { // 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; - if (parm2) + + if (parm3) // update flags { - // update tree view - SendMessage(hwSectionHack,WM_NOTIFY_SECFLAGS,x,0); + SectionFlagsChanged(x); } } } @@ -1498,22 +1495,32 @@ static int NSISCALL ExecuteEntry(entry *entry_) break; 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++; - SendMessage(hwSectionHack,WM_NOTIFY_INSTTYPE_CHANGE,0,0); - } - else if ((unsigned int)x < (unsigned int)NSIS_MAX_INST_TYPES) - { - if (parm2) // set text + if (parm3) // current install type { - 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++; diff --git a/Source/script.cpp b/Source/script.cpp index 50f3a981..6279b055 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -5210,6 +5210,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line) ent.offsets[0]=add_string(line.gettoken_str(1)); ent.offsets[1]=add_string(line.gettoken_str(2)); 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)); return add_entry(&ent); 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)); return add_entry(&ent); case TOK_SETCURINSTTYPE: - { - int ret; + ent.which=EW_INSTTYPESET; + 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)); - ret = add_entry_direct(EW_SETFLAG, FLAG_OFFSET(cur_insttype), add_string(line.gettoken_str(1))); - 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; + return add_entry(&ent); case TOK_GETCURINSTTYPE: - ent.which=EW_GETFLAG; - ent.offsets[0]=GetUserVarIndex(line, 1); - ent.offsets[1]=FLAG_OFFSET(cur_insttype); + ent.which=EW_INSTTYPESET; + ent.offsets[0]=0; + 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() SCRIPT_MSG("GetCurInstType: %s\n",line.gettoken_str(1)); 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)); return PS_ERROR; #endif//!NSIS_CONFIG_COMPONENTPAGE - // Added by Amir Szekely 29th July 2002 #ifdef NSIS_CONFIG_ENHANCEDUI_SUPPORT case TOK_SETBRANDINGIMAGE: {