Commit 193fc956 authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

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: 's avatarZhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 1e8c62b0
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment