Commit 39b7e6e5 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

msi: Resolve the target folder if necessary in msi_get_target_folder.

parent 959ebdb1
......@@ -3517,14 +3517,8 @@ static WCHAR *get_link_file( MSIPACKAGE *package, MSIRECORD *row )
link_folder = msi_get_target_folder( package, directory );
if (!link_folder)
{
/* some installers use a separate root */
MSIFOLDER *folder = msi_get_loaded_folder( package, directory );
while (folder->Parent && strcmpW( folder->Parent, folder->Directory ))
{
folder = msi_get_loaded_folder( package, folder->Parent );
}
msi_resolve_target_folder( package, folder->Directory, TRUE );
link_folder = msi_get_target_folder( package, directory );
ERR("unable to resolve folder %s\n", debugstr_w(directory));
return NULL;
}
/* may be needed because of a bug somewhere else */
msi_create_full_path( link_folder );
......
......@@ -213,8 +213,18 @@ UINT msi_strcpy_to_awstring( LPCWSTR str, awstring *awbuf, DWORD *sz )
const WCHAR *msi_get_target_folder( MSIPACKAGE *package, const WCHAR *name )
{
MSIFOLDER *folder = msi_get_loaded_folder( package, name );
if (folder) return folder->ResolvedTarget;
return NULL;
if (!folder) return NULL;
if (!folder->ResolvedTarget)
{
MSIFOLDER *parent = folder;
while (parent->Parent && strcmpW( parent->Parent, parent->Directory ))
{
parent = msi_get_loaded_folder( package, parent->Parent );
}
msi_resolve_target_folder( package, parent->Directory, TRUE );
}
return folder->ResolvedTarget;
}
/***********************************************************************
......
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