From 71f3f2a6edf8db909a756d25d2acf96ef9258dbc Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 28 May 2018 21:07:51 -0500 Subject: [PATCH] msi/tests: Test deferral of RegisterProduct. Signed-off-by: Zebediah Figura Signed-off-by: Hans Leidekker Signed-off-by: Alexandre Julliard --- dlls/msi/tests/action.c | 4 ++++ dlls/msi/tests/custom.c | 28 ++++++++++++++++++++++++++++ dlls/msi/tests/custom.spec | 2 ++ 3 files changed, 34 insertions(+) diff --git a/dlls/msi/tests/action.c b/dlls/msi/tests/action.c index cefa1d7d6f6..9409ad19272 100644 --- a/dlls/msi/tests/action.c +++ b/dlls/msi/tests/action.c @@ -405,6 +405,8 @@ static const char pp_install_exec_seq_dat[] = "InstallFiles\t\t4000\n" "RegisterUser\tREGISTER_USER=1 Or FULL=1\t6000\n" "RegisterProduct\tREGISTER_PRODUCT=1 Or FULL=1\t6100\n" + "rp_immediate\tREGISTER_PRODUCT AND ALLUSERS\t6101\n" + "rp_deferred\tREGISTER_PRODUCT AND ALLUSERS\t6102\n" "PublishFeatures\tPUBLISH_FEATURES=1 Or FULL=1\t6300\n" "pf_immediate\tPUBLISH_FEATURES AND ALLUSERS\t6301\n" "pf_deferred\tPUBLISH_FEATURES AND ALLUSERS\t6302\n" @@ -423,6 +425,8 @@ static const char pp_custom_action_dat[] = "uf_deferred\t1025\tcustom.dll\tpf_absent\n" "pp_immediate\t1\tcustom.dll\tpp_absent\n" "pp_deferred\t1025\tcustom.dll\tpp_present\n" + "rp_immediate\t1\tcustom.dll\trp_absent\n" + "rp_deferred\t1025\tcustom.dll\trp_present\n" "ppc_immediate\t1\tcustom.dll\tppc_absent\n" "ppc_deferred\t1025\tcustom.dll\tppc_present\n"; diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index b59b97a1dc7..5e9173761fc 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/custom.c @@ -1698,3 +1698,31 @@ todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) return ERROR_SUCCESS; } + +static const char rp_key[] = "Software\\Microsoft\\Windows\\CurrentVersion\\" + "Uninstall\\{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"; + +UINT WINAPI rp_present(MSIHANDLE hinst) +{ + HKEY key; + LONG res; + + res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, rp_key, 0, KEY_READ | KEY_WOW64_32KEY, &key); + ok(hinst, !res, "got %u\n", res); + check_reg_str(hinst, key, "DisplayName", "MSITEST"); + RegCloseKey(key); + + return ERROR_SUCCESS; +} + +UINT WINAPI rp_absent(MSIHANDLE hinst) +{ + HKEY key; + LONG res; + + res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, rp_key, 0, KEY_READ | KEY_WOW64_32KEY, &key); +todo_wine + ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res); + + return ERROR_SUCCESS; +} diff --git a/dlls/msi/tests/custom.spec b/dlls/msi/tests/custom.spec index 7f05f018073..9dadfbdf753 100644 --- a/dlls/msi/tests/custom.spec +++ b/dlls/msi/tests/custom.spec @@ -33,6 +33,8 @@ @ stdcall rmi_absent(long) @ stdcall rd_present(long) @ stdcall rd_absent(long) +@ stdcall rp_present(long) +@ stdcall rp_absent(long) @ stdcall sds_present(long) @ stdcall sds_absent(long) @ stdcall sis_present(long)