From 2553c6e5505a1cbe36242bf76dfe972fea874f3a Mon Sep 17 00:00:00 2001 From: anders_k Date: Fri, 23 Jun 2017 01:11:30 +0000 Subject: [PATCH] $LocalAppData now resolves to the ProgramData folder in the "SetShellVarContext all" context git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6875 212acab6-be3b-0410-9dea-997c60f758d6 --- Docs/src/history.but | 2 ++ Docs/src/misc.but | 2 +- Docs/src/var.but | 2 +- Source/build.cpp | 2 +- Source/exehead/util.c | 2 +- Source/manifest.cpp | 1 + 6 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Docs/src/history.but b/Docs/src/history.but index af12ecbc..3c0e3c71 100644 --- a/Docs/src/history.but +++ b/Docs/src/history.but @@ -20,6 +20,8 @@ Released on ? ?th, 2017 \b Added \R{pragma}{!pragma warning} (\W{http://sf.net/p/nsis/patches/267}{patch #267}) +\b $LocalAppData now resolves to the ProgramData folder in the \R{setshellvarcontext}{SetShellVarContext all} context + \S2{} Minor Changes \b Variables used in Caption can now be set in .onGuiInit (\W{http://sf.net/p/nsis/feature-requests/539}{RFE #539}) diff --git a/Docs/src/misc.but b/Docs/src/misc.but index 5511996d..da449c21 100644 --- a/Docs/src/misc.but +++ b/Docs/src/misc.but @@ -69,7 +69,7 @@ Sets the error level of the installer or uninstaller to \e{error_level}. See \R{ \c \\current\\|all -Sets the context of $SMPROGRAMS and other shell folders. If set to 'current' (the default), the current user's shell folders are used. If set to 'all', the 'all users' shell folder is used. The all users folder may not be supported on all OSes. If the all users folder is not found, the current user folder will be used. Please take into consideration that a "normal user" has no rights to write in the all users area. Only admins have full access rights to the all users area. You can check this by using the UserInfo plug-in. See Contrib\\UserInfo\\UserInfo.nsi for an example. +Sets the context of $SMPROGRAMS and other \R{varconstant}{shell folders}. If set to 'current' (the default), the current user's shell folders are used. If set to 'all', the 'all users' shell folder is used. The all users folder may not be supported on all OSes. If the all users folder is not found, the current user folder will be used. Please take into consideration that a "normal user" has no rights to write in the all users area. Only admins have full access rights to the all users area. You can check this by using the UserInfo plug-in. See Contrib\\UserInfo\\UserInfo.nsi for an example. Note that, if used in installer code, this will only affect the installer, and if used in uninstaller code, this will only affect the uninstaller. To affect both, it needs to be used in both. diff --git a/Docs/src/var.but b/Docs/src/var.but index b90c2b8f..1dadabd9 100644 --- a/Docs/src/var.but +++ b/Docs/src/var.but @@ -177,7 +177,7 @@ This constant is not available on Windows 95 unless Internet Explorer 4 with Act \e{$LOCALAPPDATA} -The local (non-roaming) application data directory. +The local (non-roaming) application data directory. The context of this constant (All Users or Current user) depends on the \R{setshellvarcontext}{SetShellVarContext} setting. The default is the current user. This constant is available on Windows ME, 2000 and above. diff --git a/Source/build.cpp b/Source/build.cpp index 779ca502..72c6a369 100644 --- a/Source/build.cpp +++ b/Source/build.cpp @@ -364,7 +364,7 @@ CEXEBuild::CEXEBuild(signed char pponly) : m_ShellConstants.add(_T("FONTS"), CSIDL_FONTS, CSIDL_FONTS); m_ShellConstants.add(_T("TEMPLATES"), CSIDL_TEMPLATES, CSIDL_COMMON_TEMPLATES); m_ShellConstants.add(_T("APPDATA"), CSIDL_APPDATA, CSIDL_COMMON_APPDATA); - m_ShellConstants.add(_T("LOCALAPPDATA"), CSIDL_LOCAL_APPDATA, CSIDL_LOCAL_APPDATA); + m_ShellConstants.add(_T("LOCALAPPDATA"), CSIDL_LOCAL_APPDATA, CSIDL_COMMON_APPDATA); m_ShellConstants.add(_T("PRINTHOOD"), CSIDL_PRINTHOOD, CSIDL_PRINTHOOD); //m_ShellConstants.add(_T("ALTSTARTUP"), CSIDL_ALTSTARTUP, CSIDL_COMMON_ALTSTARTUP); m_ShellConstants.add(_T("INTERNET_CACHE"), CSIDL_INTERNET_CACHE, CSIDL_INTERNET_CACHE); diff --git a/Source/exehead/util.c b/Source/exehead/util.c index d72a12cd..b84e2461 100644 --- a/Source/exehead/util.c +++ b/Source/exehead/util.c @@ -845,7 +845,7 @@ TCHAR * NSISCALL GetNSISString(TCHAR *outbuf, int strtab) */ BOOL use_shfolder = // Use shfolder if not on 95/98 - !((ver & 0x80000000) && (LOWORD(ver) != 0x5A04)) || + !((ver & 0x80000000) && (LOWORD(ver) != MAKEWORD(4,90))) || // Unless the Application Data or Documents folder is requested ( diff --git a/Source/manifest.cpp b/Source/manifest.cpp index 3022401e..5bb43438 100644 --- a/Source/manifest.cpp +++ b/Source/manifest.cpp @@ -49,6 +49,7 @@ static const struct { const TCHAR *name, *guidstr; } g_soslmap[] = { bool SupportedOSList::addall() { + m_isdefaultlist = false; for (UINT i = 0; i < COUNTOF(g_soslmap); ++i) if (!append(g_soslmap[i].name)) return false;