Skip to content

Commit 07f42a0

Browse files
winesynclearn-more
authored andcommitted
[WINESYNC] msi/tests: Test deferral of InstallServices.
Signed-off-by: Zebediah Figura <[email protected]> Signed-off-by: Hans Leidekker <[email protected]> Signed-off-by: Alexandre Julliard <[email protected]> wine commit id b8f982fa4b190398edce45290cd49159d586a26b by Zebediah Figura <[email protected]>
1 parent 49a44f0 commit 07f42a0

File tree

3 files changed

+55
-1
lines changed

3 files changed

+55
-1
lines changed

modules/rostests/winetests/msi/action.c

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,34 @@ static const char sds_custom_action_dat[] =
301301
"sds_immediate\t1\tcustom.dll\tsds_present\n"
302302
"sds_deferred\t1025\tcustom.dll\tsds_absent\n";
303303

304+
static const char sis_install_exec_seq_dat[] =
305+
"Action\tCondition\tSequence\n"
306+
"s72\tS255\tI2\n"
307+
"InstallExecuteSequence\tAction\n"
308+
"CostInitialize\t\t800\n"
309+
"FileCost\t\t900\n"
310+
"CostFinalize\t\t1000\n"
311+
"InstallValidate\t\t1400\n"
312+
"InstallInitialize\t\t1500\n"
313+
"StopServices\t\t5000\n"
314+
"DeleteServices\t\t5050\n"
315+
"InstallFiles\t\t5200\n"
316+
"InstallServices\t\t5400\n"
317+
"sis_immediate\tNOT REMOVE\t5401\n"
318+
"sis_deferred\tNOT REMOVE\t5402\n"
319+
"StartServices\t\t5450\n"
320+
"RegisterProduct\t\t5500\n"
321+
"PublishFeatures\t\t5600\n"
322+
"PublishProduct\t\t5700\n"
323+
"InstallFinalize\t\t6000\n";
324+
325+
static const char sis_custom_action_dat[] =
326+
"Action\tType\tSource\tTarget\n"
327+
"s72\ti2\tS64\tS0\n"
328+
"CustomAction\tAction\n"
329+
"sis_immediate\t1\tcustom.dll\tsis_absent\n"
330+
"sis_deferred\t1025\tcustom.dll\tsis_present\n";
331+
304332
static const char rof_component_dat[] =
305333
"Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
306334
"s72\tS38\ts72\ti2\tS255\tS72\n"
@@ -1846,7 +1874,8 @@ static const msi_table sis_tables[] =
18461874
ADD_TABLE(feature),
18471875
ADD_TABLE(feature_comp),
18481876
ADD_TABLE(file),
1849-
ADD_TABLE(sds_install_exec_seq),
1877+
ADD_TABLE(sis_install_exec_seq),
1878+
ADD_TABLE(sis_custom_action),
18501879
ADD_TABLE(service_install2),
18511880
ADD_TABLE(media),
18521881
ADD_TABLE(property)

modules/rostests/winetests/msi/custom.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,3 +1216,26 @@ UINT WINAPI sds_absent(MSIHANDLE hinst)
12161216
CloseServiceHandle(manager);
12171217
return ERROR_SUCCESS;
12181218
}
1219+
1220+
UINT WINAPI sis_present(MSIHANDLE hinst)
1221+
{
1222+
SC_HANDLE manager, service;
1223+
manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
1224+
service = OpenServiceA(manager, "TestService", GENERIC_ALL);
1225+
ok(hinst, !!service, "service absent: %u\n", GetLastError());
1226+
CloseServiceHandle(service);
1227+
CloseServiceHandle(manager);
1228+
return ERROR_SUCCESS;
1229+
}
1230+
1231+
UINT WINAPI sis_absent(MSIHANDLE hinst)
1232+
{
1233+
SC_HANDLE manager, service;
1234+
manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
1235+
service = OpenServiceA(manager, "TestService", GENERIC_ALL);
1236+
todo_wine
1237+
ok(hinst, !service, "service present\n");
1238+
if (service) CloseServiceHandle(service);
1239+
CloseServiceHandle(manager);
1240+
return ERROR_SUCCESS;
1241+
}

modules/rostests/winetests/msi/custom.spec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@
99
@ stdcall crs_absent(long)
1010
@ stdcall sds_present(long)
1111
@ stdcall sds_absent(long)
12+
@ stdcall sis_present(long)
13+
@ stdcall sis_absent(long)

0 commit comments

Comments
 (0)