Skip to content

Commit 074bd3b

Browse files
winesynclearn-more
authored andcommitted
[WINESYNC] 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 <[email protected]> Signed-off-by: Hans Leidekker <[email protected]> Signed-off-by: Alexandre Julliard <[email protected]> wine commit id 920dde0b1e1d137720a277ee05b65c6bf2387ad6 by Zebediah Figura <[email protected]>
1 parent 3a2e2e6 commit 074bd3b

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed

modules/rostests/winetests/msi/action.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,18 +399,26 @@ static const char pp_install_exec_seq_dat[] =
399399
"ppc_immediate\tPROCESS_COMPONENTS AND ALLUSERS\t1601\n"
400400
"ppc_deferred\tPROCESS_COMPONENTS AND ALLUSERS\t1602\n"
401401
"UnpublishFeatures\tUNPUBLISH_FEATURES=1 Or FULL=1\t1800\n"
402+
"uf_immediate\tUNPUBLISH_FEATURES AND ALLUSERS\t1801\n"
403+
"uf_deferred\tUNPUBLISH_FEATURES AND ALLUSERS\t1802\n"
402404
"RemoveFiles\t\t3500\n"
403405
"InstallFiles\t\t4000\n"
404406
"RegisterUser\tREGISTER_USER=1 Or FULL=1\t6000\n"
405407
"RegisterProduct\tREGISTER_PRODUCT=1 Or FULL=1\t6100\n"
406408
"PublishFeatures\tPUBLISH_FEATURES=1 Or FULL=1\t6300\n"
409+
"pf_immediate\tPUBLISH_FEATURES AND ALLUSERS\t6301\n"
410+
"pf_deferred\tPUBLISH_FEATURES AND ALLUSERS\t6302\n"
407411
"PublishProduct\tPUBLISH_PRODUCT=1 Or FULL=1\t6400\n"
408412
"InstallFinalize\t\t6600";
409413

410414
static const char pp_custom_action_dat[] =
411415
"Action\tType\tSource\tTarget\n"
412416
"s72\ti2\tS64\tS0\n"
413417
"CustomAction\tAction\n"
418+
"pf_immediate\t1\tcustom.dll\tpf_absent\n"
419+
"pf_deferred\t1025\tcustom.dll\tpf_present\n"
420+
"uf_immediate\t1\tcustom.dll\tpf_present\n"
421+
"uf_deferred\t1025\tcustom.dll\tpf_absent\n"
414422
"ppc_immediate\t1\tcustom.dll\tppc_absent\n"
415423
"ppc_deferred\t1025\tcustom.dll\tppc_present\n";
416424

@@ -1763,6 +1771,7 @@ static const char pa_install_exec_seq_dat[] =
17631771
"RegisterProduct\t\t5000\n"
17641772
"PublishFeatures\t\t5100\n"
17651773
"PublishProduct\t\t5200\n"
1774+
"UnpublishFeatures\t\t5300\n"
17661775
"InstallFinalize\t\t6000\n";
17671776

17681777
static const char pa_custom_action_dat[] =
@@ -1865,6 +1874,7 @@ static const msi_table pp_tables[] =
18651874
ADD_TABLE(rof_feature_comp),
18661875
ADD_TABLE(rof_file),
18671876
ADD_TABLE(pp_install_exec_seq),
1877+
ADD_TABLE(pp_custom_action),
18681878
ADD_TABLE(rof_media),
18691879
ADD_TABLE(property),
18701880
};

modules/rostests/winetests/msi/custom.c

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,3 +1494,45 @@ todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED))
14941494
ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
14951495
return ERROR_SUCCESS;
14961496
}
1497+
1498+
static const char pf_classkey[] = "Installer\\Features\\84A88FD7F6998CE40A22FB59F6B9C2BB";
1499+
static const char pf_userkey[] = "Software\\Microsoft\\Windows\\CurrentVersion\\"
1500+
"Installer\\UserData\\S-1-5-18\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB\\Features";
1501+
1502+
UINT WINAPI pf_present(MSIHANDLE hinst)
1503+
{
1504+
HKEY key;
1505+
LONG res;
1506+
1507+
todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) {
1508+
res = RegOpenKeyExA(HKEY_CLASSES_ROOT, pf_classkey, 0, KEY_READ | KEY_WOW64_64KEY, &key);
1509+
ok(hinst, !res, "got %u\n", res);
1510+
check_reg_str(hinst, key, "feature", "");
1511+
check_reg_str(hinst, key, "montecristo", "");
1512+
RegCloseKey(key);
1513+
1514+
res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, pf_userkey, 0, KEY_READ | KEY_WOW64_64KEY, &key);
1515+
ok(hinst, !res, "got %u\n", res);
1516+
check_reg_str(hinst, key, "feature", "VGtfp^p+,?82@JU1j_KE");
1517+
check_reg_str(hinst, key, "montecristo", "VGtfp^p+,?82@JU1j_KE");
1518+
RegCloseKey(key);
1519+
}
1520+
1521+
return ERROR_SUCCESS;
1522+
}
1523+
1524+
UINT WINAPI pf_absent(MSIHANDLE hinst)
1525+
{
1526+
HKEY key;
1527+
LONG res;
1528+
1529+
res = RegOpenKeyExA(HKEY_CLASSES_ROOT, pf_classkey, 0, KEY_READ | KEY_WOW64_64KEY, &key);
1530+
todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED))
1531+
ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
1532+
1533+
res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, pf_userkey, 0, KEY_READ | KEY_WOW64_64KEY, &key);
1534+
todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED))
1535+
ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
1536+
1537+
return ERROR_SUCCESS;
1538+
}

modules/rostests/winetests/msi/custom.spec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
@ stdcall odbc_absent(long)
1616
@ stdcall pa_present(long)
1717
@ stdcall pa_absent(long)
18+
@ stdcall pf_present(long)
19+
@ stdcall pf_absent(long)
1820
@ stdcall ppc_present(long)
1921
@ stdcall ppc_absent(long)
2022
@ stdcall pub_present(long)

0 commit comments

Comments
 (0)