diff --git a/Source/Platform.h b/Source/Platform.h index b4abdf03..dbeead09 100644 --- a/Source/Platform.h +++ b/Source/Platform.h @@ -867,4 +867,11 @@ typedef struct tagVS_FIXEDFILEINFO { # pragma pack() #endif +// ShGetFolderPath +typedef HRESULT (__stdcall * PFNSHGETFOLDERPATHA)(HWND, int, HANDLE, DWORD, LPSTR); + +#ifndef SHGFP_TYPE_CURRENT + #define SHGFP_TYPE_CURRENT 0 +#endif + #endif diff --git a/Source/exehead/util.c b/Source/exehead/util.c index 68209210..e4cfa5e1 100644 --- a/Source/exehead/util.c +++ b/Source/exehead/util.c @@ -16,7 +16,6 @@ #include "../Platform.h" #include -#include #include "util.h" #include "state.h" #include "config.h" @@ -628,9 +627,7 @@ char * NSISCALL GetNSISString(char *outbuf, int strtab) int x = 2; // Use SHGetFolderPath when shfolder.dll is available - PFNSHGETFOLDERPATHA pSHGetFolderPath = 0; - HMODULE hDLL = LoadLibrary("shfolder"); - if (hDLL) pSHGetFolderPath = (PFNSHGETFOLDERPATHA) myGetProcAddress(MGA_SHGetFolderPathA); + PFNSHGETFOLDERPATHA pSHGetFolderPath = (PFNSHGETFOLDERPATHA) myGetProcAddress(MGA_SHGetFolderPathA); if (g_exec_flags.all_user_var) { @@ -680,9 +677,6 @@ char * NSISCALL GetNSISString(char *outbuf, int strtab) mystrcat(out, QUICKLAUNCH); } } - - if (hDLL) FreeLibrary(hDLL); - validate_filename(out); } else if (nVarIdx == NS_VAR_CODE)