Skip to content

Commit 3a2e2e6

Browse files
winesynclearn-more
authored andcommitted
[WINESYNC] msi/tests: Test deferral of PublishComponents and UnpublishComponents.
Signed-off-by: Zebediah Figura <[email protected]> Signed-off-by: Hans Leidekker <[email protected]> Signed-off-by: Alexandre Julliard <[email protected]> wine commit id 625ef14967984ef2f35638e0012ceb7c816f346c by Zebediah Figura <[email protected]>
1 parent 29e57f7 commit 3a2e2e6

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

modules/rostests/winetests/msi/action.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,12 +1086,25 @@ static const char pub_install_exec_seq_dat[] =
10861086
"RemoveFiles\t\t1700\n"
10871087
"InstallFiles\t\t2000\n"
10881088
"PublishComponents\t\t3000\n"
1089+
"pub_immediate\tNOT REMOVE\t3001\n"
1090+
"pub_deferred\tNOT REMOVE\t3002\n"
10891091
"UnpublishComponents\t\t3100\n"
1092+
"unp_immediate\tREMOVE\t3101\n"
1093+
"unp_deferred\tREMOVE\t3102\n"
10901094
"RegisterProduct\t\t5000\n"
10911095
"PublishFeatures\t\t5100\n"
10921096
"PublishProduct\t\t5200\n"
10931097
"InstallFinalize\t\t6000\n";
10941098

1099+
static const char pub_custom_action_dat[] =
1100+
"Action\tType\tSource\tTarget\n"
1101+
"s72\ti2\tS64\tS0\n"
1102+
"CustomAction\tAction\n"
1103+
"pub_immediate\t1\tcustom.dll\tpub_absent\n"
1104+
"pub_deferred\t1025\tcustom.dll\tpub_present\n"
1105+
"unp_immediate\t1\tcustom.dll\tpub_present\n"
1106+
"unp_deferred\t1025\tcustom.dll\tpub_absent\n";
1107+
10951108
static const char rd_file_dat[] =
10961109
"File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
10971110
"s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
@@ -2070,6 +2083,7 @@ static const msi_table pub_tables[] =
20702083
ADD_TABLE(pub_file),
20712084
ADD_TABLE(pub_publish_component),
20722085
ADD_TABLE(pub_install_exec_seq),
2086+
ADD_TABLE(pub_custom_action),
20732087
ADD_TABLE(media),
20742088
ADD_TABLE(property)
20752089
};

modules/rostests/winetests/msi/custom.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,3 +1466,31 @@ todo_wine
14661466
ok(hinst, r == ERROR_FILE_NOT_FOUND, "got %u\n", r);
14671467
return ERROR_SUCCESS;
14681468
}
1469+
1470+
static const char pub_key[] = "Software\\Microsoft\\Installer\\Components\\0CBCFA296AC907244845745CEEB2F8AA";
1471+
1472+
UINT WINAPI pub_present(MSIHANDLE hinst)
1473+
{
1474+
HKEY key;
1475+
LONG res;
1476+
1477+
todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) {
1478+
res = RegOpenKeyA(HKEY_CURRENT_USER, pub_key, &key);
1479+
ok(hinst, !res, "got %u\n", res);
1480+
res = RegQueryValueExA(key, "english.txt", NULL, NULL, NULL, NULL);
1481+
ok(hinst, !res, "got %u\n", res);
1482+
}
1483+
RegCloseKey(key);
1484+
return ERROR_SUCCESS;
1485+
}
1486+
1487+
UINT WINAPI pub_absent(MSIHANDLE hinst)
1488+
{
1489+
HKEY key;
1490+
LONG res;
1491+
1492+
res = RegOpenKeyA(HKEY_CURRENT_USER, pub_key, &key);
1493+
todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED))
1494+
ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
1495+
return ERROR_SUCCESS;
1496+
}

modules/rostests/winetests/msi/custom.spec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
@ stdcall pa_absent(long)
1818
@ stdcall ppc_present(long)
1919
@ stdcall ppc_absent(long)
20+
@ stdcall pub_present(long)
21+
@ stdcall pub_absent(long)
2022
@ stdcall rd_present(long)
2123
@ stdcall rd_absent(long)
2224
@ stdcall sds_present(long)

0 commit comments

Comments
 (0)