From 377d32c4fb6ea72c68436eb590541ec88d0c74f9 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 30 May 2018 20:47:36 -0500 Subject: [PATCH] msi/tests: Test deferral of WriteIniValues and RemoveIniValues. Signed-off-by: Zebediah Figura Signed-off-by: Hans Leidekker Signed-off-by: Alexandre Julliard --- dlls/msi/tests/action.c | 14 ++++++++++++++ dlls/msi/tests/custom.c | 32 ++++++++++++++++++++++++++++++++ dlls/msi/tests/custom.spec | 2 ++ 3 files changed, 48 insertions(+) diff --git a/dlls/msi/tests/action.c b/dlls/msi/tests/action.c index bce51336958..b6aa8e62c47 100644 --- a/dlls/msi/tests/action.c +++ b/dlls/msi/tests/action.c @@ -1454,12 +1454,25 @@ static const char ini_install_exec_seq_dat[] = "RemoveFiles\t\t1700\n" "InstallFiles\t\t2000\n" "RemoveIniValues\t\t3000\n" + "riv_immediate\tREMOVE\t3001\n" + "riv_deferred\tREMOVE\t3002\n" "WriteIniValues\t\t3100\n" + "wiv_immediate\tNOT REMOVE\t3101\n" + "wiv_deferred\tNOT REMOVE\t3102\n" "RegisterProduct\t\t5000\n" "PublishFeatures\t\t5100\n" "PublishProduct\t\t5200\n" "InstallFinalize\t\t6000\n"; +static const char ini_custom_action_dat[] = + "Action\tType\tSource\tTarget\n" + "s72\ti2\tS64\tS0\n" + "CustomAction\tAction\n" + "wiv_immediate\t1\tcustom.dll\tini_absent\n" + "wiv_deferred\t1025\tcustom.dll\tini_present\n" + "riv_immediate\t1\tcustom.dll\tini_present\n" + "riv_deferred\t1025\tcustom.dll\tini_absent\n"; + static const char rci_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n" "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n" @@ -2257,6 +2270,7 @@ static const msi_table ini_tables[] = ADD_TABLE(ini_ini_file), ADD_TABLE(ini_remove_ini_file), ADD_TABLE(ini_install_exec_seq), + ADD_TABLE(ini_custom_action), ADD_TABLE(media), ADD_TABLE(property) }; diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index b1823043df2..3e742e381bc 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/custom.c @@ -1890,3 +1890,35 @@ todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { return ERROR_SUCCESS; } + +UINT WINAPI ini_present(MSIHANDLE hinst) +{ + char path[MAX_PATH], buf[10]; + DWORD len; + + if (FAILED(SHGetFolderPathA(NULL, CSIDL_PROGRAM_FILESX86, NULL, 0, path))) + SHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES, NULL, 0, path); + strcat(path, "\\msitest\\test.ini"); + + len = GetPrivateProfileStringA("section1", "key1", NULL, buf, sizeof(buf), path); +todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) + ok(hinst, len == 6, "got %u\n", len); + + return ERROR_SUCCESS; +} + +UINT WINAPI ini_absent(MSIHANDLE hinst) +{ + char path[MAX_PATH], buf[10]; + DWORD len; + + if (FAILED(SHGetFolderPathA(NULL, CSIDL_PROGRAM_FILESX86, NULL, 0, path))) + SHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES, NULL, 0, path); + strcat(path, "\\msitest\\test.ini"); + + len = GetPrivateProfileStringA("section1", "key1", NULL, buf, sizeof(buf), path); +todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) + ok(hinst, !len, "got %u\n", len); + + return ERROR_SUCCESS; +} diff --git a/dlls/msi/tests/custom.spec b/dlls/msi/tests/custom.spec index 8b3c2fbf389..bfd83928e44 100644 --- a/dlls/msi/tests/custom.spec +++ b/dlls/msi/tests/custom.spec @@ -13,6 +13,8 @@ @ stdcall file_absent(long) @ stdcall font_present(long) @ stdcall font_absent(long) +@ stdcall ini_present(long) +@ stdcall ini_absent(long) @ stdcall mov_present(long) @ stdcall mov_absent(long) @ stdcall odbc_present(long)