Skip to content

Commit 13c1677

Browse files
winesynclearn-more
authored andcommitted
[WINESYNC] msi/tests: Test deferral of RegisterFonts and UnregisterFonts.
Signed-off-by: Zebediah Figura <[email protected]> Signed-off-by: Hans Leidekker <[email protected]> Signed-off-by: Alexandre Julliard <[email protected]> wine commit id a364e1a9c8aeba972f13f1af13cd0643b9a05a8e by Zebediah Figura <[email protected]>
1 parent 22740df commit 13c1677

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

modules/rostests/winetests/msi/action.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,13 +799,26 @@ static const char font_install_exec_seq_dat[] =
799799
"RemoveFiles\t\t3500\n"
800800
"InstallFiles\t\t4000\n"
801801
"RegisterFonts\t\t4100\n"
802+
"rf_immediate\tNOT REMOVE\t4101\n"
803+
"rf_deferred\tNOT REMOVE\t4102\n"
802804
"UnregisterFonts\t\t4200\n"
805+
"uf_immediate\tREMOVE\t4201\n"
806+
"uf_deferred\tREMOVE\t4202\n"
803807
"RegisterUser\t\t6000\n"
804808
"RegisterProduct\t\t6100\n"
805809
"PublishFeatures\t\t6300\n"
806810
"PublishProduct\t\t6400\n"
807811
"InstallFinalize\t\t6600";
808812

813+
static const char font_custom_action_dat[] =
814+
"Action\tType\tSource\tTarget\n"
815+
"s72\ti2\tS64\tS0\n"
816+
"CustomAction\tAction\n"
817+
"rf_immediate\t1\tcustom.dll\tfont_absent\n"
818+
"rf_deferred\t1025\tcustom.dll\tfont_present\n"
819+
"uf_immediate\t1\tcustom.dll\tfont_present\n"
820+
"uf_deferred\t1025\tcustom.dll\tfont_absent\n";
821+
809822
static const char vp_property_dat[] =
810823
"Property\tValue\n"
811824
"s72\tl0\n"
@@ -2054,6 +2067,7 @@ static const msi_table font_tables[] =
20542067
ADD_TABLE(font_file),
20552068
ADD_TABLE(font),
20562069
ADD_TABLE(font_install_exec_seq),
2070+
ADD_TABLE(font_custom_action),
20572071
ADD_TABLE(font_media),
20582072
ADD_TABLE(property)
20592073
};

modules/rostests/winetests/msi/custom.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1642,3 +1642,35 @@ todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) {
16421642

16431643
return ERROR_SUCCESS;
16441644
}
1645+
1646+
static const char font_key[] = "Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts";
1647+
1648+
UINT WINAPI font_present(MSIHANDLE hinst)
1649+
{
1650+
HKEY key;
1651+
LONG res;
1652+
1653+
res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, font_key, 0, KEY_QUERY_VALUE | KEY_WOW64_64KEY, &key);
1654+
ok(hinst, !res, "got %u\n", res);
1655+
res = RegQueryValueExA(key, "msi test font", NULL, NULL, NULL, NULL);
1656+
todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED))
1657+
ok(hinst, !res, "got %u\n", res);
1658+
RegCloseKey(key);
1659+
1660+
return ERROR_SUCCESS;
1661+
}
1662+
1663+
UINT WINAPI font_absent(MSIHANDLE hinst)
1664+
{
1665+
HKEY key;
1666+
LONG res;
1667+
1668+
res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, font_key, 0, KEY_QUERY_VALUE | KEY_WOW64_64KEY, &key);
1669+
ok(hinst, !res, "got %u\n", res);
1670+
todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) {
1671+
check_reg_str(hinst, key, "msi test font", NULL);
1672+
}
1673+
RegCloseKey(key);
1674+
1675+
return ERROR_SUCCESS;
1676+
}

modules/rostests/winetests/msi/custom.spec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
@ stdcall crs_absent(long)
1010
@ stdcall file_present(long)
1111
@ stdcall file_absent(long)
12+
@ stdcall font_present(long)
13+
@ stdcall font_absent(long)
1214
@ stdcall mov_present(long)
1315
@ stdcall mov_absent(long)
1416
@ stdcall odbc_present(long)

0 commit comments

Comments
 (0)