msi/tests: Test deferral of PublishFeatures and UnpublishFeatures.

test_publish_assemblies() was leaving behind feature data that caused this
test to fail when run multiple times.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Zebediah Figura 2018-05-24 19:14:13 -05:00 committed by Alexandre Julliard
parent 625ef14967
commit 920dde0b1e
3 changed files with 54 additions and 0 deletions

View File

@ -399,11 +399,15 @@ static const char pp_install_exec_seq_dat[] =
"ppc_immediate\tPROCESS_COMPONENTS AND ALLUSERS\t1601\n"
"ppc_deferred\tPROCESS_COMPONENTS AND ALLUSERS\t1602\n"
"UnpublishFeatures\tUNPUBLISH_FEATURES=1 Or FULL=1\t1800\n"
"uf_immediate\tUNPUBLISH_FEATURES AND ALLUSERS\t1801\n"
"uf_deferred\tUNPUBLISH_FEATURES AND ALLUSERS\t1802\n"
"RemoveFiles\t\t3500\n"
"InstallFiles\t\t4000\n"
"RegisterUser\tREGISTER_USER=1 Or FULL=1\t6000\n"
"RegisterProduct\tREGISTER_PRODUCT=1 Or FULL=1\t6100\n"
"PublishFeatures\tPUBLISH_FEATURES=1 Or FULL=1\t6300\n"
"pf_immediate\tPUBLISH_FEATURES AND ALLUSERS\t6301\n"
"pf_deferred\tPUBLISH_FEATURES AND ALLUSERS\t6302\n"
"PublishProduct\tPUBLISH_PRODUCT=1 Or FULL=1\t6400\n"
"InstallFinalize\t\t6600";
@ -411,6 +415,10 @@ static const char pp_custom_action_dat[] =
"Action\tType\tSource\tTarget\n"
"s72\ti2\tS64\tS0\n"
"CustomAction\tAction\n"
"pf_immediate\t1\tcustom.dll\tpf_absent\n"
"pf_deferred\t1025\tcustom.dll\tpf_present\n"
"uf_immediate\t1\tcustom.dll\tpf_present\n"
"uf_deferred\t1025\tcustom.dll\tpf_absent\n"
"ppc_immediate\t1\tcustom.dll\tppc_absent\n"
"ppc_deferred\t1025\tcustom.dll\tppc_present\n";
@ -1763,6 +1771,7 @@ static const char pa_install_exec_seq_dat[] =
"RegisterProduct\t\t5000\n"
"PublishFeatures\t\t5100\n"
"PublishProduct\t\t5200\n"
"UnpublishFeatures\t\t5300\n"
"InstallFinalize\t\t6000\n";
static const char pa_custom_action_dat[] =
@ -1865,6 +1874,7 @@ static const msi_table pp_tables[] =
ADD_TABLE(rof_feature_comp),
ADD_TABLE(rof_file),
ADD_TABLE(pp_install_exec_seq),
ADD_TABLE(pp_custom_action),
ADD_TABLE(rof_media),
ADD_TABLE(property),
};

View File

@ -1494,3 +1494,45 @@ todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED))
ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
return ERROR_SUCCESS;
}
static const char pf_classkey[] = "Installer\\Features\\84A88FD7F6998CE40A22FB59F6B9C2BB";
static const char pf_userkey[] = "Software\\Microsoft\\Windows\\CurrentVersion\\"
"Installer\\UserData\\S-1-5-18\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB\\Features";
UINT WINAPI pf_present(MSIHANDLE hinst)
{
HKEY key;
LONG res;
todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) {
res = RegOpenKeyExA(HKEY_CLASSES_ROOT, pf_classkey, 0, KEY_READ | KEY_WOW64_64KEY, &key);
ok(hinst, !res, "got %u\n", res);
check_reg_str(hinst, key, "feature", "");
check_reg_str(hinst, key, "montecristo", "");
RegCloseKey(key);
res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, pf_userkey, 0, KEY_READ | KEY_WOW64_64KEY, &key);
ok(hinst, !res, "got %u\n", res);
check_reg_str(hinst, key, "feature", "VGtfp^p+,?82@JU1j_KE");
check_reg_str(hinst, key, "montecristo", "VGtfp^p+,?82@JU1j_KE");
RegCloseKey(key);
}
return ERROR_SUCCESS;
}
UINT WINAPI pf_absent(MSIHANDLE hinst)
{
HKEY key;
LONG res;
res = RegOpenKeyExA(HKEY_CLASSES_ROOT, pf_classkey, 0, KEY_READ | KEY_WOW64_64KEY, &key);
todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED))
ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, pf_userkey, 0, KEY_READ | KEY_WOW64_64KEY, &key);
todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED))
ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
return ERROR_SUCCESS;
}

View File

@ -15,6 +15,8 @@
@ stdcall odbc_absent(long)
@ stdcall pa_present(long)
@ stdcall pa_absent(long)
@ stdcall pf_present(long)
@ stdcall pf_absent(long)
@ stdcall ppc_present(long)
@ stdcall ppc_absent(long)
@ stdcall pub_present(long)