Skip to content

Commit ef7637b

Browse files
winesynclearn-more
authored andcommitted
[WINESYNC] msi/tests: Test deferral of MsiPublishAssemblies and MsiUnpublishAssemblies.
Signed-off-by: Zebediah Figura <[email protected]> Signed-off-by: Hans Leidekker <[email protected]> Signed-off-by: Alexandre Julliard <[email protected]> wine commit id 6eb74409147751a69cbf7dff34d79bd7e3a5dc7a by Zebediah Figura <[email protected]>
1 parent 51f5b07 commit ef7637b

File tree

3 files changed

+71
-0
lines changed

3 files changed

+71
-0
lines changed

modules/rostests/winetests/msi/action.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1733,12 +1733,25 @@ static const char pa_install_exec_seq_dat[] =
17331733
"InstallInitialize\t\t1500\n"
17341734
"ProcessComponents\t\t1600\n"
17351735
"MsiPublishAssemblies\t\t3000\n"
1736+
"pa_immediate\tNOT REMOVE AND NOT ALLUSERS\t3001\n"
1737+
"pa_deferred\tNOT REMOVE AND NOT ALLUSERS\t3002\n"
17361738
"MsiUnpublishAssemblies\t\t4000\n"
1739+
"ua_immediate\tREMOVE AND NOT ALLUSERS\t4001\n"
1740+
"ua_deferred\tREMOVE AND NOT ALLUSERS\t4002\n"
17371741
"RegisterProduct\t\t5000\n"
17381742
"PublishFeatures\t\t5100\n"
17391743
"PublishProduct\t\t5200\n"
17401744
"InstallFinalize\t\t6000\n";
17411745

1746+
static const char pa_custom_action_dat[] =
1747+
"Action\tType\tSource\tTarget\n"
1748+
"s72\ti2\tS64\tS0\n"
1749+
"CustomAction\tAction\n"
1750+
"pa_immediate\t1\tcustom.dll\tpa_absent\n"
1751+
"pa_deferred\t1025\tcustom.dll\tpa_present\n"
1752+
"ua_immediate\t1\tcustom.dll\tpa_present\n"
1753+
"ua_deferred\t1025\tcustom.dll\tpa_absent\n";
1754+
17421755
static const char rep_file_dat[] =
17431756
"File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
17441757
"s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
@@ -2191,6 +2204,7 @@ static const msi_table pa_tables[] =
21912204
ADD_TABLE(pa_msi_assembly),
21922205
ADD_TABLE(pa_msi_assembly_name),
21932206
ADD_TABLE(pa_install_exec_seq),
2207+
ADD_TABLE(pa_custom_action),
21942208
ADD_TABLE(media),
21952209
ADD_TABLE(property)
21962210
};

modules/rostests/winetests/msi/custom.c

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,3 +1379,58 @@ todo_wine {
13791379
}
13801380
return ERROR_SUCCESS;
13811381
}
1382+
1383+
static void check_reg_str(MSIHANDLE hinst, HKEY key, const char *name, const char *expect)
1384+
{
1385+
char value[300];
1386+
DWORD sz;
1387+
LONG res;
1388+
1389+
sz = sizeof(value);
1390+
res = RegQueryValueExA(key, name, NULL, NULL, (BYTE *)value, &sz);
1391+
if (expect)
1392+
{
1393+
ok(hinst, !res, "failed to get value \"%s\": %d\n", name, res);
1394+
ok(hinst, !strcmp(value, expect), "\"%s\": expected \"%s\", got \"%s\"\n",
1395+
name, expect, value);
1396+
}
1397+
else
1398+
ok(hinst, res == ERROR_FILE_NOT_FOUND, "\"%s\": expected missing, got %u\n",
1399+
name, res);
1400+
}
1401+
1402+
static const char path_dotnet[] = "Software\\Microsoft\\Installer\\Assemblies\\Global";
1403+
static const char name_dotnet[] = "Wine.Dotnet.Assembly,processorArchitecture=\"MSIL\","
1404+
"publicKeyToken=\"abcdef0123456789\",version=\"1.0.0.0\",culture=\"neutral\"";
1405+
1406+
UINT WINAPI pa_present(MSIHANDLE hinst)
1407+
{
1408+
HKEY key;
1409+
LONG res;
1410+
1411+
res = RegOpenKeyA(HKEY_CURRENT_USER, path_dotnet, &key);
1412+
ok(hinst, !res, "got %d\n", res);
1413+
todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) {
1414+
check_reg_str(hinst, key, name_dotnet, "rcHQPHq?CA@Uv-XqMI1e>Z'q,T*76M@=YEg6My?~]");
1415+
}
1416+
RegCloseKey(key);
1417+
1418+
return ERROR_SUCCESS;
1419+
}
1420+
1421+
UINT WINAPI pa_absent(MSIHANDLE hinst)
1422+
{
1423+
HKEY key;
1424+
LONG res;
1425+
1426+
res = RegOpenKeyA(HKEY_CURRENT_USER, path_dotnet, &key);
1427+
ok(hinst, !res || res == ERROR_FILE_NOT_FOUND, "got %d\n", res);
1428+
if (!res)
1429+
{
1430+
todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) {
1431+
check_reg_str(hinst, key, name_dotnet, NULL);
1432+
}
1433+
RegCloseKey(key);
1434+
}
1435+
return ERROR_SUCCESS;
1436+
}

modules/rostests/winetests/msi/custom.spec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@ stdcall mov_absent(long)
1414
@ stdcall odbc_present(long)
1515
@ stdcall odbc_absent(long)
16+
@ stdcall pa_present(long)
17+
@ stdcall pa_absent(long)
1618
@ stdcall rd_present(long)
1719
@ stdcall rd_absent(long)
1820
@ stdcall sds_present(long)

0 commit comments

Comments
 (0)