Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/msi/tests/Makefile.in | 2 +- dlls/msi/tests/action.c | 14 ++++++++ dlls/msi/tests/custom.c | 87 ++++++++++++++++++++++++++++++++++++++++------ dlls/msi/tests/custom.spec | 2 ++ 4 files changed, 93 insertions(+), 12 deletions(-)
diff --git a/dlls/msi/tests/Makefile.in b/dlls/msi/tests/Makefile.in index 9c991d6..248439a 100644 --- a/dlls/msi/tests/Makefile.in +++ b/dlls/msi/tests/Makefile.in @@ -1,7 +1,7 @@ TESTDLL = msi.dll IMPORTS = cabinet msi shell32 ole32 oleaut32 user32 advapi32 version
-custom_IMPORTS = uuid msi ole32 +custom_IMPORTS = uuid msi ole32 shell32
SOURCES = \ action.c \ diff --git a/dlls/msi/tests/action.c b/dlls/msi/tests/action.c index 849975d..ae1b47b 100644 --- a/dlls/msi/tests/action.c +++ b/dlls/msi/tests/action.c @@ -596,7 +596,11 @@ static const char cf_install_exec_seq_dat[] = "FileCost\t\t900\n" "RemoveFiles\t\t3500\n" "CreateFolders\t\t3700\n" + "cf_immediate\tNOT REMOVE\t3701\n" + "cf_deferred\tNOT REMOVE\t3702\n" "RemoveFolders\t\t3800\n" + "rf_immediate\tREMOVE\t3801\n" + "rf_deferred\tREMOVE\t3802\n" "InstallFiles\t\t4000\n" "RegisterUser\t\t6000\n" "RegisterProduct\t\t6100\n" @@ -609,6 +613,15 @@ static const char cf_install_exec_seq_dat[] = "InstallValidate\t\t1400\n" "LaunchConditions\t\t100\n";
+static const char cf_custom_action_dat[] = + "Action\tType\tSource\tTarget\n" + "s72\ti2\tS64\tS0\n" + "CustomAction\tAction\n" + "cf_immediate\t1\tcustom.dll\tcf_absent\n" + "cf_deferred\t1025\tcustom.dll\tcf_present\n" + "rf_immediate\t1\tcustom.dll\tcf_present\n" + "rf_deferred\t1025\tcustom.dll\tcf_absent\n"; + static const char sr_selfreg_dat[] = "File_\tCost\n" "s72\tI2\n" @@ -1771,6 +1784,7 @@ static const msi_table cf_tables[] = ADD_TABLE(cf_file), ADD_TABLE(cf_create_folders), ADD_TABLE(cf_install_exec_seq), + ADD_TABLE(cf_custom_action), ADD_TABLE(media), ADD_TABLE(property) }; diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index ff1be9b..aeee98e 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/custom.c @@ -24,10 +24,13 @@ #include <windef.h> #include <winbase.h> #define COBJMACROS +#include <shlobj.h> #include <msxml.h> #include <msi.h> #include <msiquery.h>
+static int todo_level, todo_do_loop; + static void ok_(MSIHANDLE hinst, int todo, const char *file, int line, int condition, const char *msg, ...) { static char buffer[2000]; @@ -47,8 +50,30 @@ static void ok_(MSIHANDLE hinst, int todo, const char *file, int line, int condi MsiProcessMessage(hinst, INSTALLMESSAGE_USER, record); MsiCloseHandle(record); } -#define ok(hinst, condition, ...) ok_(hinst, 0, __FILE__, __LINE__, condition, __VA_ARGS__) -#define todo_wine_ok(hinst, condition, ...) ok_(hinst, 1, __FILE__, __LINE__, condition, __VA_ARGS__) + +static void winetest_start_todo( int is_todo ) +{ + todo_level = (todo_level << 1) | (is_todo != 0); + todo_do_loop=1; +} + +static int winetest_loop_todo(void) +{ + int do_loop=todo_do_loop; + todo_do_loop=0; + return do_loop; +} + +static void winetest_end_todo(void) +{ + todo_level >>= 1; +} + +#define ok(hinst, condition, ...) ok_(hinst, todo_level, __FILE__, __LINE__, condition, __VA_ARGS__) +#define todo_wine_if(is_todo) for (winetest_start_todo(is_todo); \ + winetest_loop_todo(); \ + winetest_end_todo()) +#define todo_wine todo_wine_if(1)
static const char *dbgstr_w(WCHAR *str) { @@ -886,7 +911,8 @@ static void test_costs(MSIHANDLE hinst) cost = 0xdead; r = MsiGetFeatureCostA(hinst, NULL, MSICOSTTREE_CHILDREN, INSTALLSTATE_LOCAL, &cost); ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r); - todo_wine_ok(hinst, !cost, "got %d\n", cost); + todo_wine + ok(hinst, !cost, "got %d\n", cost);
r = MsiGetFeatureCostA(hinst, "One", MSICOSTTREE_CHILDREN, INSTALLSTATE_LOCAL, NULL); ok(hinst, r == RPC_X_NULL_REF_POINTER, "got %u\n", r); @@ -894,7 +920,8 @@ static void test_costs(MSIHANDLE hinst) cost = 0xdead; r = MsiGetFeatureCostA(hinst, "One", MSICOSTTREE_CHILDREN, INSTALLSTATE_LOCAL, &cost); ok(hinst, !r, "got %u\n", r); - todo_wine_ok(hinst, cost == 8, "got %d\n", cost); + todo_wine + ok(hinst, cost == 8, "got %d\n", cost);
sz = cost = temp = 0xdead; r = MsiEnumComponentCostsA(hinst, "One", 0, INSTALLSTATE_LOCAL, NULL, &sz, &cost, &temp); @@ -946,7 +973,8 @@ static void test_costs(MSIHANDLE hinst) r = MsiEnumComponentCostsA(hinst, "One", 0, INSTALLSTATE_LOCAL, buffer, &sz, &cost, &temp); ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r); ok(hinst, !strcmp(buffer, "q"), "got "%s"\n", buffer); - todo_wine_ok(hinst, sz == 4, "got size %u\n", sz); + todo_wine + ok(hinst, sz == 4, "got size %u\n", sz); ok(hinst, cost == 8, "got cost %d\n", cost); ok(hinst, !temp, "got temp %d\n", temp);
@@ -954,15 +982,19 @@ static void test_costs(MSIHANDLE hinst) strcpy(buffer,"x"); r = MsiEnumComponentCostsA(hinst, "One", 0, INSTALLSTATE_LOCAL, buffer, &sz, &cost, &temp); ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r); - todo_wine_ok(hinst, !buffer[0], "got "%s"\n", buffer); - todo_wine_ok(hinst, sz == 4, "got size %u\n", sz); + todo_wine { + ok(hinst, !buffer[0], "got "%s"\n", buffer); + ok(hinst, sz == 4, "got size %u\n", sz); + }
sz = 2; strcpy(buffer,"x"); r = MsiEnumComponentCostsA(hinst, "One", 0, INSTALLSTATE_LOCAL, buffer, &sz, &cost, &temp); ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r); - todo_wine_ok(hinst, !strcmp(buffer, "C"), "got "%s"\n", buffer); - todo_wine_ok(hinst, sz == 4, "got size %u\n", sz); + todo_wine { + ok(hinst, !strcmp(buffer, "C"), "got "%s"\n", buffer); + ok(hinst, sz == 4, "got size %u\n", sz); + }
sz = 3; strcpy(buffer,"x"); @@ -1021,7 +1053,8 @@ UINT WINAPI main_test(MSIHANDLE hinst)
/* Test MsiGetDatabaseState() */ res = MsiGetDatabaseState(hinst); - todo_wine_ok(hinst, res == MSIDBSTATE_ERROR, "expected MSIDBSTATE_ERROR, got %u\n", res); + todo_wine + ok(hinst, res == MSIDBSTATE_ERROR, "expected MSIDBSTATE_ERROR, got %u\n", res);
test_props(hinst); test_db(hinst); @@ -1101,7 +1134,8 @@ UINT WINAPI da_deferred(MSIHANDLE hinst) len = sizeof(prop); r = MsiGetPropertyA(hinst, "TESTPATH", prop, &len); ok(hinst, r == ERROR_SUCCESS, "got %u\n", r); - todo_wine_ok(hinst, !prop[0], "got %s\n", prop); + todo_wine + ok(hinst, !prop[0], "got %s\n", prop);
/* Test modes */ ok(hinst, MsiGetMode(hinst, MSIRUNMODE_SCHEDULED), "should be scheduled\n"); @@ -1113,3 +1147,34 @@ UINT WINAPI da_deferred(MSIHANDLE hinst)
return ERROR_SUCCESS; } + +static BOOL pf_exists(const char *file) +{ + char path[MAX_PATH]; + + if (FAILED(SHGetFolderPathA(NULL, CSIDL_PROGRAM_FILESX86, NULL, 0, path))) + SHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES, NULL, 0, path); + strcat(path, "\"); + strcat(path, file); + return GetFileAttributesA(path) != INVALID_FILE_ATTRIBUTES; +} + +UINT WINAPI cf_present(MSIHANDLE hinst) +{ +todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { + ok(hinst, pf_exists("msitest\first"), "folder absent\n"); + ok(hinst, pf_exists("msitest\second"), "folder absent\n"); + ok(hinst, pf_exists("msitest\third"), "folder absent\n"); +} + return ERROR_SUCCESS; +} + +UINT WINAPI cf_absent(MSIHANDLE hinst) +{ +todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { + ok(hinst, !pf_exists("msitest\first"), "folder present\n"); + ok(hinst, !pf_exists("msitest\second"), "folder present\n"); + ok(hinst, !pf_exists("msitest\third"), "folder present\n"); +} + return ERROR_SUCCESS; +} diff --git a/dlls/msi/tests/custom.spec b/dlls/msi/tests/custom.spec index 51bb60e..cac0f85 100644 --- a/dlls/msi/tests/custom.spec +++ b/dlls/msi/tests/custom.spec @@ -3,3 +3,5 @@ @ stdcall da_immediate(long) @ stdcall da_deferred(long) @ stdcall nested(long) +@ stdcall cf_present(long) +@ stdcall cf_absent(long)
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/msi/tests/action.c | 14 ++++++++++++++ dlls/msi/tests/custom.c | 14 ++++++++++++++ dlls/msi/tests/custom.spec | 2 ++ 3 files changed, 30 insertions(+)
diff --git a/dlls/msi/tests/action.c b/dlls/msi/tests/action.c index ae1b47b..ce36eda 100644 --- a/dlls/msi/tests/action.c +++ b/dlls/msi/tests/action.c @@ -917,12 +917,25 @@ static const char crs_install_exec_seq_dat[] = "RemoveFiles\t\t1700\n" "InstallFiles\t\t2000\n" "RemoveShortcuts\t\t3000\n" + "rs_immediate\tREMOVE\t3001\n" + "rs_deferred\tREMOVE\t3002\n" "CreateShortcuts\t\t3100\n" + "cs_immediate\tNOT REMOVE\t3101\n" + "cs_deferred\tNOT REMOVE\t3102\n" "RegisterProduct\t\t5000\n" "PublishFeatures\t\t5100\n" "PublishProduct\t\t5200\n" "InstallFinalize\t\t6000\n";
+static const char crs_custom_action_dat[] = + "Action\tType\tSource\tTarget\n" + "s72\ti2\tS64\tS0\n" + "CustomAction\tAction\n" + "cs_immediate\t1\tcustom.dll\tcrs_absent\n" + "cs_deferred\t1025\tcustom.dll\tcrs_present\n" + "rs_immediate\t1\tcustom.dll\tcrs_present\n" + "rs_deferred\t1025\tcustom.dll\tcrs_absent\n"; + static const char pub_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n" "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n" @@ -1905,6 +1918,7 @@ static const msi_table crs_tables[] = ADD_TABLE(crs_file), ADD_TABLE(crs_shortcut), ADD_TABLE(crs_install_exec_seq), + ADD_TABLE(crs_custom_action), ADD_TABLE(media), ADD_TABLE(property) }; diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index aeee98e..db6d612 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/custom.c @@ -1178,3 +1178,17 @@ todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { } return ERROR_SUCCESS; } + +UINT WINAPI crs_present(MSIHANDLE hinst) +{ +todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) + ok(hinst, pf_exists("msitest\shortcut.lnk"), "shortcut absent\n"); + return ERROR_SUCCESS; +} + +UINT WINAPI crs_absent(MSIHANDLE hinst) +{ +todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) + ok(hinst, !pf_exists("msitest\shortcut.lnk"), "shortcut present\n"); + return ERROR_SUCCESS; +} diff --git a/dlls/msi/tests/custom.spec b/dlls/msi/tests/custom.spec index cac0f85..774f77b 100644 --- a/dlls/msi/tests/custom.spec +++ b/dlls/msi/tests/custom.spec @@ -5,3 +5,5 @@ @ stdcall nested(long) @ stdcall cf_present(long) @ stdcall cf_absent(long) +@ stdcall crs_present(long) +@ stdcall crs_absent(long)
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at https://testbot.winehq.org/JobDetails.pl?Key=38485
Your paranoid android.
=== wxppro (32 bit install) === msi:install contains a misplaced failure message for custom
=== w7pro64 (32 bit custom) === The previous 1 run(s) terminated abnormally
=== w7pro64 (64 bit custom) === The previous 1 run(s) terminated abnormally
Signed-off-by: Hans Leidekker hans@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/msi/tests/Makefile.in | 2 +- dlls/msi/tests/action.c | 10 ++++++++++ dlls/msi/tests/custom.c | 24 ++++++++++++++++++++++++ dlls/msi/tests/custom.spec | 2 ++ 4 files changed, 37 insertions(+), 1 deletion(-)
diff --git a/dlls/msi/tests/Makefile.in b/dlls/msi/tests/Makefile.in index 248439a..2cfc59b 100644 --- a/dlls/msi/tests/Makefile.in +++ b/dlls/msi/tests/Makefile.in @@ -1,7 +1,7 @@ TESTDLL = msi.dll IMPORTS = cabinet msi shell32 ole32 oleaut32 user32 advapi32 version
-custom_IMPORTS = uuid msi ole32 shell32 +custom_IMPORTS = uuid msi ole32 shell32 advapi32
SOURCES = \ action.c \ diff --git a/dlls/msi/tests/action.c b/dlls/msi/tests/action.c index ce36eda..b005529 100644 --- a/dlls/msi/tests/action.c +++ b/dlls/msi/tests/action.c @@ -282,6 +282,8 @@ static const char sds_install_exec_seq_dat[] = "InstallInitialize\t\t1500\n" "StopServices\t\t5000\n" "DeleteServices\t\t5050\n" + "sds_immediate\tNOT REMOVE\t5051\n" + "sds_deferred\tNOT REMOVE\t5052\n" "MoveFiles\t\t5100\n" "InstallFiles\t\t5200\n" "DuplicateFiles\t\t5300\n" @@ -292,6 +294,13 @@ static const char sds_install_exec_seq_dat[] = "PublishProduct\t\t5700\n" "InstallFinalize\t\t6000\n";
+static const char sds_custom_action_dat[] = + "Action\tType\tSource\tTarget\n" + "s72\ti2\tS64\tS0\n" + "CustomAction\tAction\n" + "sds_immediate\t1\tcustom.dll\tsds_present\n" + "sds_deferred\t1025\tcustom.dll\tsds_absent\n"; + static const char rof_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n" "s72\tS38\ts72\ti2\tS255\tS72\n" @@ -1823,6 +1832,7 @@ static const msi_table sds_tables[] = ADD_TABLE(feature_comp), ADD_TABLE(file), ADD_TABLE(sds_install_exec_seq), + ADD_TABLE(sds_custom_action), ADD_TABLE(service_control), ADD_TABLE(service_install), ADD_TABLE(media), diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index db6d612..4497f3c 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/custom.c @@ -23,6 +23,7 @@
#include <windef.h> #include <winbase.h> +#include <winsvc.h> #define COBJMACROS #include <shlobj.h> #include <msxml.h> @@ -1192,3 +1193,26 @@ todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) ok(hinst, !pf_exists("msitest\shortcut.lnk"), "shortcut present\n"); return ERROR_SUCCESS; } + +UINT WINAPI sds_present(MSIHANDLE hinst) +{ + SC_HANDLE manager, service; + manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS); + service = OpenServiceA(manager, "TestService3", GENERIC_ALL); +todo_wine + ok(hinst, !!service, "service absent: %u\n", GetLastError()); + CloseServiceHandle(service); + CloseServiceHandle(manager); + return ERROR_SUCCESS; +} + +UINT WINAPI sds_absent(MSIHANDLE hinst) +{ + SC_HANDLE manager, service; + manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS); + service = OpenServiceA(manager, "TestService3", GENERIC_ALL); + ok(hinst, !service, "service present\n"); + if (service) CloseServiceHandle(service); + CloseServiceHandle(manager); + return ERROR_SUCCESS; +} diff --git a/dlls/msi/tests/custom.spec b/dlls/msi/tests/custom.spec index 774f77b..1485546 100644 --- a/dlls/msi/tests/custom.spec +++ b/dlls/msi/tests/custom.spec @@ -7,3 +7,5 @@ @ stdcall cf_absent(long) @ stdcall crs_present(long) @ stdcall crs_absent(long) +@ stdcall sds_present(long) +@ stdcall sds_absent(long)
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at https://testbot.winehq.org/JobDetails.pl?Key=38486
Your paranoid android.
=== wxppro (32 bit install) === msi:install contains a misplaced failure message for custom
=== w7pro64 (32 bit custom) === The previous 1 run(s) terminated abnormally
=== w7pro64 (64 bit custom) === The previous 1 run(s) terminated abnormally
=== w8 (32 bit automation) === TestBot process got stuck or died unexpectedly The previous 1 run(s) terminated abnormally
Signed-off-by: Hans Leidekker hans@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/msi/tests/action.c | 31 ++++++++++++++++++++++++++++++- dlls/msi/tests/custom.c | 23 +++++++++++++++++++++++ dlls/msi/tests/custom.spec | 2 ++ 3 files changed, 55 insertions(+), 1 deletion(-)
diff --git a/dlls/msi/tests/action.c b/dlls/msi/tests/action.c index b005529..4abf867 100644 --- a/dlls/msi/tests/action.c +++ b/dlls/msi/tests/action.c @@ -301,6 +301,34 @@ static const char sds_custom_action_dat[] = "sds_immediate\t1\tcustom.dll\tsds_present\n" "sds_deferred\t1025\tcustom.dll\tsds_absent\n";
+static const char sis_install_exec_seq_dat[] = + "Action\tCondition\tSequence\n" + "s72\tS255\tI2\n" + "InstallExecuteSequence\tAction\n" + "CostInitialize\t\t800\n" + "FileCost\t\t900\n" + "CostFinalize\t\t1000\n" + "InstallValidate\t\t1400\n" + "InstallInitialize\t\t1500\n" + "StopServices\t\t5000\n" + "DeleteServices\t\t5050\n" + "InstallFiles\t\t5200\n" + "InstallServices\t\t5400\n" + "sis_immediate\tNOT REMOVE\t5401\n" + "sis_deferred\tNOT REMOVE\t5402\n" + "StartServices\t\t5450\n" + "RegisterProduct\t\t5500\n" + "PublishFeatures\t\t5600\n" + "PublishProduct\t\t5700\n" + "InstallFinalize\t\t6000\n"; + +static const char sis_custom_action_dat[] = + "Action\tType\tSource\tTarget\n" + "s72\ti2\tS64\tS0\n" + "CustomAction\tAction\n" + "sis_immediate\t1\tcustom.dll\tsis_absent\n" + "sis_deferred\t1025\tcustom.dll\tsis_present\n"; + static const char rof_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n" "s72\tS38\ts72\ti2\tS255\tS72\n" @@ -1846,7 +1874,8 @@ static const msi_table sis_tables[] = ADD_TABLE(feature), ADD_TABLE(feature_comp), ADD_TABLE(file), - ADD_TABLE(sds_install_exec_seq), + ADD_TABLE(sis_install_exec_seq), + ADD_TABLE(sis_custom_action), ADD_TABLE(service_install2), ADD_TABLE(media), ADD_TABLE(property) diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index 4497f3c..4336504 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/custom.c @@ -1216,3 +1216,26 @@ UINT WINAPI sds_absent(MSIHANDLE hinst) CloseServiceHandle(manager); return ERROR_SUCCESS; } + +UINT WINAPI sis_present(MSIHANDLE hinst) +{ + SC_HANDLE manager, service; + manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS); + service = OpenServiceA(manager, "TestService", GENERIC_ALL); + ok(hinst, !!service, "service absent: %u\n", GetLastError()); + CloseServiceHandle(service); + CloseServiceHandle(manager); + return ERROR_SUCCESS; +} + +UINT WINAPI sis_absent(MSIHANDLE hinst) +{ + SC_HANDLE manager, service; + manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS); + service = OpenServiceA(manager, "TestService", GENERIC_ALL); +todo_wine + ok(hinst, !service, "service present\n"); + if (service) CloseServiceHandle(service); + CloseServiceHandle(manager); + return ERROR_SUCCESS; +} diff --git a/dlls/msi/tests/custom.spec b/dlls/msi/tests/custom.spec index 1485546..471f956 100644 --- a/dlls/msi/tests/custom.spec +++ b/dlls/msi/tests/custom.spec @@ -9,3 +9,5 @@ @ stdcall crs_absent(long) @ stdcall sds_present(long) @ stdcall sds_absent(long) +@ stdcall sis_present(long) +@ stdcall sis_absent(long)
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at https://testbot.winehq.org/JobDetails.pl?Key=38487
Your paranoid android.
=== w7pro64 (64 bit custom) === The previous 1 run(s) terminated abnormally
=== wxppro (32 bit install) === msi:install contains a misplaced failure message for custom
Signed-off-by: Hans Leidekker hans@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/msi/tests/action.c | 12 ++++++++++++ dlls/msi/tests/custom.c | 35 +++++++++++++++++++++++++++++++++++ dlls/msi/tests/custom.spec | 2 ++ 3 files changed, 49 insertions(+)
diff --git a/dlls/msi/tests/action.c b/dlls/msi/tests/action.c index 4abf867..70baaa3 100644 --- a/dlls/msi/tests/action.c +++ b/dlls/msi/tests/action.c @@ -259,16 +259,27 @@ static const char sss_install_exec_seq_dat[] = "InstallValidate\t\t1400\n" "InstallInitialize\t\t1500\n" "StopServices\t\t4000\n" + "stop_immediate\tNOT REMOVE\t4001\n" + "stop_deferred\tNOT REMOVE\t4002\n" "DeleteServices\t\t5000\n" "MoveFiles\t\t5100\n" "InstallFiles\t\t5200\n" "DuplicateFiles\t\t5300\n" "StartServices\t\t5400\n" + "start_deferred\tNOT REMOVE\t5401\n" "RegisterProduct\t\t5500\n" "PublishFeatures\t\t5600\n" "PublishProduct\t\t5700\n" "InstallFinalize\t\t6000\n";
+static const char sss_custom_action_dat[] = + "Action\tType\tSource\tTarget\n" + "s72\ti2\tS64\tS0\n" + "CustomAction\tAction\n" + "stop_immediate\t1\tcustom.dll\tsss_started\n" + "stop_deferred\t1025\tcustom.dll\tsss_stopped\n" + "start_deferred\t1025\tcustom.dll\tsss_started\n"; + static const char sds_install_exec_seq_dat[] = "Action\tCondition\tSequence\n" "s72\tS255\tI2\n" @@ -1848,6 +1859,7 @@ static const msi_table sss_tables[] = ADD_TABLE(file), ADD_TABLE(sss_install_exec_seq), ADD_TABLE(sss_service_control), + ADD_TABLE(sss_custom_action), ADD_TABLE(media), ADD_TABLE(property) }; diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index 4336504..9c9966c 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/custom.c @@ -1239,3 +1239,38 @@ todo_wine CloseServiceHandle(manager); return ERROR_SUCCESS; } + +UINT WINAPI sss_started(MSIHANDLE hinst) +{ + SC_HANDLE manager, service; + SERVICE_STATUS status; + BOOL ret; + + manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS); + service = OpenServiceA(manager, "Spooler", SC_MANAGER_ALL_ACCESS); + ret = QueryServiceStatus(service, &status); + ok(hinst, ret, "QueryServiceStatus failed: %u\n", GetLastError()); +todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) + ok(hinst, status.dwCurrentState == SERVICE_RUNNING, "got %u\n", status.dwCurrentState); + + CloseServiceHandle(service); + CloseServiceHandle(manager); + return ERROR_SUCCESS; +} + +UINT WINAPI sss_stopped(MSIHANDLE hinst) +{ + SC_HANDLE manager, service; + SERVICE_STATUS status; + BOOL ret; + + manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS); + service = OpenServiceA(manager, "Spooler", SC_MANAGER_ALL_ACCESS); + ret = QueryServiceStatus(service, &status); + ok(hinst, ret, "QueryServiceStatus failed: %u\n", GetLastError()); + ok(hinst, status.dwCurrentState == SERVICE_STOPPED, "got %u\n", status.dwCurrentState); + + CloseServiceHandle(service); + CloseServiceHandle(manager); + return ERROR_SUCCESS; +} diff --git a/dlls/msi/tests/custom.spec b/dlls/msi/tests/custom.spec index 471f956..01b95e9 100644 --- a/dlls/msi/tests/custom.spec +++ b/dlls/msi/tests/custom.spec @@ -11,3 +11,5 @@ @ stdcall sds_absent(long) @ stdcall sis_present(long) @ stdcall sis_absent(long) +@ stdcall sss_started(long) +@ stdcall sss_stopped(long)
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at https://testbot.winehq.org/JobDetails.pl?Key=38488
Your paranoid android.
=== wxppro (32 bit install) === msi:install contains a misplaced failure message for custom
=== w7u (32 bit install) === The previous 1 run(s) terminated abnormally
=== w7u (32 bit custom) === The previous 1 run(s) terminated abnormally
=== w7pro64 (32 bit custom) === The previous 1 run(s) terminated abnormally
=== w7pro64 (64 bit custom) === The previous 1 run(s) terminated abnormally
=== w7u (32 bit msi) === The previous 1 run(s) terminated abnormally
Signed-off-by: Hans Leidekker hans@codeweavers.com
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at https://testbot.winehq.org/JobDetails.pl?Key=38484
Your paranoid android.
=== w7pro64 (64 bit custom) === The previous 1 run(s) terminated abnormally
=== wxppro (32 bit install) === msi:install contains a misplaced failure message for custom