https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3a2e2e6560343a2e346bf8241b8d11defd0d88b7

commit 3a2e2e6560343a2e346bf8241b8d11defd0d88b7
Author:     winesync <[email protected]>
AuthorDate: Sat Mar 12 15:14:48 2022 +0100
Commit:     Mark Jansen <[email protected]>
CommitDate: Sun Mar 20 19:27:49 2022 +0100

    [WINESYNC] msi/tests: Test deferral of PublishComponents and 
UnpublishComponents.
    
    Signed-off-by: Zebediah Figura <[email protected]>
    Signed-off-by: Hans Leidekker <[email protected]>
    Signed-off-by: Alexandre Julliard <[email protected]>
    
    wine commit id 625ef14967984ef2f35638e0012ceb7c816f346c by Zebediah Figura 
<[email protected]>
---
 modules/rostests/winetests/msi/action.c    | 14 ++++++++++++++
 modules/rostests/winetests/msi/custom.c    | 28 ++++++++++++++++++++++++++++
 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 17bbddc6624..48a1c88bf61 100644
--- a/modules/rostests/winetests/msi/action.c
+++ b/modules/rostests/winetests/msi/action.c
@@ -1086,12 +1086,25 @@ static const char pub_install_exec_seq_dat[] =
     "RemoveFiles\t\t1700\n"
     "InstallFiles\t\t2000\n"
     "PublishComponents\t\t3000\n"
+    "pub_immediate\tNOT REMOVE\t3001\n"
+    "pub_deferred\tNOT REMOVE\t3002\n"
     "UnpublishComponents\t\t3100\n"
+    "unp_immediate\tREMOVE\t3101\n"
+    "unp_deferred\tREMOVE\t3102\n"
     "RegisterProduct\t\t5000\n"
     "PublishFeatures\t\t5100\n"
     "PublishProduct\t\t5200\n"
     "InstallFinalize\t\t6000\n";
 
+static const char pub_custom_action_dat[] =
+    "Action\tType\tSource\tTarget\n"
+    "s72\ti2\tS64\tS0\n"
+    "CustomAction\tAction\n"
+    "pub_immediate\t1\tcustom.dll\tpub_absent\n"
+    "pub_deferred\t1025\tcustom.dll\tpub_present\n"
+    "unp_immediate\t1\tcustom.dll\tpub_present\n"
+    "unp_deferred\t1025\tcustom.dll\tpub_absent\n";
+
 static const char rd_file_dat[] =
     
"File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
     "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
@@ -2070,6 +2083,7 @@ static const msi_table pub_tables[] =
     ADD_TABLE(pub_file),
     ADD_TABLE(pub_publish_component),
     ADD_TABLE(pub_install_exec_seq),
+    ADD_TABLE(pub_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 5925fc94008..4d5cec77dee 100644
--- a/modules/rostests/winetests/msi/custom.c
+++ b/modules/rostests/winetests/msi/custom.c
@@ -1466,3 +1466,31 @@ todo_wine
     ok(hinst, r == ERROR_FILE_NOT_FOUND, "got %u\n", r);
     return ERROR_SUCCESS;
 }
+
+static const char pub_key[] = 
"Software\\Microsoft\\Installer\\Components\\0CBCFA296AC907244845745CEEB2F8AA";
+
+UINT WINAPI pub_present(MSIHANDLE hinst)
+{
+    HKEY key;
+    LONG res;
+
+todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) {
+    res = RegOpenKeyA(HKEY_CURRENT_USER, pub_key, &key);
+    ok(hinst, !res, "got %u\n", res);
+    res = RegQueryValueExA(key, "english.txt", NULL, NULL, NULL, NULL);
+    ok(hinst, !res, "got %u\n", res);
+}
+    RegCloseKey(key);
+    return ERROR_SUCCESS;
+}
+
+UINT WINAPI pub_absent(MSIHANDLE hinst)
+{
+    HKEY key;
+    LONG res;
+
+    res = RegOpenKeyA(HKEY_CURRENT_USER, pub_key, &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 3b73765323b..2dc09e0a099 100644
--- a/modules/rostests/winetests/msi/custom.spec
+++ b/modules/rostests/winetests/msi/custom.spec
@@ -17,6 +17,8 @@
 @ stdcall pa_absent(long)
 @ stdcall ppc_present(long)
 @ stdcall ppc_absent(long)
+@ stdcall pub_present(long)
+@ stdcall pub_absent(long)
 @ stdcall rd_present(long)
 @ stdcall rd_absent(long)
 @ stdcall sds_present(long)

Reply via email to