mirror of
https://github.com/reactos/reactos.git
synced 2026-06-09 09:23:04 +08:00
[WINESYNC] 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> wine commit id 5d8e16f7018b4fb0382ec991adc08e1f305bd353 by Zebediah Figura <z.figura12@gmail.com>
This commit is contained in:
@@ -3,7 +3,7 @@ spec2def(custom.dll custom.spec)
|
||||
add_library(custom MODULE custom.c ${CMAKE_CURRENT_BINARY_DIR}/custom.def)
|
||||
target_link_libraries(custom uuid)
|
||||
set_module_type(custom win32dll)
|
||||
add_importlibs(custom msi ole32 shell32 msvcrt kernel32)
|
||||
add_importlibs(custom msi ole32 shell32 advapi32 msvcrt kernel32)
|
||||
|
||||
list(APPEND SOURCE
|
||||
action.c
|
||||
|
||||
@@ -282,6 +282,8 @@ static const char sds_install_exec_seq_dat[] =
|
||||
"InstallInitialize\t\t1500\n"
|
||||
"StopServices\t\t5000\n"
|
||||
"DeleteServices\t\t5050\n"
|
||||
"sds_immediate\tNOT REMOVE\t5051\n"
|
||||
"sds_deferred\tNOT REMOVE\t5052\n"
|
||||
"MoveFiles\t\t5100\n"
|
||||
"InstallFiles\t\t5200\n"
|
||||
"DuplicateFiles\t\t5300\n"
|
||||
@@ -292,6 +294,13 @@ static const char sds_install_exec_seq_dat[] =
|
||||
"PublishProduct\t\t5700\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[] =
|
||||
"Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
|
||||
"s72\tS38\ts72\ti2\tS255\tS72\n"
|
||||
@@ -1823,6 +1832,7 @@ static const msi_table sds_tables[] =
|
||||
ADD_TABLE(feature_comp),
|
||||
ADD_TABLE(file),
|
||||
ADD_TABLE(sds_install_exec_seq),
|
||||
ADD_TABLE(sds_custom_action),
|
||||
ADD_TABLE(service_control),
|
||||
ADD_TABLE(service_install),
|
||||
ADD_TABLE(media),
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
#include <windef.h>
|
||||
#include <winbase.h>
|
||||
#include <winsvc.h>
|
||||
#define COBJMACROS
|
||||
#include <shlobj.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");
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -7,3 +7,5 @@
|
||||
@ stdcall cf_absent(long)
|
||||
@ stdcall crs_present(long)
|
||||
@ stdcall crs_absent(long)
|
||||
@ stdcall sds_present(long)
|
||||
@ stdcall sds_absent(long)
|
||||
|
||||
Reference in New Issue
Block a user