fixed bug #1287731 - FileRequest alters working directory

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4260 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2005-09-13 19:19:05 +00:00
parent cd8934d15c
commit 68ff07805b

View file

@ -602,8 +602,11 @@ LRESULT WINAPI WMCommandProc(HWND hWnd, UINT id, HWND hwndCtl, UINT codeNotify)
GetWindowText(pField->hwnd, szBrowsePath, sizeof(szBrowsePath));
tryagain:
GetCurrentDirectory(BUFFER_SIZE, szResult); // save working dir
if ((pField->nFlags & FLAG_SAVEAS) ? GetSaveFileName(&ofn) : GetOpenFileName(&ofn)) {
mySetWindowText(pField->hwnd, szBrowsePath);
SetCurrentDirectory(szResult); // restore working dir
// OFN_NOCHANGEDIR doesn't always work (see MSDN)
break;
}
else if (szBrowsePath[0] && CommDlgExtendedError() == FNERR_INVALIDFILENAME) {