From 586bbd99d1d36543048299007d7af39001e9d740 Mon Sep 17 00:00:00 2001 From: kichik Date: Wed, 26 Mar 2003 18:04:03 +0000 Subject: [PATCH] An option to change the text in the script git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2363 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/script.cpp | 20 +++++++++++++++++++- Source/tokens.cpp | 2 +- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/Source/script.cpp b/Source/script.cpp index cb4b2d00..68f0dbda 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -1062,8 +1062,25 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char return make_sure_not_in_secorfunc(line.gettoken_str(0)); case TOK_LICENSEFORCESELECTION: { - int k=line.gettoken_enum(1,"off\0checkbox\0radiobuttons\0"); + LANGID lang = 0; + int a = 0; + + if (!strnicmp(line.gettoken_str(1),"/LANG=",6)) { + lang=atoi(line.gettoken_str(1)+6); + a++; + } + + int k=line.gettoken_enum(1+a,"off\0checkbox\0radiobuttons\0"); if (k == -1) PRINTHELP() + if (k < line.getnumtokens() - 2 - a) PRINTHELP() + + switch (line.getnumtokens()-a) { + case 4: + SetString(line.gettoken_str(3+a), NLF_BTN_LICENSE_DISAGREE, 0, lang); + case 3: + SetString(line.gettoken_str(2+a), NLF_BTN_LICENSE_AGREE, 0, lang); + break; + } try { init_res_editor(); @@ -1154,6 +1171,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char ERROR_MSG("Error setting smooth progress bar: %s\n", err.what()); return PS_ERROR; } + SCRIPT_MSG("LicenseForceSelection: %s \"%s\" \"%s\"\n", line.gettoken_str(1+a), line.gettoken_str(2+a), line.gettoken_str(3+a)); } return make_sure_not_in_secorfunc(line.gettoken_str(0)); case TOK_LICENSEBKCOLOR: diff --git a/Source/tokens.cpp b/Source/tokens.cpp index 4f70de92..be009c67 100644 --- a/Source/tokens.cpp +++ b/Source/tokens.cpp @@ -97,7 +97,7 @@ static tokenType tokenlist[TOK__LAST] = {TOK_LANGSTRING,"LangString",3,0,"[un.]name lang_id string"}, {TOK_LANGSTRINGUP,"LangStringUP",3,0,"[un.]name lang_id string"}, {TOK_LICENSEDATA,"LicenseData",1,1,"[/LANG=lang_id] local_file_that_has_license_text.txt"}, -{TOK_LICENSEFORCESELECTION,"LicenseForceSelection",1,0,"checkbox|radiobuttons|off"}, +{TOK_LICENSEFORCESELECTION,"LicenseForceSelection",1,3,"[/LANG=lang_id] (checkbox|radiobuttons|off) accept_text decline_text"}, {TOK_LICENSETEXT,"LicenseText",1,2,"[/LANG=lang_id] license_page_description [license_button_text]"}, {TOK_LICENSEBKCOLOR,"LicenseBkColor",1,0,"background_color"}, {TOK_LOADNLF,"LoadLanguageFile",1,0,"language.nlf"},