diff --git a/Source/lang.cpp b/Source/lang.cpp index f21116b1..757f6c3a 100644 --- a/Source/lang.cpp +++ b/Source/lang.cpp @@ -613,7 +613,10 @@ NLF::NLF(char *filename) { // Check header if (strncmp(buf, "NLF v", 5)) throw runtime_error("Invalid language file!"); int nlf_version = atoi(buf+5); - if (atoi(buf+5) != NLF_VERSION) throw runtime_error("Language file version doesn't match NSIS version!"); + if (nlf_version != NLF_VERSION) { + if (nlf_version != 2) + throw runtime_error("Language file version doesn't match NSIS version!"); + } // Get language ID buf[0] = SkipComments(f); @@ -623,6 +626,13 @@ NLF::NLF(char *filename) { // Read strings for (int i = 0; i < NLF_STRINGS; i++) { buf[0] = SkipComments(f); + + if ((i == NLF_BTN_LICENSE_AGREE || i == NLF_BTN_LICENSE_DISAGREE) && nlf_version == 2) { + m_szStrings[i] = new char[1]; + m_szStrings[i][0] = 0; + continue; + } + fgets(buf+1, NSIS_MAX_STRLEN, f); if (lstrlen(buf) == NSIS_MAX_STRLEN-1) { wsprintf(buf, "String too long (string #%d)!", i); diff --git a/Source/tokens.cpp b/Source/tokens.cpp index be009c67..d2effd87 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,3,"[/LANG=lang_id] (checkbox|radiobuttons|off) accept_text decline_text"}, +{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"},