Commit 920dde0b authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

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: 's avatarZebediah Figura <z.figura12@gmail.com> Signed-off-by: 's avatarHans Leidekker <hans@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 625ef149
......@@ -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),
};
......
......@@ -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;
}
......@@ -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)
......
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