Module: wine Branch: master Commit: d8586e164f7892c480db3a1427b4ec6a6be98c05 URL: http://source.winehq.org/git/wine.git/?a=commit;h=d8586e164f7892c480db3a1427...
Author: James Hawkins truiken@gmail.com Date: Tue May 1 03:18:59 2007 -0500
msi: Add tests that show that costing is run in both the UI and Execute sequences.
---
dlls/msi/tests/install.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 66 insertions(+), 0 deletions(-)
diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c index 5b7050f..b1cb4b8 100644 --- a/dlls/msi/tests/install.c +++ b/dlls/msi/tests/install.c @@ -355,6 +355,33 @@ static const CHAR ci2_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersio "File\tFile\n" "augustus\taugustus\taugustus\t500\t\t\t8192\t1";
+static const CHAR spf_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n" + "s72\ti2\tS64\tS0\tS255\n" + "CustomAction\tAction\n" + "SetFolderProp\t51\tMSITESTDIR\t[ProgramFilesFolder]\msitest\added\t\n"; + +static const CHAR spf_install_exec_seq_dat[] = "Action\tCondition\tSequence\n" + "s72\tS255\tI2\n" + "InstallExecuteSequence\tAction\n" + "CostFinalize\t\t1000\n" + "CostInitialize\t\t800\n" + "FileCost\t\t900\n" + "SetFolderProp\t\t950\n" + "InstallFiles\t\t4000\n" + "InstallServices\t\t5000\n" + "InstallFinalize\t\t6600\n" + "InstallInitialize\t\t1500\n" + "InstallValidate\t\t1400\n" + "LaunchConditions\t\t100"; + +static const CHAR spf_install_ui_seq_dat[] = "Action\tCondition\tSequence\n" + "s72\tS255\tI2\n" + "InstallUISequence\tAction\n" + "CostInitialize\t\t800\n" + "FileCost\t\t900\n" + "CostFinalize\t\t1000\n" + "ExecuteAction\t\t1100\n"; + typedef struct _msi_table { const CHAR *filename; @@ -515,6 +542,20 @@ static const msi_table ci2_tables[] = ADD_TABLE(property), };
+static const msi_table spf_tables[] = +{ + ADD_TABLE(ci_component), + ADD_TABLE(directory), + ADD_TABLE(rof_feature), + ADD_TABLE(rof_feature_comp), + ADD_TABLE(rof_file), + ADD_TABLE(spf_install_exec_seq), + ADD_TABLE(rof_media), + ADD_TABLE(property), + ADD_TABLE(spf_custom_action), + ADD_TABLE(spf_install_ui_seq), +}; + /* cabinet definitions */
/* make the max size large so there is only one cab file */ @@ -1425,6 +1466,30 @@ static void test_concurrentinstall(void) DeleteFile(msifile); }
+static void test_setpropertyfolder(void) +{ + UINT r; + + CreateDirectoryA("msitest", NULL); + create_file("msitest\maximus", 500); + + create_database(msifile, spf_tables, sizeof(spf_tables) / sizeof(msi_table)); + + MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL); + + r = MsiInstallProductA(msifile, NULL); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + delete_pf("msitest\maximus", TRUE); /* FIXME: remove when the tests pass */ + todo_wine + { + ok(delete_pf("msitest\added\maximus", TRUE), "File not installed\n"); + ok(delete_pf("msitest\added", FALSE), "File not installed\n"); + } + ok(delete_pf("msitest", FALSE), "File not installed\n"); + + DeleteFile(msifile); +} + START_TEST(install) { DWORD len; @@ -1454,6 +1519,7 @@ START_TEST(install) test_setdirproperty(); test_cabisextracted(); test_concurrentinstall(); + test_setpropertyfolder();
SetCurrentDirectoryA(prev_path); }