- fixed a typo in inner langstrings name - [un]LicenseTextRB
- Finnish language files updated - made SetStlColors able to set background color with /BRANDING - some optimizations - fixed progress showing for WriteUninstaller git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2870 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
ff2ab1239f
commit
bb927a6230
10 changed files with 239 additions and 117 deletions
|
@ -108,10 +108,12 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam,
|
|||
#define END_OF_ARG(c) (((c)|' ')==' ')
|
||||
|
||||
#if defined(NSIS_CONFIG_VISIBLE_SUPPORT) && defined(NSIS_CONFIG_SILENT_SUPPORT)
|
||||
if (cmdline[0] == 'S' && END_OF_ARG(cmdline[1])) cl_flags |= FH_FLAGS_SILENT;
|
||||
if (cmdline[0] == 'S' && END_OF_ARG(cmdline[1]))
|
||||
cl_flags |= FH_FLAGS_SILENT;
|
||||
#endif//NSIS_CONFIG_SILENT_SUPPORT && NSIS_CONFIG_VISIBLE_SUPPORT
|
||||
#ifdef NSIS_CONFIG_CRC_SUPPORT
|
||||
if (*(DWORD*)cmdline == CHAR4_TO_DWORD('N','C','R','C') && END_OF_ARG(cmdline[4])) cl_flags |= FH_FLAGS_NO_CRC;
|
||||
if (*(DWORD*)cmdline == CHAR4_TO_DWORD('N','C','R','C') && END_OF_ARG(cmdline[4]))
|
||||
cl_flags |= FH_FLAGS_NO_CRC;
|
||||
#endif//NSIS_CONFIG_CRC_SUPPORT
|
||||
|
||||
if (*(WORD*)cmdline == CHAR2_TO_WORD('D','='))
|
||||
|
@ -135,7 +137,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam,
|
|||
char *p=cmdline;
|
||||
while (*p) p++;
|
||||
|
||||
while (p >= cmdline && (p[0] != '_' || p[1] != '?' || p[2] != '=')) p--;
|
||||
while (p >= cmdline && (p[0] != '_' || p[1] != '?' || p[2] != '=')) p--;
|
||||
|
||||
if (p >= cmdline)
|
||||
{
|
||||
|
|
|
@ -193,7 +193,7 @@ int NSISCALL ui_doinstall(void)
|
|||
if (e > p)
|
||||
{
|
||||
// if filename ends in .exe, and is not a directory, remove the filename
|
||||
if (*(int*)e == *(int*)".exe") // check extension
|
||||
if (*(int*)e == CHAR4_TO_DWORD('.', 'e', 'x', 'e')) // check extension
|
||||
{
|
||||
DWORD d;
|
||||
d=GetFileAttributes(p);
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
|
||||
#ifdef NSIS_SUPPORT_BGBG
|
||||
|
||||
#define c1 g_header->bg_color1
|
||||
#define c2 g_header->bg_color2
|
||||
#define c1 header->bg_color1
|
||||
#define c2 header->bg_color2
|
||||
|
||||
LRESULT CALLBACK BG_WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
|
@ -24,6 +24,8 @@ LRESULT CALLBACK BG_WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
}
|
||||
case WM_PAINT:
|
||||
{
|
||||
header *header = g_header;
|
||||
|
||||
PAINTSTRUCT ps;
|
||||
HDC hdc=BeginPaint(hwnd,&ps);
|
||||
RECT r;
|
||||
|
@ -49,7 +51,7 @@ LRESULT CALLBACK BG_WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
r.bottom+=4;
|
||||
}
|
||||
|
||||
if (g_header->bg_textcolor != -1)
|
||||
if (header->bg_textcolor != -1)
|
||||
{
|
||||
HFONT newFont, oldFont;
|
||||
newFont = CreateFont(40,0,0,0,FW_BOLD,TRUE,FALSE,FALSE,DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH,"Garamond");
|
||||
|
@ -60,7 +62,7 @@ LRESULT CALLBACK BG_WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
r.top=8;
|
||||
my_GetWindowText(hwnd,buf,sizeof(buf));
|
||||
SetBkMode(hdc,TRANSPARENT);
|
||||
SetTextColor(hdc,g_header->bg_textcolor);
|
||||
SetTextColor(hdc,header->bg_textcolor);
|
||||
oldFont = SelectObject(hdc,newFont);
|
||||
DrawText(hdc,buf,-1,&r,DT_TOP|DT_LEFT|DT_SINGLELINE|DT_NOPREFIX);
|
||||
SelectObject(hdc,oldFont);
|
||||
|
|
|
@ -343,7 +343,7 @@ int NSISCALL _dodecomp(int offset, HANDLE hFileOut, char *outbuf, int outbuflen)
|
|||
u=(char*)g_inflate_stream.next_out - outbuffer;
|
||||
|
||||
tc = GetTickCount();
|
||||
if (tc - ltc > 200 || !input_len)
|
||||
if (ui_st_updateflag & 1 && (tc - ltc > 200 || !input_len))
|
||||
{
|
||||
wsprintf(progress, "... %d%%", MulDiv(input_len_total - input_len, 100, input_len_total));
|
||||
update_status_text(0, progress);
|
||||
|
|
|
@ -54,10 +54,10 @@ struct {
|
|||
{"^Completed", "Completed", NONE_STATIC},
|
||||
{"^LicenseText", "Please review the license agreement before installing $(^Name). If you accept all terms of the agreement, click I Agree.", NONE_STATIC},
|
||||
{"^LicenseTextCB", "Please review the license agreement before installing $(^Name). If you accept all terms of the agreement, click the check box below. $_CLICK", NONE_STATIC},
|
||||
{"^LicesnseTextRB", "Please review the license agreement before installing $(^Name). If you accept all terms of the agreement, select the first option below. $_CLICK", NONE_STATIC},
|
||||
{"^LicenseTextRB", "Please review the license agreement before installing $(^Name). If you accept all terms of the agreement, select the first option below. $_CLICK", NONE_STATIC},
|
||||
{"^UnLicenseText", "Please review the license agreement before uninstalling $(^Name). If you accept all terms of the agreement, click I Agree.", NONE_STATIC},
|
||||
{"^UnLicenseTextCB", "Please review the license agreement before uninstalling $(^Name). If you accept all terms of the agreement, click the check box below. $_CLICK", NONE_STATIC},
|
||||
{"^UnLicesnseTextRB", "Please review the license agreement before uninstalling $(^Name). If you accept all terms of the agreement, select the first option below. $_CLICK", NONE_STATIC},
|
||||
{"^UnLicenseTextRB", "Please review the license agreement before uninstalling $(^Name). If you accept all terms of the agreement, select the first option below. $_CLICK", NONE_STATIC},
|
||||
{"^LicenseData", 0, NONE_STATIC}, // virtual - not processed
|
||||
{"^Custom", "Custom", NONE_STATIC},
|
||||
{"^ComponentsText", "Check the components you want to install and uncheck the components you don't want to install. $_CLICK", NONE_STATIC},
|
||||
|
|
|
@ -3329,34 +3329,26 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
ent.which=EW_SETCTLCOLORS;
|
||||
ent.offsets[0]=add_string(line.gettoken_str(1));
|
||||
|
||||
if (!strcmpi(line.gettoken_str(2),"branding")) {
|
||||
if (line.getnumtokens() == 4) {
|
||||
ERROR_MSG("Error: SetCtlColors expected 2 parameters, got 3\n");
|
||||
return PS_ERROR;
|
||||
}
|
||||
int a = 2;
|
||||
|
||||
c.flags|=CC_BK|CC_BK_SYS|CC_BKB;
|
||||
c.bk.lbStyle=BS_NULL;
|
||||
c.bk.lbColor=COLOR_BTNFACE;
|
||||
c.flags|=CC_TEXT|CC_TEXT_SYS;
|
||||
c.text=COLOR_BTNFACE;
|
||||
c.bkmode=OPAQUE;
|
||||
}
|
||||
else {
|
||||
if (!strcmpi(line.gettoken_str(2),"/BRANDING"))
|
||||
a++;
|
||||
|
||||
{
|
||||
char *p;
|
||||
|
||||
if (line.getnumtokens() == 3) {
|
||||
ERROR_MSG("Error: SetCtlColors expected 3 parameters, got 2\n");
|
||||
if (a == 2 && line.getnumtokens() == 5) {
|
||||
ERROR_MSG("Error: SetCtlColors expected 3 parameters, got 4\n");
|
||||
return PS_ERROR;
|
||||
}
|
||||
|
||||
if (!strcmpi(line.gettoken_str(3),"transparent")) {
|
||||
if (!strcmpi(line.gettoken_str(a+1),"transparent")) {
|
||||
c.flags|=CC_BKB;
|
||||
c.bk.lbStyle=BS_NULL;
|
||||
c.bkmode=TRANSPARENT;
|
||||
}
|
||||
else {
|
||||
p=line.gettoken_str(3);
|
||||
p=line.gettoken_str(a+1);
|
||||
if (*p) {
|
||||
int v=strtoul(p,&p,16);
|
||||
c.bk.lbColor=((v&0xff)<<16)|(v&0xff00)|((v&0xff0000)>>16);
|
||||
|
@ -3367,7 +3359,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
c.bkmode=OPAQUE;
|
||||
}
|
||||
|
||||
p=line.gettoken_str(2);
|
||||
p=line.gettoken_str(a);
|
||||
if (*p) {
|
||||
int v=strtoul(p,&p,16);
|
||||
c.text=((v&0xff)<<16)|(v&0xff00)|((v&0xff0000)>>16);
|
||||
|
@ -3375,6 +3367,24 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
}
|
||||
}
|
||||
|
||||
if (a == 3)
|
||||
{
|
||||
c.flags|=CC_BK|CC_BKB;
|
||||
c.bk.lbStyle=BS_NULL;
|
||||
if (!*line.gettoken_str(a))
|
||||
{
|
||||
c.bk.lbColor=COLOR_BTNFACE;
|
||||
c.flags|=CC_BK_SYS;
|
||||
}
|
||||
c.flags|=CC_TEXT;
|
||||
if (!*line.gettoken_str(a+1))
|
||||
{
|
||||
c.text=COLOR_BTNFACE;
|
||||
c.flags|=CC_TEXT_SYS;
|
||||
}
|
||||
c.bkmode=OPAQUE;
|
||||
}
|
||||
|
||||
int i;
|
||||
int l=cur_ctlcolors->getlen()/sizeof(ctlcolors);
|
||||
for (i=0; i<l; i++) {
|
||||
|
@ -3387,7 +3397,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
ent.offsets[1]=cur_ctlcolors->add(&c,sizeof(ctlcolors));
|
||||
}
|
||||
|
||||
SCRIPT_MSG("SetCtlColors: hwnd=%s text=%s background=%s\n",line.gettoken_str(1),line.gettoken_str(2),line.gettoken_str(3));
|
||||
SCRIPT_MSG("SetCtlColors: hwnd=%s %stext=%s background=%s\n",line.gettoken_str(1),a==2?"":"/BRANDING ",line.gettoken_str(a),line.gettoken_str(a+1));
|
||||
}
|
||||
return add_entry(&ent);
|
||||
case TOK_CREATEFONT:
|
||||
|
|
|
@ -152,7 +152,7 @@ static tokenType tokenlist[TOK__LAST] =
|
|||
{TOK_INSTTYPEGETTEXT,"InstTypeGetText",2,0,"insttype_index $(user_var: output flags)"},
|
||||
{TOK_SENDMESSAGE,"SendMessage",4,2,"hwnd message [wparam|STR:wParam] [lparam|STR:lParam] [$(user_var: return value)] [/TIMEOUT=X]"},
|
||||
{TOK_SETAUTOCLOSE,"SetAutoClose",1,0,"(false|true)"},
|
||||
{TOK_SETCTLCOLORS,"SetCtlColors",2,1,"hwnd (branding | (text_color (transparent|bg_color)))"},
|
||||
{TOK_SETCTLCOLORS,"SetCtlColors",2,2,"hwnd [/BRANDING] [text_color] [transparent|bg_color]"},
|
||||
{TOK_SETBRANDINGIMAGE,"SetBrandingImage",1,2,"[/IMGID=image_item_id_in_dialog] [/RESIZETOFIT] bitmap.bmp"},
|
||||
{TOK_SETCOMPRESS,"SetCompress",1,0,"(off|auto|force)"},
|
||||
{TOK_SETCOMPRESSOR,"SetCompressor",1,1,"[/FINAL] (zlib|bzip2)"},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue