From 1a865438f00c7461b7b3ef0d6edcba5d4a6df716 Mon Sep 17 00:00:00 2001 From: kichik Date: Mon, 25 Nov 2002 16:50:05 +0000 Subject: [PATCH] Next button text is now always added when needed, instfiles dialog is destroyed when needed. git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1832 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/build.cpp | 28 +++++++++++++++++----------- Source/build.h | 2 ++ Source/exehead/Ui.c | 5 ++++- Source/lang.cpp | 10 ++++------ 4 files changed, 27 insertions(+), 18 deletions(-) diff --git a/Source/build.cpp b/Source/build.cpp index 235330dc..6f96b3fe 100644 --- a/Source/build.cpp +++ b/Source/build.cpp @@ -1171,16 +1171,6 @@ int CEXEBuild::write_output(void) } } -#ifdef NSIS_CONFIG_PLUGIN_SUPPORT - // Added by Amir Szekely 9th August 2002 - int err=add_plugins_dir_initializer(); - if (err != PS_OK) - return err; -#endif //NSIS_CONFIG_PLUGIN_SUPPORT - - // Added by Amir Szekely 3rd August 2002 - if (WriteStringTables() == PS_ERROR) return PS_ERROR; - if (!build_entries.getlen()) { ERROR_MSG("Error: invalid script: no entries specified\n"); @@ -1206,6 +1196,13 @@ int CEXEBuild::write_output(void) return 1; } +#ifdef NSIS_CONFIG_PLUGIN_SUPPORT + // Added by Amir Szekely 9th August 2002 + int err=add_plugins_dir_initializer(); + if (err != PS_OK) + return err; +#endif //NSIS_CONFIG_PLUGIN_SUPPORT + #ifdef NSIS_CONFIG_UNINSTALL_SUPPORT if (ubuild_entries.getlen()) { @@ -1374,8 +1371,10 @@ int CEXEBuild::write_output(void) p->next=LANG_BTN_NEXT; - if (iid==NSIS_PAGE_INSTFILES) + if (iid==NSIS_PAGE_INSTFILES) { p->next=LANG_BTN_INSTALL; + install_used = true; + } #ifdef NSIS_CONFIG_LICENSEPAGE if (p->id==NSIS_PAGE_LICENSE) p->next=LANG_BTN_LICENSE; @@ -1384,6 +1383,8 @@ int CEXEBuild::write_output(void) p->back&=~2; if (i && (p-1)->id==NSIS_PAGE_COMPLETED) p->back&=~2; + + if (p->next == LANG_BTN_NEXT) next_used = true; } (--p)->next=LANG_BTN_CLOSE; if (p->id==NSIS_PAGE_COMPLETED) (--p)->next=LANG_BTN_CLOSE; @@ -1458,6 +1459,8 @@ int CEXEBuild::write_output(void) } if (p->id==NSIS_PAGE_INSTFILES || p->id==NSIS_PAGE_COMPLETED) p->back=noinstlogback?0:SW_SHOWNA; + + if (p->next == LANG_BTN_NEXT) next_used = true; } (--p)->next=LANG_BTN_CLOSE; if (p->id==NSIS_PAGE_COMPLETED) (--p)->next=LANG_BTN_CLOSE; @@ -1519,6 +1522,9 @@ int CEXEBuild::write_output(void) return PS_ERROR; } + // Generate language tables + if (WriteStringTables() == PS_ERROR) return PS_ERROR; + // Pack exe header if asked for if (build_packname[0] && build_packcmd[0]) { diff --git a/Source/build.h b/Source/build.h index 02764368..b7e96bf7 100644 --- a/Source/build.h +++ b/Source/build.h @@ -149,6 +149,8 @@ class CEXEBuild { #define IsSet(s,lang) _IsSet(string_tables.size()?&(string_tables[0]->s):0,lang) bool _IsSet(int *str, LANGID lang); // Checks if a string is set in a given string table + bool next_used, install_used; + // a whole bunch O data. // Added by Amir Szekely 31st July 2002 diff --git a/Source/exehead/Ui.c b/Source/exehead/Ui.c index f4c2dfa4..d39b9eb1 100644 --- a/Source/exehead/Ui.c +++ b/Source/exehead/Ui.c @@ -537,7 +537,10 @@ nextPage: EnableWindow(m_hwndOK,1); if (this_page->id!=NSIS_PAGE_COMPLETED) DestroyWindow(m_curwnd); - else if (g_autoclose) goto nextPage; + else { + if (g_autoclose) goto nextPage; + return 0; + } mystrcpy(g_tmp,g_caption); process_string_fromtab(g_tmp+mystrlen(g_tmp),this_page->caption); diff --git a/Source/lang.cpp b/Source/lang.cpp index d7561f20..7f055636 100644 --- a/Source/lang.cpp +++ b/Source/lang.cpp @@ -399,14 +399,12 @@ void CEXEBuild::FillDefaultsIfNeeded(StringTable *table, NLF *nlf/*=0*/) { { if (!table->installer.spacerequired && !no_space_texts) table->installer.spacerequired=add_string_main(str(NLF_SPACE_REQ),0); } - if (table->installer.text -#ifdef NSIS_CONFIG_COMPONENTPAGE - || table->installer.componenttext -#endif - || build_custom_used || ubuild_custom_used - ) + if (next_used) { if (!table->common.nextbutton) table->common.nextbutton=add_string_main(str(NLF_BTN_NEXT),0); + } + if (install_used) + { if (!table->installer.installbutton) table->installer.installbutton=add_string_main(str(NLF_BTN_INSTALL),0); }