Explorar el Código

If Setup was starting in administrative install mode it would ask Windows to create any missing {usercf}, {userpf}, and {usersavedgames} folders. It no longer does this because it violates the used user areas warning.

Martijn Laan hace 1 año
padre
commit
9c09134971
Se han modificado 2 ficheros con 7 adiciones y 3 borrados
  1. 6 3
      Projects/Main.pas
  2. 1 0
      whatsnew.htm

+ 6 - 3
Projects/Main.pas

@@ -1386,21 +1386,24 @@ begin
 
 
   { Get dirs which have no CSIDL equivalent and cannot be retrieved using SHGetFolderPath. }
   { Get dirs which have no CSIDL equivalent and cannot be retrieved using SHGetFolderPath. }
   if Assigned(SHGetKnownFolderPathFunc) and (WindowsVersion shr 16 >= $0600) then begin
   if Assigned(SHGetKnownFolderPathFunc) and (WindowsVersion shr 16 >= $0600) then begin
-    if SHGetKnownFolderPathFunc(FOLDERID_UserProgramFiles {Windows 7+}, KF_FLAG_CREATE, 0, Path) = S_OK then begin
+    var dwFlags: DWORD := 0;
+    if not IsAdminInstallMode then
+      dwFlags := dwFlags or KF_FLAG_CREATE;
+    if SHGetKnownFolderPathFunc(FOLDERID_UserProgramFiles {Windows 7+}, dwFlags, 0, Path) = S_OK then begin
       try
       try
         ProgramFilesUserDir := WideCharToString(Path);
         ProgramFilesUserDir := WideCharToString(Path);
       finally
       finally
         CoTaskMemFree(Path);
         CoTaskMemFree(Path);
       end;
       end;
     end;
     end;
-    if SHGetKnownFolderPathFunc(FOLDERID_UserProgramFilesCommon {Windows 7+}, KF_FLAG_CREATE, 0, Path) = S_OK then begin
+    if SHGetKnownFolderPathFunc(FOLDERID_UserProgramFilesCommon {Windows 7+}, dwFlags, 0, Path) = S_OK then begin
       try
       try
         CommonFilesUserDir := WideCharToString(Path);
         CommonFilesUserDir := WideCharToString(Path);
       finally
       finally
         CoTaskMemFree(Path);
         CoTaskMemFree(Path);
       end;
       end;
     end;
     end;
-    if SHGetKnownFolderPathFunc(FOLDERID_SavedGames {Vista+}, KF_FLAG_CREATE, 0, Path) = S_OK then begin
+    if SHGetKnownFolderPathFunc(FOLDERID_SavedGames {Vista+}, dwFlags, 0, Path) = S_OK then begin
       try
       try
         SavedGamesUserDir := WideCharToString(Path);
         SavedGamesUserDir := WideCharToString(Path);
       finally
       finally

+ 1 - 0
whatsnew.htm

@@ -30,6 +30,7 @@ For conditions of distribution and use, see <a href="https://jrsoftware.org/file
 
 
 <p><a name="6.2.3"></a><span class="ver">6.2.3-dev </span><span class="date">(?)</span></p>
 <p><a name="6.2.3"></a><span class="ver">6.2.3-dev </span><span class="date">(?)</span></p>
 <ul>
 <ul>
+  <li>If Setup was starting in administrative install mode it would ask Windows to create any missing <tt>{usercf}</tt>, <tt>{userpf}</tt>, and <tt>{usersavedgames}</tt> folders. It no longer does this because it violates the <a href="https://jrsoftware.org/ishelp/index.php?topic=setup_useduserareaswarning">used user areas warning</a>.</li>
   <li>Added support for IIS group users identifiers (<tt>iisiusrs</tt>) for use in <tt>Permissions</tt> parameters, contributed by Achim Stuy.</li> 
   <li>Added support for IIS group users identifiers (<tt>iisiusrs</tt>) for use in <tt>Permissions</tt> parameters, contributed by Achim Stuy.</li> 
   <li>Added official Korean translation.</li>
   <li>Added official Korean translation.</li>
 </ul>
 </ul>