Hans Leidekker : msi: Search network sources in addition to disk sources.
Alexandre Julliard
julliard at winehq.org
Tue Mar 23 12:12:48 CDT 2010
Module: wine
Branch: master
Commit: 1d453a1ff08ea3bbc8a519f19a94dcf4f215d874
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1d453a1ff08ea3bbc8a519f19a94dcf4f215d874
Author: Hans Leidekker <hans at codeweavers.com>
Date: Tue Mar 23 11:48:46 2010 +0100
msi: Search network sources in addition to disk sources.
---
dlls/msi/media.c | 32 +++++++++++++++++++++++++++++++-
1 files changed, 31 insertions(+), 1 deletions(-)
diff --git a/dlls/msi/media.c b/dlls/msi/media.c
index 5e70d50..5c53027 100644
--- a/dlls/msi/media.c
+++ b/dlls/msi/media.c
@@ -686,7 +686,7 @@ static UINT msi_load_media_info(MSIPACKAGE *package, MSIFILE *file, MSIMEDIAINFO
return ERROR_SUCCESS;
}
-/* FIXME: search NETWORK and URL sources as well */
+/* FIXME: search URL sources as well */
static UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi)
{
WCHAR source[MAX_PATH];
@@ -694,8 +694,16 @@ static UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi)
WCHAR prompt[MAX_PATH];
DWORD volumesz, promptsz;
DWORD index, size, id;
+ WCHAR last_type[2];
UINT r;
+ size = 2;
+ r = MsiSourceListGetInfoW(package->ProductCode, NULL,
+ package->Context, MSICODE_PRODUCT,
+ INSTALLPROPERTY_LASTUSEDTYPEW, last_type, &size);
+ if (r != ERROR_SUCCESS)
+ return r;
+
size = MAX_PATH;
r = MsiSourceListGetInfoW(package->ProductCode, NULL,
package->Context, MSICODE_PRODUCT,
@@ -706,6 +714,27 @@ static UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi)
index = 0;
volumesz = MAX_PATH;
promptsz = MAX_PATH;
+
+ if (last_type[0] == 'n')
+ {
+ while (MsiSourceListEnumSourcesW(package->ProductCode, NULL,
+ package->Context,
+ MSISOURCETYPE_NETWORK, index++,
+ volume, &volumesz) == ERROR_SUCCESS)
+ {
+ if (!strncmpiW(source, volume, strlenW(source)))
+ {
+ lstrcpyW(mi->source, source);
+ lstrcatW(mi->source, mi->cabinet);
+ TRACE("Found network source %s\n", debugstr_w(mi->source));
+ return ERROR_SUCCESS;
+ }
+ }
+ }
+
+ index = 0;
+ volumesz = MAX_PATH;
+ promptsz = MAX_PATH;
while (MsiSourceListEnumMediaDisksW(package->ProductCode, NULL,
package->Context,
MSICODE_PRODUCT, index++, &id,
@@ -721,6 +750,7 @@ static UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi)
{
/* FIXME: what about SourceDir */
lstrcpyW(mi->source, source);
+ TRACE("Found disk source %s\n", debugstr_w(mi->source));
return ERROR_SUCCESS;
}
}
More information about the wine-cvs
mailing list