msi: Add tests that show that costing is run in both the UI and Execute sequences.
This commit is contained in:
parent
8f1559775c
commit
d8586e164f
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue