msi: Add more tests for feature overrides.

This commit is contained in:
Hans Leidekker 2010-05-20 12:02:41 +02:00 committed by Alexandre Julliard
parent e16f187791
commit 5395c999d2
1 changed files with 119 additions and 15 deletions

View File

@ -1413,6 +1413,63 @@ static const CHAR crs_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
"PublishProduct\t\t5200\n"
"InstallFinalize\t\t6000\n";
static const CHAR fo_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
"s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
"File\tFile\n"
"override.txt\toverride\toverride.txt\t1000\t\t\t8192\t1\n"
"preselected.txt\tpreselected\tpreselected.txt\t1000\t\t\t8192\t2\n"
"notpreselected.txt\tnotpreselected\tnotpreselected.txt\t1000\t\t\t8192\t3\n";
static const CHAR fo_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
"s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
"Feature\tFeature\n"
"override\t\t\toverride feature\t1\t1\tMSITESTDIR\t0\n"
"preselected\t\t\tpreselected feature\t1\t1\tMSITESTDIR\t0\n"
"notpreselected\t\t\tnotpreselected feature\t1\t1\tMSITESTDIR\t0\n";
static const CHAR fo_condition_dat[] = "Feature_\tLevel\tCondition\n"
"s38\ti2\tS255\n"
"Condition\tFeature_\tLevel\n"
"preselected\t0\tPreselected\n"
"notpreselected\t0\tNOT Preselected\n";
static const CHAR fo_feature_comp_dat[] = "Feature_\tComponent_\n"
"s38\ts72\n"
"FeatureComponents\tFeature_\tComponent_\n"
"override\toverride\n"
"preselected\tpreselected\n"
"notpreselected\tnotpreselected\n";
static const CHAR fo_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
"s72\tS38\ts72\ti2\tS255\tS72\n"
"Component\tComponent\n"
"override\t{0A00FB1D-97B0-4B42-ADF0-BB8913416623}\tMSITESTDIR\t0\t\toverride.txt\n"
"preselected\t{44E1DB75-605A-43DD-8CF5-CAB17F1BBD60}\tMSITESTDIR\t0\t\tpreselected.txt\n"
"notpreselected\t{E1647733-5E75-400A-A92E-5E60B4D4EF9F}\tMSITESTDIR\t0\t\tnotpreselected.txt\n";
static const CHAR fo_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
"s72\ti2\tS64\tS0\tS255\n"
"CustomAction\tAction\n"
"SetPreselected\t51\tPreselected\t1\t\n";
static const CHAR fo_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
"s72\tS255\tI2\n"
"InstallExecuteSequence\tAction\n"
"LaunchConditions\t\t100\n"
"SetPreselected\tpreselect=1\t200\n"
"CostInitialize\t\t800\n"
"FileCost\t\t900\n"
"CostFinalize\t\t1000\n"
"InstallValidate\t\t1400\n"
"InstallInitialize\t\t1500\n"
"ProcessComponents\t\t1600\n"
"RemoveFiles\t\t1700\n"
"InstallFiles\t\t2000\n"
"RegisterProduct\t\t5000\n"
"PublishFeatures\t\t5100\n"
"PublishProduct\t\t5200\n"
"InstallFinalize\t\t6000\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"
"File\tFile\n"
@ -2822,6 +2879,20 @@ static const msi_table rmi_tables[] =
ADD_TABLE(property)
};
static const msi_table fo_tables[] =
{
ADD_TABLE(directory),
ADD_TABLE(fo_file),
ADD_TABLE(fo_component),
ADD_TABLE(fo_feature),
ADD_TABLE(fo_condition),
ADD_TABLE(fo_feature_comp),
ADD_TABLE(fo_custom_action),
ADD_TABLE(fo_install_exec_seq),
ADD_TABLE(media),
ADD_TABLE(property)
};
/* cabinet definitions */
/* make the max size large so there is only one cab file */
@ -8384,27 +8455,60 @@ static void test_feature_override(void)
UINT r;
create_test_files();
create_database(msifile, tables, sizeof(tables) / sizeof(msi_table));
create_file("msitest\\override.txt", 1000);
create_file("msitest\\preselected.txt", 1000);
create_file("msitest\\notpreselected.txt", 1000);
create_database(msifile, fo_tables, sizeof(fo_tables) / sizeof(msi_table));
r = MsiInstallProductA(msifile, "ADDLOCAL=One");
r = MsiInstallProductA(msifile, "ADDLOCAL=override");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(!delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File installed\n");
ok(!delete_pf("msitest\\cabout\\new", FALSE), "File installed\n");
ok(!delete_pf("msitest\\cabout\\four.txt", TRUE), "File installed\n");
ok(!delete_pf("msitest\\cabout", FALSE), "File installed\n");
ok(!delete_pf("msitest\\changed\\three.txt", TRUE), "File installed\n");
ok(!delete_pf("msitest\\changed", FALSE), "File installed\n");
ok(!delete_pf("msitest\\first\\two.txt", TRUE), "File installed\n");
ok(!delete_pf("msitest\\first", FALSE), "File installed\n");
ok(!delete_pf("msitest\\filename", TRUE), "File installed\n");
ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
ok(!delete_pf("msitest\\service.exe", TRUE), "File installed\n");
ok(delete_pf("msitest", FALSE), "File not installed\n");
ok(pf_exists("msitest\\override.txt"), "file not installed\n");
ok(!pf_exists("msitest\\preselected.txt"), "file installed\n");
ok(!pf_exists("msitest\\notpreselected.txt"), "file installed\n");
delete_test_files();
r = MsiInstallProductA(msifile, "REMOVE=ALL");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(!delete_pf("msitest\\override.txt", TRUE), "file not removed\n");
r = MsiInstallProductA(msifile, "preselect=1");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(pf_exists("msitest\\override.txt"), "file not installed\n");
ok(pf_exists("msitest\\preselected.txt"), "file not installed\n");
ok(!pf_exists("msitest\\notpreselected.txt"), "file installed\n");
r = MsiInstallProductA(msifile, "REMOVE=ALL");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(!delete_pf("msitest\\override.txt", TRUE), "file not removed\n");
todo_wine {
ok(delete_pf("msitest\\preselected.txt", TRUE), "file removed\n");
ok(delete_pf("msitest", FALSE), "directory removed\n");
}
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(pf_exists("msitest\\override.txt"), "file not installed\n");
ok(pf_exists("msitest\\preselected.txt"), "file not installed\n");
ok(!pf_exists("msitest\\notpreselected.txt"), "file installed\n");
r = MsiInstallProductA(msifile, "REMOVE=ALL");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(!delete_pf("msitest\\override.txt", TRUE), "file not removed\n");
todo_wine {
ok(delete_pf("msitest\\preselected.txt", TRUE), "file removed\n");
ok(delete_pf("msitest", FALSE), "directory removed\n");
}
DeleteFileA("msitest\\override.txt");
DeleteFileA("msitest\\preselected.txt");
DeleteFileA("msitest\\notpreselected.txt");
RegDeleteKeyA(HKEY_LOCAL_MACHINE, "Software\\Wine\\msitest");
delete_test_files();
}
static void test_create_folder(void)