msi/tests: Test deferral of InstallServices.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2018-05-17 22:26:11 -05:00 committed by Alexandre Julliard
parent 5d8e16f701
commit b8f982fa4b
3 changed files with 55 additions and 1 deletions

View File

@ -301,6 +301,34 @@ static const char sds_custom_action_dat[] =
"sds_immediate\t1\tcustom.dll\tsds_present\n"
"sds_deferred\t1025\tcustom.dll\tsds_absent\n";
static const char sis_install_exec_seq_dat[] =
"Action\tCondition\tSequence\n"
"s72\tS255\tI2\n"
"InstallExecuteSequence\tAction\n"
"CostInitialize\t\t800\n"
"FileCost\t\t900\n"
"CostFinalize\t\t1000\n"
"InstallValidate\t\t1400\n"
"InstallInitialize\t\t1500\n"
"StopServices\t\t5000\n"
"DeleteServices\t\t5050\n"
"InstallFiles\t\t5200\n"
"InstallServices\t\t5400\n"
"sis_immediate\tNOT REMOVE\t5401\n"
"sis_deferred\tNOT REMOVE\t5402\n"
"StartServices\t\t5450\n"
"RegisterProduct\t\t5500\n"
"PublishFeatures\t\t5600\n"
"PublishProduct\t\t5700\n"
"InstallFinalize\t\t6000\n";
static const char sis_custom_action_dat[] =
"Action\tType\tSource\tTarget\n"
"s72\ti2\tS64\tS0\n"
"CustomAction\tAction\n"
"sis_immediate\t1\tcustom.dll\tsis_absent\n"
"sis_deferred\t1025\tcustom.dll\tsis_present\n";
static const char rof_component_dat[] =
"Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
"s72\tS38\ts72\ti2\tS255\tS72\n"
@ -1846,7 +1874,8 @@ static const msi_table sis_tables[] =
ADD_TABLE(feature),
ADD_TABLE(feature_comp),
ADD_TABLE(file),
ADD_TABLE(sds_install_exec_seq),
ADD_TABLE(sis_install_exec_seq),
ADD_TABLE(sis_custom_action),
ADD_TABLE(service_install2),
ADD_TABLE(media),
ADD_TABLE(property)

View File

@ -1216,3 +1216,26 @@ UINT WINAPI sds_absent(MSIHANDLE hinst)
CloseServiceHandle(manager);
return ERROR_SUCCESS;
}
UINT WINAPI sis_present(MSIHANDLE hinst)
{
SC_HANDLE manager, service;
manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
service = OpenServiceA(manager, "TestService", GENERIC_ALL);
ok(hinst, !!service, "service absent: %u\n", GetLastError());
CloseServiceHandle(service);
CloseServiceHandle(manager);
return ERROR_SUCCESS;
}
UINT WINAPI sis_absent(MSIHANDLE hinst)
{
SC_HANDLE manager, service;
manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
service = OpenServiceA(manager, "TestService", GENERIC_ALL);
todo_wine
ok(hinst, !service, "service present\n");
if (service) CloseServiceHandle(service);
CloseServiceHandle(manager);
return ERROR_SUCCESS;
}

View File

@ -9,3 +9,5 @@
@ stdcall crs_absent(long)
@ stdcall sds_present(long)
@ stdcall sds_absent(long)
@ stdcall sis_present(long)
@ stdcall sis_absent(long)