Commit 6b38139e authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

msi: Remove a level of indent in resolve_folder().

parent 4052b8be
...@@ -201,7 +201,7 @@ LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source, ...@@ -201,7 +201,7 @@ LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source,
BOOL set_prop, MSIFOLDER **folder) BOOL set_prop, MSIFOLDER **folder)
{ {
MSIFOLDER *f; MSIFOLDER *f;
LPWSTR p, path = NULL; LPWSTR p, path = NULL, parent;
TRACE("Working to resolve %s\n",debugstr_w(name)); TRACE("Working to resolve %s\n",debugstr_w(name));
...@@ -267,60 +267,61 @@ LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source, ...@@ -267,60 +267,61 @@ LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source,
return path; return path;
} }
if (f->Parent) if (!f->Parent)
{ return path;
LPWSTR parent = f->Parent->Directory;
TRACE(" ! Parent is %s\n", debugstr_w(parent)); parent = f->Parent->Directory;
p = resolve_folder(package, parent, source, set_prop, NULL); TRACE(" ! Parent is %s\n", debugstr_w(parent));
if (!source)
{
TRACE(" TargetDefault = %s\n", debugstr_w(f->TargetDefault));
path = build_directory_name( 3, p, f->TargetDefault, NULL ); p = resolve_folder(package, parent, source, set_prop, NULL);
clean_spaces_from_path( path ); if (!source)
f->ResolvedTarget = strdupW( path ); {
TRACE("target -> %s\n", debugstr_w(path)); TRACE(" TargetDefault = %s\n", debugstr_w(f->TargetDefault));
if (set_prop)
MSI_SetPropertyW(package,name,path);
}
else
{
/* source may be in a few different places ... check each of them */
path = NULL;
/* try the long path directory */ path = build_directory_name( 3, p, f->TargetDefault, NULL );
if (f->SourceLongPath) clean_spaces_from_path( path );
f->ResolvedTarget = strdupW( path );
TRACE("target -> %s\n", debugstr_w(path));
if (set_prop)
MSI_SetPropertyW(package,name,path);
}
else
{
/* source may be in a few different places ... check each of them */
path = NULL;
/* try the long path directory */
if (f->SourceLongPath)
{
path = build_directory_name( 3, p, f->SourceLongPath, NULL );
if (INVALID_FILE_ATTRIBUTES == GetFileAttributesW( path ))
{ {
path = build_directory_name( 3, p, f->SourceLongPath, NULL ); msi_free( path );
if (INVALID_FILE_ATTRIBUTES == GetFileAttributesW( path )) path = NULL;
{
msi_free( path );
path = NULL;
}
} }
}
/* try the short path directory */ /* try the short path directory */
if (!path && f->SourceShortPath) if (!path && f->SourceShortPath)
{
path = build_directory_name( 3, p, f->SourceShortPath, NULL );
if (INVALID_FILE_ATTRIBUTES == GetFileAttributesW( path ))
{ {
path = build_directory_name( 3, p, f->SourceShortPath, NULL ); msi_free( path );
if (INVALID_FILE_ATTRIBUTES == GetFileAttributesW( path )) path = NULL;
{
msi_free( path );
path = NULL;
}
} }
}
/* try the root of the install */ /* try the root of the install */
if (!path) if (!path)
path = get_source_root( package ); path = get_source_root( package );
TRACE("source -> %s\n", debugstr_w(path)); TRACE("source -> %s\n", debugstr_w(path));
f->ResolvedSource = strdupW( path ); f->ResolvedSource = strdupW( path );
}
msi_free(p);
} }
msi_free(p);
return path; return 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