msi/tests: Test deferral of DeleteServices.

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:10 -05:00 committed by Alexandre Julliard
parent ab9ab2a8f7
commit 5d8e16f701
4 changed files with 37 additions and 1 deletions

View File

@ -1,7 +1,7 @@
TESTDLL = msi.dll TESTDLL = msi.dll
IMPORTS = cabinet msi shell32 ole32 oleaut32 user32 advapi32 version IMPORTS = cabinet msi shell32 ole32 oleaut32 user32 advapi32 version
custom_IMPORTS = uuid msi ole32 shell32 custom_IMPORTS = uuid msi ole32 shell32 advapi32
SOURCES = \ SOURCES = \
action.c \ action.c \

View File

@ -282,6 +282,8 @@ static const char sds_install_exec_seq_dat[] =
"InstallInitialize\t\t1500\n" "InstallInitialize\t\t1500\n"
"StopServices\t\t5000\n" "StopServices\t\t5000\n"
"DeleteServices\t\t5050\n" "DeleteServices\t\t5050\n"
"sds_immediate\tNOT REMOVE\t5051\n"
"sds_deferred\tNOT REMOVE\t5052\n"
"MoveFiles\t\t5100\n" "MoveFiles\t\t5100\n"
"InstallFiles\t\t5200\n" "InstallFiles\t\t5200\n"
"DuplicateFiles\t\t5300\n" "DuplicateFiles\t\t5300\n"
@ -292,6 +294,13 @@ static const char sds_install_exec_seq_dat[] =
"PublishProduct\t\t5700\n" "PublishProduct\t\t5700\n"
"InstallFinalize\t\t6000\n"; "InstallFinalize\t\t6000\n";
static const char sds_custom_action_dat[] =
"Action\tType\tSource\tTarget\n"
"s72\ti2\tS64\tS0\n"
"CustomAction\tAction\n"
"sds_immediate\t1\tcustom.dll\tsds_present\n"
"sds_deferred\t1025\tcustom.dll\tsds_absent\n";
static const char rof_component_dat[] = static const char rof_component_dat[] =
"Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n" "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
"s72\tS38\ts72\ti2\tS255\tS72\n" "s72\tS38\ts72\ti2\tS255\tS72\n"
@ -1823,6 +1832,7 @@ static const msi_table sds_tables[] =
ADD_TABLE(feature_comp), ADD_TABLE(feature_comp),
ADD_TABLE(file), ADD_TABLE(file),
ADD_TABLE(sds_install_exec_seq), ADD_TABLE(sds_install_exec_seq),
ADD_TABLE(sds_custom_action),
ADD_TABLE(service_control), ADD_TABLE(service_control),
ADD_TABLE(service_install), ADD_TABLE(service_install),
ADD_TABLE(media), ADD_TABLE(media),

View File

@ -23,6 +23,7 @@
#include <windef.h> #include <windef.h>
#include <winbase.h> #include <winbase.h>
#include <winsvc.h>
#define COBJMACROS #define COBJMACROS
#include <shlobj.h> #include <shlobj.h>
#include <msxml.h> #include <msxml.h>
@ -1192,3 +1193,26 @@ todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED))
ok(hinst, !pf_exists("msitest\\shortcut.lnk"), "shortcut present\n"); ok(hinst, !pf_exists("msitest\\shortcut.lnk"), "shortcut present\n");
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
UINT WINAPI sds_present(MSIHANDLE hinst)
{
SC_HANDLE manager, service;
manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
service = OpenServiceA(manager, "TestService3", GENERIC_ALL);
todo_wine
ok(hinst, !!service, "service absent: %u\n", GetLastError());
CloseServiceHandle(service);
CloseServiceHandle(manager);
return ERROR_SUCCESS;
}
UINT WINAPI sds_absent(MSIHANDLE hinst)
{
SC_HANDLE manager, service;
manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
service = OpenServiceA(manager, "TestService3", GENERIC_ALL);
ok(hinst, !service, "service present\n");
if (service) CloseServiceHandle(service);
CloseServiceHandle(manager);
return ERROR_SUCCESS;
}

View File

@ -7,3 +7,5 @@
@ stdcall cf_absent(long) @ stdcall cf_absent(long)
@ stdcall crs_present(long) @ stdcall crs_present(long)
@ stdcall crs_absent(long) @ stdcall crs_absent(long)
@ stdcall sds_present(long)
@ stdcall sds_absent(long)