https://git.reactos.org/?p=reactos.git;a=commitdiff;h=29e57f78084a7b1c7274d…
commit 29e57f78084a7b1c7274d56bf49a5e6e4c8f87ca
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Sat Mar 12 15:14:47 2022 +0100
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sun Mar 20 19:27:49 2022 +0100
[WINESYNC] msi/tests: Test deferral of ProcessComponents.
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 5e0e25d4b4eb2ebd0a97bbbe02bf9a5d1ece7ff8 by Zebediah Figura
<z.figura12(a)gmail.com>
---
modules/rostests/winetests/msi/action.c | 10 ++++++++++
modules/rostests/winetests/msi/custom.c | 32 ++++++++++++++++++++++++++++++
modules/rostests/winetests/msi/custom.spec | 2 ++
3 files changed, 44 insertions(+)
diff --git a/modules/rostests/winetests/msi/action.c
b/modules/rostests/winetests/msi/action.c
index bd1e2c02d26..17bbddc6624 100644
--- a/modules/rostests/winetests/msi/action.c
+++ b/modules/rostests/winetests/msi/action.c
@@ -396,6 +396,8 @@ static const char pp_install_exec_seq_dat[] =
"InstallValidate\t\t1400\n"
"InstallInitialize\t\t1500\n"
"ProcessComponents\tPROCESS_COMPONENTS=1 Or FULL=1\t1600\n"
+ "ppc_immediate\tPROCESS_COMPONENTS AND ALLUSERS\t1601\n"
+ "ppc_deferred\tPROCESS_COMPONENTS AND ALLUSERS\t1602\n"
"UnpublishFeatures\tUNPUBLISH_FEATURES=1 Or FULL=1\t1800\n"
"RemoveFiles\t\t3500\n"
"InstallFiles\t\t4000\n"
@@ -405,6 +407,13 @@ static const char pp_install_exec_seq_dat[] =
"PublishProduct\tPUBLISH_PRODUCT=1 Or FULL=1\t6400\n"
"InstallFinalize\t\t6600";
+static const char pp_custom_action_dat[] =
+ "Action\tType\tSource\tTarget\n"
+ "s72\ti2\tS64\tS0\n"
+ "CustomAction\tAction\n"
+ "ppc_immediate\t1\tcustom.dll\tppc_absent\n"
+ "ppc_deferred\t1025\tcustom.dll\tppc_present\n";
+
static const char pp_component_dat[] =
"Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
"s72\tS38\ts72\ti2\tS255\tS72\n"
@@ -1855,6 +1864,7 @@ static const msi_table ppc_tables[] =
ADD_TABLE(ppc_feature_comp),
ADD_TABLE(ppc_file),
ADD_TABLE(pp_install_exec_seq),
+ ADD_TABLE(pp_custom_action),
ADD_TABLE(ppc_media),
ADD_TABLE(property),
};
diff --git a/modules/rostests/winetests/msi/custom.c
b/modules/rostests/winetests/msi/custom.c
index ee067db6a0f..5925fc94008 100644
--- a/modules/rostests/winetests/msi/custom.c
+++ b/modules/rostests/winetests/msi/custom.c
@@ -1434,3 +1434,35 @@ todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) {
}
return ERROR_SUCCESS;
}
+
+static const char ppc_key[] = "Software\\Microsoft\\Windows\\CurrentVersion\\"
+
"Installer\\UserData\\S-1-5-18\\Components\\CBABC2FDCCB35E749A8944D8C1C098B5";
+
+UINT WINAPI ppc_present(MSIHANDLE hinst)
+{
+ char expect[MAX_PATH];
+ HKEY key;
+ UINT r;
+
+ r = RegOpenKeyExA(HKEY_LOCAL_MACHINE, ppc_key, 0, KEY_QUERY_VALUE | KEY_WOW64_64KEY,
&key);
+ ok(hinst, !r, "got %u\n", r);
+
+ if (FAILED(SHGetFolderPathA(NULL, CSIDL_PROGRAM_FILESX86, NULL, 0, expect)))
+ SHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES, NULL, 0, expect);
+ strcat(expect, "\\msitest\\maximus");
+ check_reg_str(hinst, key, "84A88FD7F6998CE40A22FB59F6B9C2BB", expect);
+
+ RegCloseKey(key);
+ return ERROR_SUCCESS;
+}
+
+UINT WINAPI ppc_absent(MSIHANDLE hinst)
+{
+ HKEY key;
+ UINT r;
+
+ r = RegOpenKeyExA(HKEY_LOCAL_MACHINE, ppc_key, 0, KEY_QUERY_VALUE | KEY_WOW64_64KEY,
&key);
+todo_wine
+ ok(hinst, r == ERROR_FILE_NOT_FOUND, "got %u\n", r);
+ return ERROR_SUCCESS;
+}
diff --git a/modules/rostests/winetests/msi/custom.spec
b/modules/rostests/winetests/msi/custom.spec
index e5caa76ad08..3b73765323b 100644
--- a/modules/rostests/winetests/msi/custom.spec
+++ b/modules/rostests/winetests/msi/custom.spec
@@ -15,6 +15,8 @@
@ stdcall odbc_absent(long)
@ stdcall pa_present(long)
@ stdcall pa_absent(long)
+@ stdcall ppc_present(long)
+@ stdcall ppc_absent(long)
@ stdcall rd_present(long)
@ stdcall rd_absent(long)
@ stdcall sds_present(long)