https://git.reactos.org/?p=reactos.git;a=commitdiff;h=342159af51a40c3684c31…
commit 342159af51a40c3684c31261bc814ec9d33683f9
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Sat Mar 12 16:34:01 2022 +0100
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sun Mar 20 19:27:52 2022 +0100
[WINESYNC] msi/tests: Test deferral of SelfRegModules and SelfUnregModules.
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id a08438afbd1d111e78ebb7fb0743a456f1da4d19 by Zebediah Figura
<z.figura12(a)gmail.com>
---
modules/rostests/winetests/msi/action.c | 14 ++++++++++++++
modules/rostests/winetests/msi/custom.c | 25 +++++++++++++++++++++++++
modules/rostests/winetests/msi/custom.spec | 2 ++
3 files changed, 41 insertions(+)
diff --git a/modules/rostests/winetests/msi/action.c
b/modules/rostests/winetests/msi/action.c
index 8f26385b36a..2152629e849 100644
--- a/modules/rostests/winetests/msi/action.c
+++ b/modules/rostests/winetests/msi/action.c
@@ -777,15 +777,28 @@ static const char sr_install_exec_seq_dat[] =
"InstallInitialize\t\t1500\n"
"ProcessComponents\t\t1600\n"
"SelfUnregModules\t\t3800\n"
+ "su_immediate\tREMOVE\t3801\n"
+ "su_deferred\tREMOVE\t3802\n"
"RemoveFiles\t\t3900\n"
"InstallFiles\t\t4000\n"
"SelfRegModules\t\t4100\n"
+ "sr_immediate\tNOT REMOVE\t4101\n"
+ "sr_deferred\tNOT REMOVE\t4102\n"
"CreateShortcuts\t\t4600\n"
"RegisterProduct\t\t5100\n"
"PublishFeatures\t\t5200\n"
"PublishProduct\t\t5300\n"
"InstallFinalize\t\t6600\n";
+static const char sr_custom_action_dat[] =
+ "Action\tType\tSource\tTarget\n"
+ "s72\ti2\tS64\tS0\n"
+ "CustomAction\tAction\n"
+ "sr_immediate\t1\tcustom.dll\tsr_absent\n"
+ "sr_deferred\t1025\tcustom.dll\tsr_present\n"
+ "su_immediate\t1\tcustom.dll\tsr_present\n"
+ "su_deferred\t1025\tcustom.dll\tsr_absent\n";
+
static const char font_media_dat[] =
"DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
"i2\ti4\tL64\tS255\tS32\tS72\n"
@@ -2131,6 +2144,7 @@ static const msi_table sr_tables[] =
ADD_TABLE(sr_file),
ADD_TABLE(sr_selfreg),
ADD_TABLE(sr_install_exec_seq),
+ ADD_TABLE(sr_custom_action),
ADD_TABLE(media),
ADD_TABLE(property)
};
diff --git a/modules/rostests/winetests/msi/custom.c
b/modules/rostests/winetests/msi/custom.c
index b7da2b8fcc8..3fb538203f8 100644
--- a/modules/rostests/winetests/msi/custom.c
+++ b/modules/rostests/winetests/msi/custom.c
@@ -1833,3 +1833,28 @@ todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED))
return ERROR_SUCCESS;
}
+
+UINT WINAPI sr_present(MSIHANDLE hinst)
+{
+ HKEY key;
+ LONG res;
+
+ res = RegOpenKeyA(HKEY_CLASSES_ROOT, "selfreg_test", &key);
+todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED))
+ ok(hinst, !res, "got %u\n", res);
+ RegCloseKey(key);
+
+ return ERROR_SUCCESS;
+}
+
+UINT WINAPI sr_absent(MSIHANDLE hinst)
+{
+ HKEY key;
+ LONG res;
+
+ res = RegOpenKeyA(HKEY_CLASSES_ROOT, "selfreg_test", &key);
+todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED))
+ ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+
+ return ERROR_SUCCESS;
+}
diff --git a/modules/rostests/winetests/msi/custom.spec
b/modules/rostests/winetests/msi/custom.spec
index 058a9172f1f..2ec5b6cc6d7 100644
--- a/modules/rostests/winetests/msi/custom.spec
+++ b/modules/rostests/winetests/msi/custom.spec
@@ -43,6 +43,8 @@
@ stdcall sds_absent(long)
@ stdcall sis_present(long)
@ stdcall sis_absent(long)
+@ stdcall sr_present(long)
+@ stdcall sr_absent(long)
@ stdcall sss_started(long)
@ stdcall sss_stopped(long)
@ stdcall tl_present(long)