From 2a6894ebc8524901504ecbc7ef255b0f5d6b5c8e Mon Sep 17 00:00:00 2001 From: kichik Date: Mon, 22 Sep 2003 16:06:53 +0000 Subject: [PATCH] - .onVerifyInstDir is now used in the browse dialog too - Fixed problems with SHFileOperation, OleUninitialize and ICopyHook (and possibly XPlay) git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2947 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/exehead/Main.c | 10 +++++----- Source/exehead/Ui.c | 20 ++++++++++++++------ 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/Source/exehead/Main.c b/Source/exehead/Main.c index 78710d8b..f2db742c 100644 --- a/Source/exehead/Main.c +++ b/Source/exehead/Main.c @@ -223,10 +223,6 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam, #endif//NSIS_CONFIG_LOG end: -#if defined(NSIS_SUPPORT_ACTIVEXREG) || defined(NSIS_SUPPORT_CREATESHORTCUT) - OleUninitialize(); -#endif - if (g_db_hFile != INVALID_HANDLE_VALUE) CloseHandle(g_db_hFile); #ifdef NSIS_COMPRESS_WHOLE if (dbd_hFile != INVALID_HANDLE_VALUE) CloseHandle(dbd_hFile); @@ -239,5 +235,9 @@ end: #endif // NSIS_CONFIG_PLUGIN_SUPPORT if (g_hIcon) DeleteObject(g_hIcon); +#if defined(NSIS_SUPPORT_ACTIVEXREG) || defined(NSIS_SUPPORT_CREATESHORTCUT) + OleUninitialize(); +#endif + ExitProcess(ret); -} +} \ No newline at end of file diff --git a/Source/exehead/Ui.c b/Source/exehead/Ui.c index bfc2dfb3..517d0dd1 100644 --- a/Source/exehead/Ui.c +++ b/Source/exehead/Ui.c @@ -335,12 +335,20 @@ static int CALLBACK WINAPI BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lPara { if (uMsg==BFFM_INITIALIZED) { - my_GetDialogItemText(m_curwnd,IDC_DIR,(char*)lpData,sizeof(g_tmp)); + my_GetDialogItemText(m_curwnd,IDC_DIR,(char*)lpData,NSIS_MAX_STRLEN); SendMessage(hwnd,BFFM_SETSELECTION,(WPARAM)1,lpData); } if (uMsg==BFFM_SELCHANGED) { - SendMessage(hwnd,BFFM_ENABLEOK,0,SHGetPathFromIDList((LPITEMIDLIST)lParam,(char*)lpData)); + SendMessage( + hwnd, + BFFM_ENABLEOK, + 0, + SHGetPathFromIDList((LPITEMIDLIST)lParam,(char*)lpData) +#ifdef NSIS_SUPPORT_CODECALLBACKS + && !ExecuteCodeSegment(g_header->code_onVerifyInstDir,NULL) +#endif + ); } return 0; } @@ -747,7 +755,7 @@ static BOOL CALLBACK DirProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar bi.hwndOwner = hwndDlg; bi.pszDisplayName = name; bi.lpfn = BrowseCallbackProc; - bi.lParam = (LPARAM)g_tmp; + bi.lParam = (LPARAM)dir; bi.lpszTitle = GetNSISStringTT(browse_text); #ifndef BIF_NEWDIALOGSTYLE #define BIF_NEWDIALOGSTYLE 0x0040 @@ -771,11 +779,11 @@ static BOOL CALLBACK DirProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar // name gives just the folder name if (lstrcmpi(post_str,name)) { - lstrcat(addtrailingslash(g_tmp),post_str); + lstrcat(addtrailingslash(dir),post_str); } } - SetUITextNT(IDC_DIR,g_tmp); + SetUITextNT(IDC_DIR,dir); } } } @@ -829,7 +837,7 @@ static BOOL CALLBACK DirProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar #ifdef NSIS_SUPPORT_CODECALLBACKS && !ExecuteCodeSegment(g_header->code_onVerifyInstDir,NULL) #endif - ); + ); } return HandleStaticBkColor(); }