From a1f24139421f49834a7e1726ad5404835fe9c5a4 Mon Sep 17 00:00:00 2001 From: kichik Date: Fri, 13 Jan 2006 19:56:03 +0000 Subject: [PATCH] fixed bug #1209843 - $INSTDIR is empty in directory page show callback function git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4476 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/exehead/Ui.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Source/exehead/Ui.c b/Source/exehead/Ui.c index 2b5130ac..9794578d 100644 --- a/Source/exehead/Ui.c +++ b/Source/exehead/Ui.c @@ -900,6 +900,22 @@ static BOOL CALLBACK DirProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar #endif if (validpathspec(dir) && !skip_root(dir)) addtrailingslash(dir); + + // workaround for bug #1209843 + // + // m_curwnd is only updated once WM_INITDIALOG returns. + // my_SetWindowText triggers an EN_CHANGE message that + // triggers a WM_IN_UPDATEMSG message that uses m_curwnd + // to get the selected directory (GetUIText). + // because m_curwnd is still outdated, dir varialble is + // filled with an empty string. by default, dir points + // to $INSTDIR. + // + // to solve this, m_curwnd is manually set to the correct + // window handle. + + m_curwnd=hwndDlg; + my_SetWindowText(hDir,dir); SetUITextFromLang(IDC_BROWSE,this_page->parms[2]); SetUITextFromLang(IDC_SELDIRTEXT,this_page->parms[1]);