From d13fbec6dfba18f7f7354567c916eeb1620a3314 Mon Sep 17 00:00:00 2001 From: Anders Date: Wed, 16 Oct 2024 20:10:03 +0000 Subject: [PATCH] LicenseBkColor in the uninstaller (bug #1314) git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7442 212acab6-be3b-0410-9dea-997c60f758d6 --- Docs/src/history.but | 2 ++ Source/script.cpp | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Docs/src/history.but b/Docs/src/history.but index 3a5b610945..a6e4e99b84 100644 --- a/Docs/src/history.but +++ b/Docs/src/history.but @@ -14,6 +14,8 @@ Workgroups party? The end of 16-bit? \b Support setting source file decoding charset with magic comment (\W{http://sf.net/p/nsis/patches/292}{patch #292}) +\b Fixed LicenseBkColor for uninstaller (\W{http://sf.net/p/nsis/bugs/1314}{bug #1314}) + \b Handle CHARSET command line parameter in MakeNSISW (\W{http://sf.net/p/nsis/patches/315}{patch #315}) \b Make System/Resource.dll reproducible (\W{http://sf.net/p/nsis/patches/312}{patch #312}) diff --git a/Source/script.cpp b/Source/script.cpp index 820babdfea..9de0e1e381 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -1573,25 +1573,26 @@ int CEXEBuild::doCommand(int which_token, LineParser &line) return PS_OK; case TOK_LICENSEBKCOLOR: { - const TCHAR *cmdname = _T("LicenseBkColor"); - TCHAR *p = line.gettoken_str(1); - if (!_tcsicmp(p,_T("/windows"))) + const TCHAR *cmdname = _T("LicenseBkColor"), *paramname; + TCHAR *p = line.gettoken_str(1), *p2; + if (!_tcsicmp(p,paramname = _T("/windows")) || !_tcsicmp(p,_T("/window"))) { build_header.license_bg=-COLOR_WINDOW; - SCRIPT_MSG(_T("%") NPRIs _T(": /windows\n"),cmdname); + SCRIPT_MSG(_T("%") NPRIs _T(": %") NPRIs _T("\n"),cmdname,paramname); } - else if (!_tcsicmp(p,_T("/grey")) || !_tcsicmp(p,_T("/gray"))) + else if (!_tcsicmp(p,paramname = _T("/grey")) || !_tcsicmp(p,_T("/gray"))) { - build_header.license_bg=-COLOR_BTNFACE; - SCRIPT_MSG(_T("%") NPRIs _T(": /grey\n"),cmdname); + build_header.license_bg=-COLOR_BTNFACE; /* Note: This might not actually be gray */ + SCRIPT_MSG(_T("%") NPRIs _T(": %") NPRIs _T("\n"),cmdname,paramname); } else { - const int v=_tcstoul(p,&p,16); + const int v=_tcstoul(p,&p2,16); + if (p2 == p) return PS_ERROR; build_header.license_bg=((v&0xff)<<16)|(v&0xff00)|((v&0xff0000)>>16); - build_uninst.license_bg=build_header.license_bg; SCRIPT_MSG(_T("%") NPRIs _T(": %06X\n"),cmdname,v); } + build_uninst.license_bg=build_header.license_bg; } return PS_OK; #else