only free the PIDL in DirProc, don't parse it too so g_tmp gets overwritten with the entire path instaed of just the display name
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3472 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
80c8c38055
commit
4a8e19199a
3 changed files with 11 additions and 12 deletions
|
@ -855,17 +855,17 @@ static BOOL CALLBACK DirProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
|
|||
idlist = SHBrowseForFolder(&bi);
|
||||
if (idlist)
|
||||
{
|
||||
// Get and free idlist
|
||||
my_PIDL2Path(g_tmp, idlist);
|
||||
// free idlist
|
||||
FreePIDL(idlist);
|
||||
|
||||
if (g_header->install_directory_auto_append)
|
||||
{
|
||||
const char *post_str=ps_tmpbuf;
|
||||
const char *post_str = ps_tmpbuf;
|
||||
GetNSISStringTT(g_header->install_directory_auto_append);
|
||||
// name gives just the folder name
|
||||
if (lstrcmpi(post_str,g_tmp))
|
||||
// display name gives just the folder name
|
||||
if (lstrcmpi(post_str, g_tmp))
|
||||
{
|
||||
lstrcat(addtrailingslash(dir),post_str);
|
||||
lstrcat(addtrailingslash(dir), post_str);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -27,18 +27,15 @@ NSIS_STRING g_usrvars[1];
|
|||
#define SECTION_VARS_RWD "/section:" ## VARS_SECTION_NAME ## ",rwd"
|
||||
#pragma comment(linker, SECTION_VARS_RWD)
|
||||
|
||||
int NSISCALL my_PIDL2Path(char *out, LPITEMIDLIST idl)
|
||||
void NSISCALL FreePIDL(LPITEMIDLIST idl)
|
||||
{
|
||||
int Res;
|
||||
IMalloc *m;
|
||||
SHGetMalloc(&m);
|
||||
Res = SHGetPathFromIDList(idl, out);
|
||||
if (m)
|
||||
{
|
||||
m->lpVtbl->Free(m, idl);
|
||||
m->lpVtbl->Release(m);
|
||||
}
|
||||
return Res;
|
||||
}
|
||||
|
||||
HANDLE NSISCALL myCreateProcess(char *cmd, char *dir)
|
||||
|
@ -537,7 +534,9 @@ char * NSISCALL GetNSISString(char *outbuf, int strtab)
|
|||
{
|
||||
if (!SHGetSpecialFolderLocation(g_hwnd, fldrs[x], &idl))
|
||||
{
|
||||
if (my_PIDL2Path(out, idl))
|
||||
BOOL res = SHGetPathFromIDList(idl, out);
|
||||
FreePIDL(idl);
|
||||
if (res)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ int NSISCALL mystrlen(const char *in);
|
|||
char * NSISCALL mystrstr(char *a, char *b);
|
||||
WIN32_FIND_DATA * NSISCALL file_exists(char *buf);
|
||||
char * NSISCALL my_GetTempFileName(char *buf, const char *dir);
|
||||
int NSISCALL my_PIDL2Path(char *out, LPITEMIDLIST idl);
|
||||
void NSISCALL FreePIDL(LPITEMIDLIST idl);
|
||||
|
||||
//BOOL NSISCALL my_SetWindowText(HWND hWnd, const char *val);
|
||||
#define my_SetWindowText SetWindowText
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue