Back to 33.5/34

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2392 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2003-03-29 17:16:09 +00:00
parent 34e75bfd21
commit 4df5cb4fac
7 changed files with 45 additions and 41 deletions

View file

@ -80,8 +80,8 @@ BOOL CALLBACK verProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam, int nCmdShow)
{
static int ret;
static const char *m_Err;
int ret;
const char *m_Err = 0;
#ifdef NSIS_CONFIG_CRC_SUPPORT
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT
static HWND hwnd;
@ -91,7 +91,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam,
static char do_crc;
#endif//NSIS_CONFIG_CRC_SUPPORT
#if defined(NSIS_CONFIG_SILENT_SUPPORT) && defined(NSIS_CONFIG_VISIBLE_SUPPORT)
static char silent;
char silent = 0;
#endif//NSIS_CONFIG_SILENT_SUPPORT && NSIS_CONFIG_VISIBLE_SUPPORT
int left;

View file

@ -39,7 +39,6 @@
#define LB_ICONHEIGHT 20
HICON g_hIcon;
static int gDontFookWithFocus = 0;
// Added by Amir Szekely 3rd August 2002
char *language_tables;
@ -266,14 +265,13 @@ static void NSISCALL CheckTreeItem(HWND hWnd, TV_ITEM *pItem, int checked) {
#endif//NSIS_CONFIG_COMPONENTPAGE
static int lang_num;
static void NSISCALL set_language()
{
int i;
LANGID lang_mask=~(LANGID)0;
LANGID lang=myatoi(state_language);
char *language_table=0;
int lang_num=g_inst_cmnheader->language_tables_num;
lang_again:
for (i = 0; i < lang_num; i++) {
@ -299,6 +297,7 @@ lang_again:
int NSISCALL ui_doinstall(void)
{
static WNDCLASS wc; // richedit subclassing and bgbg creation
num_sections=g_inst_header->num_sections;
g_flags.autoclose=inst_flags&CH_FLAGS_AUTO_CLOSE;
#ifdef NSIS_CONFIG_UNINSTALL_SUPPORT
@ -363,7 +362,6 @@ int NSISCALL ui_doinstall(void)
// Multilingual support
{
extern char *g_db_strtab;
lang_num=g_inst_cmnheader->language_tables_num;
language_tables=(void*)(g_db_strtab+g_inst_cmnheader->num_string_bytes);
myitoa(state_language, GetUserDefaultLangID());
@ -381,7 +379,6 @@ int NSISCALL ui_doinstall(void)
if (g_inst_cmnheader->bg_color1 != -1)
{
RECT vp;
static WNDCLASS wc;
extern int bg_color1, bg_color2, bg_textcolor;
extern LRESULT CALLBACK BG_WndProc(HWND, UINT, WPARAM, LPARAM);
wc.lpfnWndProc = BG_WndProc;
@ -413,7 +410,6 @@ int NSISCALL ui_doinstall(void)
#ifdef NSIS_CONFIG_LICENSEPAGE
{ // load richedit DLL
static WNDCLASS wc;
static char str1[]="RichEd20.dll";
static char str2[]="RichEdit20A";
if (!LoadLibrary(str1))
@ -575,7 +571,6 @@ nextPage:
if (this_page->id>=0) // NSIS page
{
gDontFookWithFocus = 0;
m_curwnd=CreateDialog(g_hInstance,windows[this_page->id].id,hwndDlg,windows[this_page->id].proc);
if (m_curwnd)
{
@ -593,11 +588,12 @@ nextPage:
//XGE 5th September 2002 - Do *not* move the focus to the OK button if we are
//on the license page, instead we want the focus left alone because in
//WM_INITDIALOG it is given to the richedit control.
if (!gDontFookWithFocus)
if (this_page->id != NSIS_PAGE_LICENSE)
SetFocus(m_hwndOK);
//XGE End
}
}
return FALSE;
}
#ifdef NSIS_SUPPORT_BGBG
@ -694,7 +690,6 @@ static BOOL CALLBACK LicenseProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
SendMessage(hwLicense,EM_STREAMIN,(((char*)es.dwCookie)[0]=='{')?SF_RTF:SF_TEXT,(LPARAM)&es);
SetUITextFromLang(IDC_INTROTEXT,LANG_LICENSE_TEXT);
//XGE 5th September 2002 - place the initial focus in the richedit control
gDontFookWithFocus++;
SetFocus(hwLicense);
return FALSE;
//End Xge
@ -942,7 +937,6 @@ static DWORD WINAPI newTreeWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l
if (uMsg == WM_KEYDOWN && wParam == VK_SPACE)
{
SendMessage(m_curwnd,WM_TREEVIEW_KEYHACK,0,0);
return 0;
}
#if defined(NSIS_SUPPORT_CODECALLBACKS) && defined(NSIS_CONFIG_ENHANCEDUI_SUPPORT)
if (uMsg == WM_DESTROY) {
@ -1128,6 +1122,8 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
hItem.mask = TVIF_STATE;
hItem.hItem=hTreeItems[wParam];
if (hItem.hItem) CheckTreeItem(hwndTree1, &hItem,lParam);
return FALSE;
}
if (uMsg == WM_NOTIFY || uMsg == WM_TREEVIEW_KEYHACK)
{
@ -1428,6 +1424,8 @@ static BOOL CALLBACK InstProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
}
EnableWindow(m_hwndOK,0);
return FALSE;
}
if (uMsg == WM_NOTIFY_START) {
DWORD id;
@ -1515,6 +1513,7 @@ static BOOL CALLBACK InstProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
CloseClipboard();
}
}
return FALSE;
}
//<<<
return HandleStaticBkColor();

View file

@ -203,7 +203,6 @@ static int NSISCALL ExecuteEntry(entry *entry_)
return 0;
case EW_BRINGTOFRONT:
log_printf("BringToFront");
ShowWindow(g_hwnd,SW_SHOW);
SetForegroundWindow(g_hwnd);
return 0;
case EW_SETFLAG:
@ -515,13 +514,13 @@ static int NSISCALL ExecuteEntry(entry *entry_)
v=my_MessageBox(buf3,parm0);
if (v)
{
if (v==(parm2&0xffff))
if (v==parm2)
{
return parm3;
}
if (v==(parm2>>16))
if (v==parm4)
{
return parm4;
return parm5;
}
}
else g_flags.exec_error++;
@ -695,21 +694,15 @@ static int NSISCALL ExecuteEntry(entry *entry_)
case EW_SENDMESSAGE:
{
int v;
int b3=process_string_fromparm_toint(3);
int b4=process_string_fromparm_toint(4);
int b3=(int)process_string_fromparm_tobuf(0x03);
int b4=(int)process_string_fromparm_tobuf(0x14);
if (!(parm5&1)) b3=myatoi((char*)b3);
if (!(parm5&2)) b4=myatoi((char*)b4);
if (which == EW_SENDMESSAGE)
{
HWND hwnd=(HWND)process_string_fromparm_toint(1);
int msg=process_string_fromparm_toint(2);
if (parm5&1)
{
b3=(int)process_string_fromparm_tobuf(0x03);
}
if (parm5&2)
{
b4=(int)process_string_fromparm_tobuf(0x14);
}
if (parm5>>2) g_flags.exec_error += !SendMessageTimeout(hwnd,msg,b3,b4,SMTO_NORMAL,parm5>>2,(LPDWORD)&v);
else v=SendMessage(hwnd,msg,b3,b4);

View file

@ -179,11 +179,12 @@ enum
EW_GETFUNCTIONADDR,
// Saves 56 bytes, don't ask me how
EW_DUMMY,
// Hmm... now it doesn't =/
/*EW_DUMMY,
EW_DUMMY2,
EW_DUMMY3,
EW_DUMMY4,
EW_DUMMY5,
EW_DUMMY5,*/
EW_PLUGINCOMMANDPREP,
};

View file

@ -32,9 +32,8 @@ HANDLE g_hInstance;
HANDLE NSISCALL myCreateProcess(char *cmd, char *dir)
{
DWORD d;
PROCESS_INFORMATION ProcInfo={0,};
STARTUPINFO StartUp={0,};
StartUp.cb=sizeof(StartUp);
static PROCESS_INFORMATION ProcInfo;
STARTUPINFO StartUp = {sizeof(StartUp), };
d=GetFileAttributes(dir);
if (d == INVALID_FILE_ATTRIBUTES || !(d&FILE_ATTRIBUTE_DIRECTORY)) dir=0;
if (!CreateProcess(NULL, cmd, NULL, NULL, FALSE, 0, NULL, dir, &StartUp, &ProcInfo))
@ -237,14 +236,14 @@ BOOL NSISCALL MoveFileOnReboot(LPCTSTR pszExisting, LPCTSTR pszNew)
char *szRenameSec = "[Rename]\r\n";
HANDLE hfile, hfilemap;
DWORD dwFileSize, dwRenameLinePos;
static const char nulint[4]="NUL";
*((int *)tmpbuf) = *((int *)"NUL");
if (pszNew) {
// create the file if it's not already there to prevent GetShortPathName from failing
CloseHandle(myOpenFile(pszNew, 0, CREATE_NEW));
GetShortPathName(pszNew,tmpbuf,1024);
}
else *((int *)tmpbuf) = *((int *)nulint);
// wininit is used as a temporary here
GetShortPathName(pszExisting,wininit,1024);
cchRenameLine = wsprintf(szRenameLine,"%s=%s\r\n",tmpbuf,wininit);