https://git.reactos.org/?p=reactos.git;a=commitdiff;h=39c835f2a3c43cb9a319f97743f60b486ba20024

commit 39c835f2a3c43cb9a319f97743f60b486ba20024
Author:     winesync <[email protected]>
AuthorDate: Sat Mar 12 16:34:02 2022 +0100
Commit:     Mark Jansen <[email protected]>
CommitDate: Sun Mar 20 19:27:52 2022 +0100

    [WINESYNC] msi/tests: Test deferral of WriteEnvironmentStrings and 
RemoveEnvironmentStrings.
    
    Signed-off-by: Zebediah Figura <[email protected]>
    Signed-off-by: Hans Leidekker <[email protected]>
    Signed-off-by: Alexandre Julliard <[email protected]>
    
    wine commit id aae3d6b5afaa67530ee62f922a301fce1967151a by Zebediah Figura 
<[email protected]>
---
 modules/rostests/winetests/msi/action.c    | 14 +++++++++++++
 modules/rostests/winetests/msi/custom.c    | 32 ++++++++++++++++++++++++++++++
 modules/rostests/winetests/msi/custom.spec |  2 ++
 3 files changed, 48 insertions(+)

diff --git a/modules/rostests/winetests/msi/action.c 
b/modules/rostests/winetests/msi/action.c
index cc222ed09cd..2c444f2511e 100644
--- a/modules/rostests/winetests/msi/action.c
+++ b/modules/rostests/winetests/msi/action.c
@@ -199,12 +199,25 @@ static const char env_install_exec_seq_dat[] =
     "InstallInitialize\t\t500\n"
     "ProcessComponents\t\t600\n"
     "WriteEnvironmentStrings\t\t700\n"
+    "wes_immediate\tNOT REMOVE\t701\n"
+    "wes_deferred\tNOT REMOVE\t702\n"
     "RemoveEnvironmentStrings\t\t800\n"
+    "res_immediate\tREMOVE\t801\n"
+    "res_deferred\tREMOVE\t802\n"
     "RegisterProduct\t\t900\n"
     "PublishFeatures\t\t1000\n"
     "PublishProduct\t\t1100\n"
     "InstallFinalize\t\t1200\n";
 
+static const char env_custom_action_dat[] =
+    "Action\tType\tSource\tTarget\n"
+    "s72\ti2\tS64\tS0\n"
+    "CustomAction\tAction\n"
+    "wes_immediate\t1\tcustom.dll\tenv_absent\n"
+    "wes_deferred\t1025\tcustom.dll\tenv_present\n"
+    "res_immediate\t1\tcustom.dll\tenv_present\n"
+    "res_deferred\t1025\tcustom.dll\tenv_absent\n";
+
 static const char env_environment_dat[] =
     "Environment\tName\tValue\tComponent_\n"
     "s72\tl255\tL255\ts72\n"
@@ -1953,6 +1966,7 @@ static const msi_table env_tables[] =
     ADD_TABLE(feature_comp),
     ADD_TABLE(file),
     ADD_TABLE(env_install_exec_seq),
+    ADD_TABLE(env_custom_action),
     ADD_TABLE(media),
     ADD_TABLE(property),
     ADD_TABLE(env_environment)
diff --git a/modules/rostests/winetests/msi/custom.c 
b/modules/rostests/winetests/msi/custom.c
index 3fb538203f8..b1823043df2 100644
--- a/modules/rostests/winetests/msi/custom.c
+++ b/modules/rostests/winetests/msi/custom.c
@@ -1858,3 +1858,35 @@ todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED))
 
     return ERROR_SUCCESS;
 }
+
+UINT WINAPI env_present(MSIHANDLE hinst)
+{
+    HKEY key;
+    LONG res;
+
+    res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key);
+    ok(hinst, !res, "got %u\n", res);
+todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) {
+    check_reg_str(hinst, key, "MSITESTVAR3", "1");
+    check_reg_str(hinst, key, "MSITESTVAR4", "1");
+}
+    RegCloseKey(key);
+
+    return ERROR_SUCCESS;
+}
+
+UINT WINAPI env_absent(MSIHANDLE hinst)
+{
+    HKEY key;
+    LONG res;
+
+    res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key);
+    ok(hinst, !res, "got %u\n", res);
+todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) {
+    check_reg_str(hinst, key, "MSITESTVAR3", NULL);
+    check_reg_str(hinst, key, "MSITESTVAR4", NULL);
+}
+    RegCloseKey(key);
+
+    return ERROR_SUCCESS;
+}
diff --git a/modules/rostests/winetests/msi/custom.spec 
b/modules/rostests/winetests/msi/custom.spec
index 2ec5b6cc6d7..8b3c2fbf389 100644
--- a/modules/rostests/winetests/msi/custom.spec
+++ b/modules/rostests/winetests/msi/custom.spec
@@ -7,6 +7,8 @@
 @ stdcall cf_absent(long)
 @ stdcall crs_present(long)
 @ stdcall crs_absent(long)
+@ stdcall env_present(long)
+@ stdcall env_absent(long)
 @ stdcall file_present(long)
 @ stdcall file_absent(long)
 @ stdcall font_present(long)

Reply via email to