浏览代码

Tweak for userpf/usercf support on Vista.

Martijn Laan 13 年之前
父节点
当前提交
681dd8360f
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      Projects/Main.pas

+ 4 - 2
Projects/Main.pas

@@ -1294,8 +1294,10 @@ begin
       InternalError('Failed to get path of 64-bit Common Files directory');
       InternalError('Failed to get path of 64-bit Common Files directory');
   end;
   end;
 
 
-  { Get per-user Program Files and Common Files dirs (requires Windows 7 or newer) }
-  if Assigned(SHGetKnownFolderPathFunc) and (WindowsVersion shr 16 >= $0601) then begin
+  { Get per-user Program Files and Common Files dirs. Requires Windows 7 or
+    later but trying it on Vista too in case some update adds support for the
+    folders later (like we saw with CSIDLs in the old days). }
+  if Assigned(SHGetKnownFolderPathFunc) and (WindowsVersion shr 16 >= $0600) then begin
     if SHGetKnownFolderPathFunc(FOLDERID_UserProgramFiles, KF_FLAG_CREATE, 0, Path) = S_OK then begin
     if SHGetKnownFolderPathFunc(FOLDERID_UserProgramFiles, KF_FLAG_CREATE, 0, Path) = S_OK then begin
       try
       try
         ProgramFilesUserDir := WideCharToString(Path);
         ProgramFilesUserDir := WideCharToString(Path);