From 270bb06fd3a3f41b24f3afd921cbf211497effc1 Mon Sep 17 00:00:00 2001 From: kichik Date: Mon, 30 Dec 2002 15:33:53 +0000 Subject: [PATCH] Update !system, cleaned resource.h, DeleteRegKey works on default value git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2020 212acab6-be3b-0410-9dea-997c60f758d6 --- Docs/src/compiler.but | 2 +- Source/exehead/Ui.c | 9 ++++----- Source/exehead/exec.c | 4 ++-- Source/exehead/resource.h | 21 +++------------------ Source/script.cpp | 4 +++- Source/tokens.cpp | 2 +- 6 files changed, 14 insertions(+), 28 deletions(-) diff --git a/Docs/src/compiler.but b/Docs/src/compiler.but index 0057484e..24ba56f1 100644 --- a/Docs/src/compiler.but +++ b/Docs/src/compiler.but @@ -38,7 +38,7 @@ This option makes the compiler an external EXE packer (such as Petite or UPX) to \c command [compare comparevalue] -This command will execute 'command' using a call to system(), and if the return value compared (using 'compare') to 'comparevalue' is false, execution will halt. 'compare' can be '<' or '>' or '<>' or '=' or 'ignore'. +This command will execute 'command' using a call to system(), and if the return value compared (using 'compare') to 'comparevalue' is false, execution will halt. 'compare' can be '<' or '>' or '<>' or '='. \S1{warning} !warning diff --git a/Source/exehead/Ui.c b/Source/exehead/Ui.c index 0e9e30ea..e0c4c39e 100644 --- a/Source/exehead/Ui.c +++ b/Source/exehead/Ui.c @@ -124,13 +124,13 @@ static BOOL NSISCALL SetDlgItemTextFromLang_(HWND dlg, int id, int lid) { #define GetUIItem(it) GetDlgItem(hwndDlg,it) #ifdef NSIS_CONFIG_ENHANCEDUI_SUPPORT -#define HandleStaticBkColor() _HandleStaticBkColor(hwndDlg, uMsg, wParam, lParam) -static BOOL NSISCALL _HandleStaticBkColor(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { +#define HandleStaticBkColor() _HandleStaticBkColor(uMsg, lParam) +static BOOL NSISCALL _HandleStaticBkColor(UINT uMsg, LPARAM lParam) { if (uMsg == WM_CTLCOLORSTATIC) { COLORREF color = GetWindowLong((HWND)lParam, GWL_USERDATA); if (color) { LOGBRUSH b={BS_SOLID, color-1, 0}; - SetBkColor((HDC)wParam, b.lbColor); + SetBkColor(GetDC((HWND)lParam), b.lbColor); return (BOOL)CreateBrushIndirect(&b); } } @@ -499,10 +499,9 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) SetDlgItemTextFromLang(hwndDlg,IDCANCEL,LANG_BTN_CANCEL); SetDlgItemTextFromLang(hwndDlg,IDC_BACK,LANG_BTN_BACK); #if defined(NSIS_SUPPORT_CODECALLBACKS) && defined(NSIS_CONFIG_ENHANCEDUI_SUPPORT) - if (!ExecuteCodeSegment(g_inst_cmnheader->code_onGUIInit,NULL)) + if (!(g_quit_flag = ExecuteCodeSegment(g_inst_cmnheader->code_onGUIInit,NULL))) #endif ShowWindow(hwndDlg,SW_SHOW); - else g_quit_flag = 1; } this_page=g_inst_page+m_page; diff --git a/Source/exehead/exec.c b/Source/exehead/exec.c index 9e661827..aaf9da70 100644 --- a/Source/exehead/exec.c +++ b/Source/exehead/exec.c @@ -1168,7 +1168,7 @@ static int NSISCALL ExecuteEntry(entry *entry_) int rootkey=parm0; char *buf3=process_string_fromparm_tobuf(0x31); exec_errorflag++; - if (parm2) + if (parm3) { HKEY hKey; if (RegOpenKeyEx((HKEY)rootkey,buf3,0,KEY_ALL_ACCESS,&hKey) == ERROR_SUCCESS) @@ -1182,7 +1182,7 @@ static int NSISCALL ExecuteEntry(entry *entry_) else { log_printf3("DeleteRegKey: %d\\%s",rootkey,buf3); - if (myRegDeleteKeyEx((HKEY)rootkey,buf3,parm3) == ERROR_SUCCESS) exec_errorflag--; + if (myRegDeleteKeyEx((HKEY)rootkey,buf3,parm3&2) == ERROR_SUCCESS) exec_errorflag--; } } return 0; diff --git a/Source/exehead/resource.h b/Source/exehead/resource.h index 44c2960b..85900225 100644 --- a/Source/exehead/resource.h +++ b/Source/exehead/resource.h @@ -7,9 +7,6 @@ #endif #define IDC_BACK 3 -#define IDD_DIALOG1 101 -#define IDI_ICON1 102 -#define IDD_DIALOG2 102 #define IDD_LICENSE 102 #define IDI_ICON2 103 #define IDD_DIR 103 @@ -17,25 +14,14 @@ #define IDD_INST 105 #define IDD_INSTFILES 106 #define IDD_UNINST 107 -#define IDB_BITMAP1 109 -#define IDB_BITMAP2 110 -#define IDI_ICON3 110 #define IDD_VERIFY 111 -#define IDB_BITMAP3 111 +#define IDB_BITMAP1 109 #define IDC_EDIT1 1000 #define IDC_BROWSE 1001 -#define IDC_COPYRIGHT 1003 #define IDC_PROGRESS1 1004 #define IDC_PROGRESS2 1005 #define IDC_INTROTEXT 1006 -#define IDC_WMA 1007 #define IDC_CHECK1 1008 -#define IDC_MJF 1008 -#define IDC_VERSION 1009 -#define IDC_EDIT2 1010 -#define IDC_DIRCAPTION 1011 -#define IDC_STATUSTEXT 1014 -#define IDC_LICTEXT 1015 #define IDC_LIST1 1016 #define IDC_COMBO1 1017 #define IDC_CHILDRECT 1018 @@ -45,9 +31,6 @@ #define IDC_TEXT2 1022 #define IDC_SPACEREQUIRED 1023 #define IDC_SPACEAVAILABLE 1024 -#define IDC_INSTVER 1024 -#define IDC_UNINSTTEXT 1025 -#define IDC_PROGRESSTEXT 1026 #define IDC_SHOWDETAILS 1027 #define IDC_VERSTR 1028 #define IDC_UNINSTFROM 1029 @@ -66,3 +49,5 @@ #define _APS_NEXT_SYMED_VALUE 101 #endif #endif + + diff --git a/Source/script.cpp b/Source/script.cpp index 82995f8b..3b394272 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -1643,6 +1643,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char { char *exec=line.gettoken_str(1); int comp=line.gettoken_enum(2,"<\0>\0<>\0=\0ignore\0"); + if (line.getnumtokens() == 2) comp = 4; if (comp == -1 && line.getnumtokens() == 3) comp=4; if (comp == -1) PRINTHELP() int success=0; @@ -3310,12 +3311,13 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char int a=1; if (which_token==TOK_DELETEREGKEY) { + ent.offsets[3]=1; char *s=line.gettoken_str(a); if (s[0] == '/') { if (stricmp(s,"/ifempty")) PRINTHELP() a++; - ent.offsets[3]=1; + ent.offsets[3]=3; } if (line.gettoken_str(a+2)[0]) PRINTHELP() } diff --git a/Source/tokens.cpp b/Source/tokens.cpp index 51c258e3..d3daed89 100644 --- a/Source/tokens.cpp +++ b/Source/tokens.cpp @@ -173,7 +173,7 @@ static tokenType tokenlist[TOK__LAST] = {TOK_WRITEUNINSTALLER,"WriteUninstaller",1,0,"uninstall_exe_name"}, {TOK_XPSTYLE, "XPStyle",1,0,"(on|off)"}, {TOK_P_PACKEXEHEADER,"!packhdr",2,0,"temp_file_name command_line_to_compress_that_temp_file"}, -{TOK_P_SYSTEMEXEC,"!system",1,2,"command (<|>|<>|=|ignore) retval"}, +{TOK_P_SYSTEMEXEC,"!system",1,2,"command [<|>|<>|=) retval]"}, {TOK_P_ADDINCLUDEDIR,"!AddIncludeDir",1,0,"dir"}, {TOK_P_INCLUDE,"!include",1,0,"filename.nsi"}, {TOK_P_CD,"!cd",1,0,"absolute_or_relative_new_directory"},