From b493df633a91bcd81996599e9c57d12d5abad900 Mon Sep 17 00:00:00 2001 From: winesync Date: Sat, 12 Mar 2022 15:14:53 +0100 Subject: [PATCH] [WINESYNC] msi/tests: Test deferral of RegisterUser. Signed-off-by: Zebediah Figura Signed-off-by: Hans Leidekker Signed-off-by: Alexandre Julliard wine commit id d0ab6deb773912b427251f041e7413669fdef702 by Zebediah Figura --- modules/rostests/winetests/msi/action.c | 4 ++++ modules/rostests/winetests/msi/custom.c | 28 ++++++++++++++++++++++ modules/rostests/winetests/msi/custom.spec | 2 ++ 3 files changed, 34 insertions(+) diff --git a/modules/rostests/winetests/msi/action.c b/modules/rostests/winetests/msi/action.c index 22ece567836..ea8c0e86c75 100644 --- a/modules/rostests/winetests/msi/action.c +++ b/modules/rostests/winetests/msi/action.c @@ -404,6 +404,8 @@ static const char pp_install_exec_seq_dat[] = "RemoveFiles\t\t3500\n" "InstallFiles\t\t4000\n" "RegisterUser\tREGISTER_USER=1 Or FULL=1\t6000\n" + "ru_immediate\tREGISTER_USER AND ALLUSERS\t6001\n" + "ru_deferred\tREGISTER_USER AND ALLUSERS\t6002\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" @@ -427,6 +429,8 @@ static const char pp_custom_action_dat[] = "pp_deferred\t1025\tcustom.dll\tpp_present\n" "rp_immediate\t1\tcustom.dll\trp_absent\n" "rp_deferred\t1025\tcustom.dll\trp_present\n" + "ru_immediate\t1\tcustom.dll\tru_absent\n" + "ru_deferred\t1025\tcustom.dll\tru_present\n" "ppc_immediate\t1\tcustom.dll\tppc_absent\n" "ppc_deferred\t1025\tcustom.dll\tppc_present\n"; diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index f5aa34446e4..7a3f01ed29a 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -1776,3 +1776,31 @@ todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { return ERROR_SUCCESS; } + +static const CHAR ru_key[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Installer" + "\\UserData\\S-1-5-18\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB\\InstallProperties"; + +UINT WINAPI ru_present(MSIHANDLE hinst) +{ + HKEY key; + LONG res; + + res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, ru_key, 0, KEY_READ | KEY_WOW64_64KEY, &key); + ok(hinst, !res, "got %u\n", res); + check_reg_str(hinst, key, "ProductID", "none"); + RegCloseKey(key); + + return ERROR_SUCCESS; +} + +UINT WINAPI ru_absent(MSIHANDLE hinst) +{ + HKEY key; + LONG res; + + res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, ru_key, 0, KEY_READ | KEY_WOW64_64KEY, &key); +todo_wine + 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 2b3b76a3499..eec6a43c0a1 100644 --- a/modules/rostests/winetests/msi/custom.spec +++ b/modules/rostests/winetests/msi/custom.spec @@ -37,6 +37,8 @@ @ stdcall rp_absent(long) @ stdcall rpi_present(long) @ stdcall rpi_absent(long) +@ stdcall ru_present(long) +@ stdcall ru_absent(long) @ stdcall sds_present(long) @ stdcall sds_absent(long) @ stdcall sis_present(long)