From f3b771634ebae60d635f673ee820d6adfe0fb663 Mon Sep 17 00:00:00 2001 From: kichik Date: Fri, 21 Oct 2005 20:54:44 +0000 Subject: [PATCH] fixed bug #1008632 - some special folders don't always work in Windows 9x git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4345 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/exehead/Main.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Source/exehead/Main.c b/Source/exehead/Main.c index a597a3bc..7c957763 100644 --- a/Source/exehead/Main.c +++ b/Source/exehead/Main.c @@ -33,6 +33,7 @@ #include "../Platform.h" #include +#include #include "resource.h" #include "util.h" #include "fileform.h" @@ -88,6 +89,27 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam, } #endif + { + // workaround for bug #1008632 + // http://sourceforge.net/tracker/index.php?func=detail&aid=1008632&group_id=22049&atid=373085 + // + // without this, SHGetSpecialFolderPath doesn't always recognize some + // special folders, like the desktop folder for all users, on Windows + // 9x. unlike SHGetSpecialFolderPath, which is not available on all + // versions of Windows, SHGetSpecialFolderLocation doesn't try too + // hard to make sure the caller gets what he asked for. so we give it + // a little push in the right direction by doing part of the work for + // it. + // + // part of what SHGetFileInfo does, is to convert a path into an idl. + // to do this conversion, it first needs to initialize the list of + // special idls, which are exactly the idls we use to get the paths + // of special folders (CSIDL_*). + + SHFILEINFO shfi; + SHGetFileInfo("", 0, &shfi, sizeof(SHFILEINFO), 0); + } + mystrcpy(g_caption,_LANG_GENERIC_ERROR); GetTempPath(NSIS_MAX_STRLEN, state_temp_dir);