Commit 3de00147 authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

msi: Publish a few SourceList properties.

parent 2d5ba8d2
......@@ -3389,12 +3389,16 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package)
HKEY hkey=0;
HKEY hukey=0;
HKEY hudkey=0, props=0;
HKEY source;
static const WCHAR szProductLanguage[] =
{'P','r','o','d','u','c','t','L','a','n','g','u','a','g','e',0};
static const WCHAR szARPProductIcon[] =
{'A','R','P','P','R','O','D','U','C','T','I','C','O','N',0};
static const WCHAR szProductVersion[] =
{'P','r','o','d','u','c','t','V','e','r','s','i','o','n',0};
static const WCHAR szSourceList[] =
{'S','o','u','r','c','e','L','i','s','t',0};
static const WCHAR szEmpty[] = {0};
DWORD langid;
LPWSTR buffer;
DWORD size;
......@@ -3423,6 +3427,12 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package)
if (rc != ERROR_SUCCESS)
goto end;
rc = RegCreateKeyW(hukey, szSourceList, &source);
if (rc != ERROR_SUCCESS)
goto end;
RegCloseKey(source);
rc = MSIREG_OpenUserDataProductKey(package->ProductCode,&hudkey,TRUE);
if (rc != ERROR_SUCCESS)
goto end;
......@@ -3455,6 +3465,35 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package)
}
msi_free(buffer);
buffer = strrchrW( package->PackagePath, '\\') + 1;
rc = MsiSourceListSetInfoW( package->ProductCode, NULL,
MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT,
INSTALLPROPERTY_PACKAGENAMEW, buffer );
if (rc != ERROR_SUCCESS)
goto end;
rc = MsiSourceListSetInfoW( package->ProductCode, NULL,
MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT,
INSTALLPROPERTY_MEDIAPACKAGEPATHW, szEmpty );
if (rc != ERROR_SUCCESS)
goto end;
rc = MsiSourceListSetInfoW( package->ProductCode, NULL,
MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT,
INSTALLPROPERTY_DISKPROMPTW, szEmpty );
if (rc != ERROR_SUCCESS)
goto end;
buffer = msi_dup_property( package, cszSourceDir );
rc = MsiSourceListSetInfoW( package->ProductCode, NULL,
MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT | MSISOURCETYPE_NETWORK,
INSTALLPROPERTY_LASTUSEDSOURCEW, buffer );
msi_free(buffer);
if (rc != ERROR_SUCCESS)
goto end;
/* FIXME: Need to write more keys to the user registry */
hDb= alloc_msihandle( &package->db->hdr );
......
......@@ -2990,12 +2990,9 @@ static void test_publishsourcelist(void)
lstrcpyA(value, "aaa");
r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, value, &size);
todo_wine
{
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, "msitest.msi"), "Expected 'msitest.msi', got %s\n", value);
ok(size == 11, "Expected 11, got %d\n", size);
}
size = MAX_PATH;
lstrcpyA(value, "aaa");
......@@ -3012,12 +3009,9 @@ static void test_publishsourcelist(void)
lstrcpyA(value, "aaa");
r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_DISKPROMPT, value, &size);
todo_wine
{
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, ""), "Expected \"\", got \"%s\"\n", value);
ok(size == 0, "Expected 0, got %d\n", size);
}
lstrcpyA(path, CURR_DIR);
lstrcatA(path, "\\");
......@@ -3048,10 +3042,7 @@ static void test_publishsourcelist(void)
lstrcpyA(value, "aaa");
r = MsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
todo_wine
{
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
}
ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
ok(size == MAX_PATH, "Expected MAX_PATH, got %d\n", size);
......@@ -3059,21 +3050,15 @@ static void test_publishsourcelist(void)
lstrcpyA(value, "aaa");
r = MsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
todo_wine
{
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
ok(size == lstrlenA(path), "Expected %d, got %d\n", lstrlenA(path), size);
}
size = MAX_PATH;
lstrcpyA(value, "aaa");
r = MsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 1, value, &size);
todo_wine
{
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
}
ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
ok(size == MAX_PATH, "Expected MAX_PATH, got %d\n", size);
......
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