Fixed bug #769598 - problems with InstType /COMPONENTSONLYONCUSTOM

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2746 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2003-07-18 17:39:45 +00:00
parent b6d1a077d7
commit 4fbd8b1991
3 changed files with 12 additions and 11 deletions

View file

@ -1009,7 +1009,7 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
DeleteObject(hBMcheck1); DeleteObject(hBMcheck1);
for (i = 0; i < NSIS_MAX_INST_TYPES; i++) for (i = 0; i < NSIS_MAX_INST_TYPES+1; i++)
{ {
if (g_inst_header->install_types[i]) if (g_inst_header->install_types[i])
{ {
@ -1018,13 +1018,10 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
process_string_fromtab(g_tmp,g_inst_header->install_types[i]); process_string_fromtab(g_tmp,g_inst_header->install_types[i]);
j=SendMessage(hwndCombo1,CB_ADDSTRING,0,(LPARAM)ps_tmpbuf); j=SendMessage(hwndCombo1,CB_ADDSTRING,0,(LPARAM)ps_tmpbuf);
SendMessage(hwndCombo1,CB_SETITEMDATA,j,i); SendMessage(hwndCombo1,CB_SETITEMDATA,j,i);
if (i == g_flags.cur_insttype)
SendMessage(hwndCombo1, CB_SETCURSEL, j, 0);
} }
} }
if (!(inst_flags&CH_FLAGS_NO_CUSTOM))
{
int j=SendMessage(hwndCombo1,CB_ADDSTRING,0,(LPARAM)LANG_STR(LANG_COMP_CUSTOM));
SendMessage(hwndCombo1,CB_SETITEMDATA,j,NSIS_MAX_INST_TYPES);
}
if (doCombo) if (doCombo)
{ {
@ -1260,11 +1257,11 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
ExecuteCodeSegment(g_inst_header->code_onSelChange,NULL); ExecuteCodeSegment(g_inst_header->code_onSelChange,NULL);
#endif//NSIS_SUPPORT_CODECALLBACKS && NSIS_CONFIG_COMPONENTPAGE #endif//NSIS_SUPPORT_CODECALLBACKS && NSIS_CONFIG_COMPONENTPAGE
if (inst_flags&CH_FLAGS_COMP_ONLY_ON_CUSTOM) if (inst_flags & CH_FLAGS_COMP_ONLY_ON_CUSTOM)
{ {
int c=(g_flags.cur_insttype == NSIS_MAX_INST_TYPES)<<3;// SW_SHOWNA=8, SW_HIDE=0 int c = (g_flags.cur_insttype == NSIS_MAX_INST_TYPES) << 3;// SW_SHOWNA=8, SW_HIDE=0
ShowWindow(hwndTree1,c); ShowWindow(hwndTree1, c);
ShowWindow(GetUIItem(IDC_TEXT2),c); ShowWindow(GetUIItem(IDC_TEXT2), c);
} }
else if (!lParam) else if (!lParam)
{ {

View file

@ -390,7 +390,7 @@ typedef struct
int install_reg_key_ptr, install_reg_value_ptr; int install_reg_key_ptr, install_reg_value_ptr;
#ifdef NSIS_CONFIG_COMPONENTPAGE #ifdef NSIS_CONFIG_COMPONENTPAGE
int install_types[NSIS_MAX_INST_TYPES]; int install_types[NSIS_MAX_INST_TYPES+1];
#endif #endif
#ifdef NSIS_CONFIG_LICENSEPAGE #ifdef NSIS_CONFIG_LICENSEPAGE

View file

@ -4,6 +4,7 @@
#include "build.h" #include "build.h"
#include "DialogTemplate.h" #include "DialogTemplate.h"
#include "exehead\resource.h" #include "exehead\resource.h"
#include "exehead\lang.h"
extern const char *NSIS_VERSION; extern const char *NSIS_VERSION;
@ -432,6 +433,9 @@ void CEXEBuild::FillStringTable(StringTable *table, NLF *nlf/*=0*/) {
table->installer.componentsubtext[0]=add_string_main(str(NLF_COMP_SUBTEXT1),0); table->installer.componentsubtext[0]=add_string_main(str(NLF_COMP_SUBTEXT1),0);
if (!(build_header.common.flags&CH_FLAGS_NO_CUSTOM) && !table->installer.componentsubtext[1]) if (!(build_header.common.flags&CH_FLAGS_NO_CUSTOM) && !table->installer.componentsubtext[1])
table->installer.componentsubtext[1]=add_string_main(str(NLF_COMP_SUBTEXT2),0); table->installer.componentsubtext[1]=add_string_main(str(NLF_COMP_SUBTEXT2),0);
if (!(build_header.common.flags&CH_FLAGS_NO_CUSTOM))
build_header.install_types[NSIS_MAX_INST_TYPES] = LANG_COMP_CUSTOM;
} }
else table->installer.componenttext=0; else table->installer.componenttext=0;
} }