Fixes with uninstall plugins and custom pages

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1810 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2002-11-21 22:59:11 +00:00
parent f9da9e0964
commit 20e2277078
3 changed files with 11 additions and 13 deletions

View file

@ -639,6 +639,7 @@ int CEXEBuild::add_function(const char *funname)
if (!strnicmp(funname,"un.",3)) if (!strnicmp(funname,"un.",3))
{ {
SCRIPT_MSG("setting uninstall mode to true\n");
set_uninstall_mode(1); set_uninstall_mode(1);
} }
@ -1173,7 +1174,8 @@ int CEXEBuild::write_output(void)
#ifdef NSIS_CONFIG_PLUGIN_SUPPORT #ifdef NSIS_CONFIG_PLUGIN_SUPPORT
// Added by Amir Szekely 9th August 2002 // Added by Amir Szekely 9th August 2002
int err=add_plugins_dir_initializer(); int err=add_plugins_dir_initializer();
if (err != PS_OK) return err; if (err != PS_OK)
return err;
#endif //NSIS_CONFIG_PLUGIN_SUPPORT #endif //NSIS_CONFIG_PLUGIN_SUPPORT
// Added by Amir Szekely 3rd August 2002 // Added by Amir Szekely 3rd August 2002
@ -1444,7 +1446,7 @@ int CEXEBuild::write_output(void)
page *p=(page *) ubuild_pages.get(); page *p=(page *) ubuild_pages.get();
int noinstlogback=0; int noinstlogback=0;
for (int i=0; i<build_uninst.common.num_pages; i++, p++) { for (int i=0; i<build_uninst.common.num_pages; i++, p++) {
if (i) p->back=2; // 2 - enabled, 1 - disabled, 0 - invisible if (i) p->back=SW_SHOWNA|2; // 2 - enabled, SW_SHOWNA - visible, 0 - invisible (or'ed)
else p->back=0; else p->back=0;
p->next=LANG_BTN_NEXT; p->next=LANG_BTN_NEXT;
@ -1455,7 +1457,7 @@ int CEXEBuild::write_output(void)
p->next=LANG_BTN_UNINST; p->next=LANG_BTN_UNINST;
} }
if (p->id==NSIS_PAGE_INSTFILES || p->id==NSIS_PAGE_COMPLETED) if (p->id==NSIS_PAGE_INSTFILES || p->id==NSIS_PAGE_COMPLETED)
p->back=noinstlogback?0:1; p->back=noinstlogback?0:SW_SHOWNA;
} }
(--p)->next=LANG_BTN_CLOSE; (--p)->next=LANG_BTN_CLOSE;
if (p->id==NSIS_PAGE_COMPLETED) (--p)->next=LANG_BTN_CLOSE; if (p->id==NSIS_PAGE_COMPLETED) (--p)->next=LANG_BTN_CLOSE;
@ -2188,19 +2190,19 @@ void CEXEBuild::build_plugin_table(void)
int CEXEBuild::add_plugins_dir_initializer(void) int CEXEBuild::add_plugins_dir_initializer(void)
{ {
if (!plugin_used) return PS_OK; if (!plugin_used && !uninst_plugin_used) return PS_OK;
SCRIPT_MSG("Adding plug-ins initializing function... "); SCRIPT_MSG("Adding plug-ins initializing function... ");
bool uninstall = false; bool uninstall = !plugin_used;
int ret; int ret;
entry ent; entry ent;
int zero_offset; int zero_offset;
ret=add_function("Initialize_____Plugins");
if (ret != PS_OK) return ret;
again: again:
ret=add_function(uninstall?"un.Initialize_____Plugins":"Initialize_____Plugins");
if (ret != PS_OK) return ret;
// SetDetailsPrint none // SetDetailsPrint none
ent.which=EW_UPDATETEXT; ent.which=EW_UPDATETEXT;
ent.offsets[1]=4; // none ent.offsets[1]=4; // none
@ -2257,7 +2259,6 @@ again:
if (ret != PS_OK) return ret; if (ret != PS_OK) return ret;
if (uninst_plugin_used && !uninstall) { if (uninst_plugin_used && !uninstall) {
add_function("un.Initialize_____Plugins");
uninstall = true; uninstall = true;
goto again; goto again;
} }

View file

@ -582,11 +582,7 @@ nextPage:
{ {
outernotify(1); outernotify(1);
} }
if ( if (id == IDC_BACK && m_page>0)
#ifdef NSIS_CONFIG_UNINSTALL_SUPPORT
!g_is_uninstaller &&
#endif
(id == IDC_BACK && m_page>0))
{ {
outernotify(-1); outernotify(-1);
} }

View file

@ -706,6 +706,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char
ubuild_pages.add(&p,sizeof(page)); ubuild_pages.add(&p,sizeof(page));
build_uninst.common.num_pages++; build_uninst.common.num_pages++;
} }
SCRIPT_MSG("number of pages: %d\n", build_uninst.common.num_pages);
} }
return PS_OK; return PS_OK;
#else #else