Zebediah Figura : msi/tests: Test deferral of InstallServices.

Alexandre Julliard julliard at winehq.org
Fri May 18 16:53:13 CDT 2018


Module: wine
Branch: master
Commit: b8f982fa4b190398edce45290cd49159d586a26b
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=b8f982fa4b190398edce45290cd49159d586a26b

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Thu May 17 22:26:11 2018 -0500

msi/tests: Test deferral of InstallServices.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/msi/tests/action.c    | 31 ++++++++++++++++++++++++++++++-
 dlls/msi/tests/custom.c    | 23 +++++++++++++++++++++++
 dlls/msi/tests/custom.spec |  2 ++
 3 files changed, 55 insertions(+), 1 deletion(-)

diff --git a/dlls/msi/tests/action.c b/dlls/msi/tests/action.c
index b005529..4abf867 100644
--- a/dlls/msi/tests/action.c
+++ b/dlls/msi/tests/action.c
@@ -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)
diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c
index 4497f3c..4336504 100644
--- a/dlls/msi/tests/custom.c
+++ b/dlls/msi/tests/custom.c
@@ -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;
+}
diff --git a/dlls/msi/tests/custom.spec b/dlls/msi/tests/custom.spec
index 1485546..471f956 100644
--- a/dlls/msi/tests/custom.spec
+++ b/dlls/msi/tests/custom.spec
@@ -9,3 +9,5 @@
 @ stdcall crs_absent(long)
 @ stdcall sds_present(long)
 @ stdcall sds_absent(long)
+@ stdcall sis_present(long)
+@ stdcall sis_absent(long)




More information about the wine-cvs mailing list