- Fixed bug #844989 - multiple uninstaller subsections problems

- Removed "(CVS)" from version number


git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3168 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2003-11-19 13:11:07 +00:00
parent 7fe6a9959d
commit 79a298aee3
4 changed files with 41 additions and 29 deletions

View file

@ -1165,7 +1165,12 @@ int CEXEBuild::add_section(const char *secname, const char *defname, int expand/
set_uninstall_mode(1);
}
if (subsection_open_cnt && !(new_section.flags & SF_SUBSECEND))
if ((new_section.flags & SF_SUBSECEND) && subsection_open_cnt && old_uninstall_mode)
{
set_uninstall_mode(1);
}
if (subsection_open_cnt)
{
if (uninstall_mode != old_uninstall_mode)
{
@ -1182,28 +1187,6 @@ int CEXEBuild::add_section(const char *secname, const char *defname, int expand/
cur_sections->add(&new_section, sizeof(section));
build_cursection = (section *) cur_sections->get() + cur_header->blocks[NB_SECTIONS].num;
if (new_section.flags & (SF_SUBSEC | SF_SUBSECEND))
{
if (new_section.flags & SF_SUBSECEND)
{
subsection_open_cnt--;
if (subsection_open_cnt < 0)
{
ERROR_MSG("SubSectionEnd: no SubSections are open\n");
return PS_ERROR;
}
if (!subsection_open_cnt)
set_uninstall_mode(0);
}
else
subsection_open_cnt++;
add_entry_direct(EW_RET);
build_cursection->code_size = 0;
build_cursection = 0;
}
if (defname[0])
{
char buf[32];
@ -1217,6 +1200,30 @@ int CEXEBuild::add_section(const char *secname, const char *defname, int expand/
cur_header->blocks[NB_SECTIONS].num++;
if (new_section.flags & (SF_SUBSEC | SF_SUBSECEND))
{
add_entry_direct(EW_RET);
build_cursection->code_size = 0;
build_cursection = 0;
if (new_section.flags & SF_SUBSECEND)
{
subsection_open_cnt--;
if (subsection_open_cnt < 0)
{
ERROR_MSG("SubSectionEnd: no SubSections are open\n");
return PS_ERROR;
}
if (!subsection_open_cnt)
{
set_uninstall_mode(0);
}
}
else
subsection_open_cnt++;
}
return PS_OK;
}