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@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zhiyi Zhang 2018-09-17 23:32:10 +08:00 committed by Alexandre Julliard
parent 1e8c62b020
commit 193fc95628
1 changed files with 3 additions and 3 deletions

View File

@ -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 );