[RAPPS] Fixed default "Download" folder default. Now defaults to "RAPPS Downloads...
authorAlexander Shaposhnikov <sanchaez@reactos.org>
Thu, 29 Jun 2017 18:57:52 +0000 (18:57 +0000)
committerAlexander Shaposhnikov <sanchaez@reactos.org>
Thu, 29 Jun 2017 18:57:52 +0000 (18:57 +0000)
svn path=/branches/GSoC_2017/rapps/; revision=75239

reactos/base/applications/rapps/winmain.cpp

index 23e5a34..198b11a 100644 (file)
@@ -54,9 +54,16 @@ FillDefaultSettings(PSETTINGS_INFO pSettingsInfo)
     pSettingsInfo->bSaveWndPos = TRUE;
     pSettingsInfo->bUpdateAtStart = FALSE;
     pSettingsInfo->bLogEnabled = TRUE;
-    StringCbCopyW(pSettingsInfo->szDownloadDir,
-                  sizeof(pSettingsInfo->szDownloadDir),
-                  L"C:\\Downloads");
+    if (SUCCEEDED(SHGetFolderPathW(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, pSettingsInfo->szDownloadDir)))
+    {
+        StringCbCatW(pSettingsInfo->szDownloadDir, _countof(pSettingsInfo->szDownloadDir), L"\\RAPPS Downloads");
+    } 
+    else
+    {
+        ExpandEnvironmentStringsW(L"%SystemDrive%\\RAPPS Downloads", 
+            pSettingsInfo->szDownloadDir, _countof(pSettingsInfo->szDownloadDir));
+    }
+
     pSettingsInfo->bDelInstaller = FALSE;
 
     pSettingsInfo->Maximized = FALSE;