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:
parent
cd8934d15c
commit
68ff07805b
1 changed files with 3 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue