diff --git a/Source/build.cpp b/Source/build.cpp index 17b938a6..fe01bf4c 100644 --- a/Source/build.cpp +++ b/Source/build.cpp @@ -297,6 +297,9 @@ CEXEBuild::CEXEBuild() ubuild_custom_used=0; res_editor=0; + + build_last_page_define[0]=0; + ubuild_last_page_define[0]=0; } int CEXEBuild::getcurdbsize() { return cur_datablock->getlen(); } diff --git a/Source/build.h b/Source/build.h index 51c60c8c..0f1d0d1a 100644 --- a/Source/build.h +++ b/Source/build.h @@ -205,6 +205,8 @@ class CEXEBuild { StringList build_userlangstrings, ubuild_userlangstrings; GrowBuf build_pages, ubuild_pages; + char build_last_page_define[1024], ubuild_last_page_define[1024]; + int build_custom_used, ubuild_custom_used; MMapBuf build_datablock, ubuild_datablock; // use GrowBuf here instead of MMapBuf if you want diff --git a/Source/exehead/Ui.c b/Source/exehead/Ui.c index 97f07e06..35253184 100644 --- a/Source/exehead/Ui.c +++ b/Source/exehead/Ui.c @@ -526,7 +526,7 @@ nextPage: { process_string_fromtab( g_tmp+mystrlen(g_tmp), - this_page->caption // post_func contains the caption for custom functions + this_page->caption ); SetWindowText(hwndDlg,g_tmp); diff --git a/Source/script.cpp b/Source/script.cpp index b3436d94..0f3d3455 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -538,6 +538,8 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char p.postfunc = ns_func.add(line.gettoken_str(3),0); else p.caption = add_string_main(line.gettoken_str(3),0); + if (line.getnumtokens()>4) + lstrcpy(build_last_page_define, line.gettoken_str(4)); } #else ERROR_MSG("Error: Page callback specified, NSIS_CONFIG_LICENSEPAGE not defined.\n"); @@ -574,6 +576,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char p.id = NSIS_PAGE_DIR; break; case 4: + if (*build_last_page_define) definedlist.add(build_last_page_define,""); p.id = NSIS_PAGE_INSTFILES; break; default: @@ -636,6 +639,8 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char } else p.caption = add_string_uninst(line.gettoken_str(3),0); + if (line.getnumtokens()>4) + lstrcpy(ubuild_last_page_define, line.gettoken_str(4)); } #else ERROR_MSG("Error: UninstPage callback specified, NSIS_CONFIG_LICENSEPAGE not defined.\n"); @@ -656,6 +661,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char p.id = NSIS_PAGE_UNINST; break; case 2: + if (*ubuild_last_page_define) definedlist.add(ubuild_last_page_define,""); p.id = NSIS_PAGE_INSTFILES; break; default: diff --git a/Source/tokens.cpp b/Source/tokens.cpp index e03d991f..af145969 100644 --- a/Source/tokens.cpp +++ b/Source/tokens.cpp @@ -105,7 +105,7 @@ static tokenType tokenlist[TOK__LAST] = {TOK_NOP,"Nop",0,0,""}, {TOK_NAME,"Name",1,1,"[/LANG=lang_id] installer_name"}, {TOK_OUTFILE,"OutFile",1,0,"install_output.exe"}, -{TOK_PAGE,"Page",1,2,"(custom function [caption]) | ((license|components|directory|instfiles) [pre_function] [post_function])"}, +{TOK_PAGE,"Page",1,3,"(custom function [caption]) | ((license|components|directory|instfiles) [pre_function] [post_function])"}, {TOK_POP,"Pop",1,0,"$(user_var: output)"}, {TOK_PUSH,"Push",1,0,"string"}, {TOK_QUIT,"Quit",0,0,""}, @@ -157,7 +157,7 @@ static tokenType tokenlist[TOK__LAST] = {TOK_UNINSTALLEXENAME,"UninstallExeName",0,0,"no longer supported, use WriteUninstaller from section."}, {TOK_UNINSTCAPTION,"UninstallCaption",1,1,"[/LANG=lang_id] uninstaller_caption"}, {TOK_UNINSTICON,"UninstallIcon",1,0,"icon_on_local_system.ico"}, -{TOK_UNINSTPAGE,"UninstPage",1,2,"(custom function [caption]) | ((uninstConfirm|instfiles) [pre_function] [post_function])"}, +{TOK_UNINSTPAGE,"UninstPage",1,3,"(custom function [caption]) | ((uninstConfirm|instfiles) [pre_function] [post_function])"}, {TOK_UNINSTTEXT,"UninstallText",1,2,"[/LANG=lang_id] Text_to_go_on_uninstall page [subtext]"}, {TOK_UNINSTSUBCAPTION,"UninstallSubCaption",2,1,"[/LANG=lang_id] page_number(0-2) new_subcaption"}, {TOK_UNREGDLL,"UnRegDLL",1,0,"dll_path_on_target.dll"},