Zhiyi Zhang : wineboot: Create user folders if they don't exist.

Alexandre Julliard julliard at winehq.org
Tue Sep 18 15:14:32 CDT 2018


Module: wine
Branch: master
Commit: 193fc956287bd2e2d611a44e4b36a3e5e9021432
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=193fc956287bd2e2d611a44e4b36a3e5e9021432

Author: Zhiyi Zhang <zzhang at codeweavers.com>
Date:   Mon Sep 17 23:32:10 2018 +0800

wineboot: Create user folders if they don't exist.

When creating volatile environment registry keys during first
wineprefix creation, none of the user folders are existent.  Create
them before setting registry keys so that volatile environment gets
initialized and corresponding environment variables such as
%USERPROFILE% can be set. Otherwise, such environment variables are
set only after another wineboot, causing applications to fail if they
need them after first boot.

Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/wineboot/wineboot.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c
index 17ef9cb..075b4c8 100644
--- a/programs/wineboot/wineboot.c
+++ b/programs/wineboot/wineboot.c
@@ -385,14 +385,14 @@ static void create_volatile_environment_registry_key(void)
                          KEY_ALL_ACCESS, NULL, &hkey, NULL ))
         return;
 
-    hr = SHGetFolderPathW( NULL, CSIDL_APPDATA, NULL, SHGFP_TYPE_CURRENT, path );
+    hr = SHGetFolderPathW( NULL, CSIDL_APPDATA | CSIDL_FLAG_CREATE, NULL, SHGFP_TYPE_CURRENT, path );
     if (SUCCEEDED(hr)) set_reg_value( hkey, AppDataW, path );
 
     set_reg_value( hkey, ClientNameW, ConsoleW );
 
     /* Write the profile path's drive letter and directory components into
      * HOMEDRIVE and HOMEPATH respectively. */
-    hr = SHGetFolderPathW( NULL, CSIDL_PROFILE, NULL, SHGFP_TYPE_CURRENT, path );
+    hr = SHGetFolderPathW( NULL, CSIDL_PROFILE | CSIDL_FLAG_CREATE, NULL, SHGFP_TYPE_CURRENT, path );
     if (SUCCEEDED(hr))
     {
         set_reg_value( hkey, UserProfileW, path );
@@ -406,7 +406,7 @@ static void create_volatile_environment_registry_key(void)
 
     set_reg_value( hkey, HomeShareW, EmptyW );
 
-    hr = SHGetFolderPathW( NULL, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, path );
+    hr = SHGetFolderPathW( NULL, CSIDL_LOCAL_APPDATA | CSIDL_FLAG_CREATE, NULL, SHGFP_TYPE_CURRENT, path );
     if (SUCCEEDED(hr))
         set_reg_value( hkey, LocalAppDataW, path );
 




More information about the wine-cvs mailing list