msi: Check other sources if install media not present at last used location.
This commit is contained in:
parent
599b30833a
commit
477702c829
|
@ -748,24 +748,45 @@ static UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi)
|
||||||
if (r != ERROR_SUCCESS)
|
if (r != ERROR_SUCCESS)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
index = 0;
|
|
||||||
volumesz = MAX_PATH;
|
|
||||||
promptsz = MAX_PATH;
|
|
||||||
|
|
||||||
if (last_type[0] == 'n')
|
if (last_type[0] == 'n')
|
||||||
{
|
{
|
||||||
|
WCHAR cabinet_file[MAX_PATH];
|
||||||
|
BOOL check_all = FALSE;
|
||||||
|
|
||||||
|
while(TRUE)
|
||||||
|
{
|
||||||
|
index = 0;
|
||||||
|
volumesz = MAX_PATH;
|
||||||
while (MsiSourceListEnumSourcesW(package->ProductCode, NULL,
|
while (MsiSourceListEnumSourcesW(package->ProductCode, NULL,
|
||||||
package->Context,
|
package->Context,
|
||||||
MSISOURCETYPE_NETWORK, index++,
|
MSISOURCETYPE_NETWORK, index++,
|
||||||
volume, &volumesz) == ERROR_SUCCESS)
|
volume, &volumesz) == ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
if (!strncmpiW(source, volume, strlenW(source)))
|
if (check_all || !strncmpiW(source, volume, strlenW(source)))
|
||||||
{
|
{
|
||||||
lstrcpyW(mi->sourcedir, source);
|
lstrcpyW(cabinet_file, volume);
|
||||||
|
PathAddBackslashW(cabinet_file);
|
||||||
|
lstrcatW(cabinet_file, mi->cabinet);
|
||||||
|
|
||||||
|
if (GetFileAttributesW(cabinet_file) == INVALID_FILE_ATTRIBUTES)
|
||||||
|
{
|
||||||
|
volumesz = MAX_PATH;
|
||||||
|
if(!check_all)
|
||||||
|
break;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
lstrcpyW(mi->sourcedir, volume);
|
||||||
TRACE("Found network source %s\n", debugstr_w(mi->sourcedir));
|
TRACE("Found network source %s\n", debugstr_w(mi->sourcedir));
|
||||||
return ERROR_SUCCESS;
|
return ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!check_all)
|
||||||
|
check_all = TRUE;
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
index = 0;
|
index = 0;
|
||||||
|
|
Loading…
Reference in New Issue