msi: Fix handling of REINSTALL overrides.

We were forcing features with a REINSTALL override to be reinstalled
locally, which is only correct if the original install state is local.

This causes problems with the office 2007 sp1 installer, which applies
a REINSTALL override to an advertised feature.
This commit is contained in:
Hans Leidekker 2009-03-12 11:46:35 +01:00 committed by Alexandre Julliard
parent a2de9de262
commit 40cfbaf023
2 changed files with 314 additions and 25 deletions

View File

@ -1782,6 +1782,7 @@ static BOOL process_state_property(MSIPACKAGE* package, int level,
{ {
static const WCHAR all[]={'A','L','L',0}; static const WCHAR all[]={'A','L','L',0};
static const WCHAR remove[] = {'R','E','M','O','V','E',0}; static const WCHAR remove[] = {'R','E','M','O','V','E',0};
static const WCHAR reinstall[] = {'R','E','I','N','S','T','A','L','L',0};
LPWSTR override; LPWSTR override;
MSIFEATURE *feature; MSIFEATURE *feature;
@ -1795,6 +1796,8 @@ static BOOL process_state_property(MSIPACKAGE* package, int level,
(feature->Level <= 0 || feature->Level > level)) (feature->Level <= 0 || feature->Level > level))
continue; continue;
if (!strcmpW(property, reinstall)) state = feature->Installed;
if (strcmpiW(override,all)==0) if (strcmpiW(override,all)==0)
msi_feature_set_state(package, feature, state); msi_feature_set_state(package, feature, state);
else else
@ -1871,7 +1874,7 @@ UINT MSI_SetFeatureStates(MSIPACKAGE *package)
override |= process_state_property(package, level, szAddLocal, INSTALLSTATE_LOCAL); override |= process_state_property(package, level, szAddLocal, INSTALLSTATE_LOCAL);
override |= process_state_property(package, level, szRemove, INSTALLSTATE_ABSENT); override |= process_state_property(package, level, szRemove, INSTALLSTATE_ABSENT);
override |= process_state_property(package, level, szAddSource, INSTALLSTATE_SOURCE); override |= process_state_property(package, level, szAddSource, INSTALLSTATE_SOURCE);
override |= process_state_property(package, level, szReinstall, INSTALLSTATE_LOCAL); override |= process_state_property(package, level, szReinstall, INSTALLSTATE_UNKNOWN);
if (!override) if (!override)
{ {

View File

@ -2437,6 +2437,13 @@ static void test_states(void)
r = add_component_entry( hdb, "'phi', '{9F0594C5-35AD-43EA-94DD-8DF73FAA664D}', 'TARGETDIR', 1, '', 'phi_file'" ); r = add_component_entry( hdb, "'phi', '{9F0594C5-35AD-43EA-94DD-8DF73FAA664D}', 'TARGETDIR', 1, '', 'phi_file'" );
ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r ); ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
/* msidbFeatureAttributesFavorAdvertise */
r = add_feature_entry( hdb, "'ten', '', '', '', 2, 1, '', 4" );
ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
r = add_component_entry( hdb, "'chi', '{E6B539AB-5DA9-4236-A2D2-E341A50B4C38}', 'TARGETDIR', 1, '', 'chi_file'" );
ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
r = create_feature_components_table( hdb ); r = create_feature_components_table( hdb );
ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r ); ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r );
@ -2503,6 +2510,9 @@ static void test_states(void)
r = add_feature_components_entry( hdb, "'nine', 'phi'" ); r = add_feature_components_entry( hdb, "'nine', 'phi'" );
ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r ); ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
r = add_feature_components_entry( hdb, "'ten', 'chi'" );
ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
r = create_file_table( hdb ); r = create_file_table( hdb );
ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r ); ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
@ -2567,6 +2577,9 @@ static void test_states(void)
r = add_file_entry( hdb, "'phi_file', 'phi', 'phi.txt', 100, '', '1033', 8192, 1" ); r = add_file_entry( hdb, "'phi_file', 'phi', 'phi.txt', 100, '', '1033', 8192, 1" );
ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r); ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
r = add_file_entry( hdb, "'chi_file', 'chi', 'chi.txt', 100, '', '1033', 8192, 1" );
ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
MsiDatabaseCommit(hdb); MsiDatabaseCommit(hdb);
/* these properties must not be in the saved msi file */ /* these properties must not be in the saved msi file */
@ -2579,7 +2592,7 @@ static void test_states(void)
r = add_property_entry( hdb, "'REMOVE', 'six,seven'"); r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r ); ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
r = add_property_entry( hdb, "'REINSTALL', 'eight,nine'"); r = add_property_entry( hdb, "'REINSTALL', 'eight,nine,ten'");
ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r ); ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
r = add_property_entry( hdb, "'REINSTALLMODE', 'omus'"); r = add_property_entry( hdb, "'REINSTALLMODE', 'omus'");
@ -2657,6 +2670,13 @@ static void test_states(void)
ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state); ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action); ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetFeatureState(hpkg, "ten", &state, &action);
ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
state = 0xdeadbee; state = 0xdeadbee;
action = 0xdeadbee; action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "alpha", &state, &action); r = MsiGetComponentState(hpkg, "alpha", &state, &action);
@ -2797,6 +2817,13 @@ static void test_states(void)
ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state); ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action); ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "chi", &state, &action);
ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
r = MsiDoAction( hpkg, "CostInitialize"); r = MsiDoAction( hpkg, "CostInitialize");
ok( r == ERROR_SUCCESS, "cost init failed\n"); ok( r == ERROR_SUCCESS, "cost init failed\n");
@ -2863,6 +2890,13 @@ static void test_states(void)
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetFeatureState(hpkg, "ten", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee; state = 0xdeadbee;
action = 0xdeadbee; action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "alpha", &state, &action); r = MsiGetComponentState(hpkg, "alpha", &state, &action);
@ -3003,6 +3037,13 @@ static void test_states(void)
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "chi", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
r = MsiDoAction( hpkg, "FileCost"); r = MsiDoAction( hpkg, "FileCost");
ok( r == ERROR_SUCCESS, "file cost failed\n"); ok( r == ERROR_SUCCESS, "file cost failed\n");
@ -3069,6 +3110,13 @@ static void test_states(void)
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetFeatureState(hpkg, "ten", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee; state = 0xdeadbee;
action = 0xdeadbee; action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "alpha", &state, &action); r = MsiGetComponentState(hpkg, "alpha", &state, &action);
@ -3209,6 +3257,13 @@ static void test_states(void)
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "chi", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
r = MsiDoAction( hpkg, "CostFinalize"); r = MsiDoAction( hpkg, "CostFinalize");
ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r); ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
@ -3266,14 +3321,21 @@ static void test_states(void)
r = MsiGetFeatureState(hpkg, "eight", &state, &action); r = MsiGetFeatureState(hpkg, "eight", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state); ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee; state = 0xdeadbee;
action = 0xdeadbee; action = 0xdeadbee;
r = MsiGetFeatureState(hpkg, "nine", &state, &action); r = MsiGetFeatureState(hpkg, "nine", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state); ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetFeatureState(hpkg, "ten", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee; state = 0xdeadbee;
action = 0xdeadbee; action = 0xdeadbee;
@ -3406,19 +3468,26 @@ static void test_states(void)
r = MsiGetComponentState(hpkg, "tau", &state, &action); r = MsiGetComponentState(hpkg, "tau", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state); ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee; state = 0xdeadbee;
action = 0xdeadbee; action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "phi", &state, &action); r = MsiGetComponentState(hpkg, "phi", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state); ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "chi", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
MsiCloseHandle( hpkg ); MsiCloseHandle( hpkg );
/* publish the features and components */ /* publish the features and components */
r = MsiInstallProduct(msifile, "ADDLOCAL=one,four ADDSOURCE=two,three REMOVE=six,seven REINSTALL=eight,nine"); r = MsiInstallProduct(msifile, "ADDLOCAL=one,four ADDSOURCE=two,three REMOVE=six,seven REINSTALL=eight,nine,ten");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb); r = MsiOpenDatabase(msifile, MSIDBOPEN_DIRECT, &hdb);
@ -3434,7 +3503,7 @@ static void test_states(void)
r = add_property_entry( hdb, "'REMOVE', 'six,seven'"); r = add_property_entry( hdb, "'REMOVE', 'six,seven'");
ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r ); ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
r = add_property_entry( hdb, "'REINSTALL', 'eight,nine'"); r = add_property_entry( hdb, "'REINSTALL', 'eight,nine,ten'");
ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r ); ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
hpkg = package_from_db( hdb ); hpkg = package_from_db( hdb );
@ -3505,6 +3574,13 @@ static void test_states(void)
ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state); ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action); ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetFeatureState(hpkg, "ten", &state, &action);
ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
state = 0xdeadbee; state = 0xdeadbee;
action = 0xdeadbee; action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "alpha", &state, &action); r = MsiGetComponentState(hpkg, "alpha", &state, &action);
@ -3645,6 +3721,13 @@ static void test_states(void)
ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state); ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action); ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "chi", &state, &action);
ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
r = MsiDoAction( hpkg, "CostInitialize"); r = MsiDoAction( hpkg, "CostInitialize");
ok( r == ERROR_SUCCESS, "cost init failed\n"); ok( r == ERROR_SUCCESS, "cost init failed\n");
@ -3711,6 +3794,13 @@ static void test_states(void)
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetFeatureState(hpkg, "ten", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee; state = 0xdeadbee;
action = 0xdeadbee; action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "alpha", &state, &action); r = MsiGetComponentState(hpkg, "alpha", &state, &action);
@ -3851,6 +3941,13 @@ static void test_states(void)
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "chi", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
r = MsiDoAction( hpkg, "FileCost"); r = MsiDoAction( hpkg, "FileCost");
ok( r == ERROR_SUCCESS, "file cost failed\n"); ok( r == ERROR_SUCCESS, "file cost failed\n");
@ -4057,6 +4154,13 @@ static void test_states(void)
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "chi", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
r = MsiDoAction( hpkg, "CostFinalize"); r = MsiDoAction( hpkg, "CostFinalize");
ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r); ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
@ -4113,15 +4217,22 @@ static void test_states(void)
action = 0xdeadbee; action = 0xdeadbee;
r = MsiGetFeatureState(hpkg, "eight", &state, &action); r = MsiGetFeatureState(hpkg, "eight", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
todo_wine ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state); ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee; state = 0xdeadbee;
action = 0xdeadbee; action = 0xdeadbee;
r = MsiGetFeatureState(hpkg, "nine", &state, &action); r = MsiGetFeatureState(hpkg, "nine", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
todo_wine ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state); ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetFeatureState(hpkg, "ten", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee; state = 0xdeadbee;
action = 0xdeadbee; action = 0xdeadbee;
@ -4253,15 +4364,22 @@ static void test_states(void)
action = 0xdeadbee; action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "tau", &state, &action); r = MsiGetComponentState(hpkg, "tau", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
todo_wine ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state); ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee; state = 0xdeadbee;
action = 0xdeadbee; action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "phi", &state, &action); r = MsiGetComponentState(hpkg, "phi", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
todo_wine ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state); ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
todo_wine ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "chi", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
MsiCloseHandle(hpkg); MsiCloseHandle(hpkg);
@ -4277,7 +4395,7 @@ static void test_states(void)
ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r); ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
/* these properties must not be in the saved msi file */ /* these properties must not be in the saved msi file */
r = add_property_entry( hdb, "'ADDLOCAL', 'one,two,three,four,five,six,seven,eight,nine'"); r = add_property_entry( hdb, "'ADDLOCAL', 'one,two,three,four,five,six,seven,eight,nine,ten'");
ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r ); ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
hpkg = package_from_db( hdb ); hpkg = package_from_db( hdb );
@ -4346,6 +4464,13 @@ static void test_states(void)
ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state); ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action); ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetFeatureState(hpkg, "ten", &state, &action);
ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
state = 0xdeadbee; state = 0xdeadbee;
action = 0xdeadbee; action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "alpha", &state, &action); r = MsiGetComponentState(hpkg, "alpha", &state, &action);
@ -4486,6 +4611,13 @@ static void test_states(void)
ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state); ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action); ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "chi", &state, &action);
ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
r = MsiDoAction( hpkg, "CostInitialize"); r = MsiDoAction( hpkg, "CostInitialize");
ok( r == ERROR_SUCCESS, "cost init failed\n"); ok( r == ERROR_SUCCESS, "cost init failed\n");
@ -4552,6 +4684,13 @@ static void test_states(void)
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetFeatureState(hpkg, "ten", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee; state = 0xdeadbee;
action = 0xdeadbee; action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "alpha", &state, &action); r = MsiGetComponentState(hpkg, "alpha", &state, &action);
@ -4692,6 +4831,13 @@ static void test_states(void)
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "chi", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
r = MsiDoAction( hpkg, "FileCost"); r = MsiDoAction( hpkg, "FileCost");
ok( r == ERROR_SUCCESS, "file cost failed\n"); ok( r == ERROR_SUCCESS, "file cost failed\n");
@ -4758,6 +4904,13 @@ static void test_states(void)
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetFeatureState(hpkg, "ten", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee; state = 0xdeadbee;
action = 0xdeadbee; action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "alpha", &state, &action); r = MsiGetComponentState(hpkg, "alpha", &state, &action);
@ -4898,6 +5051,13 @@ static void test_states(void)
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "chi", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
r = MsiDoAction( hpkg, "CostFinalize"); r = MsiDoAction( hpkg, "CostFinalize");
ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r); ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
@ -4964,6 +5124,13 @@ static void test_states(void)
ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state); ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action); todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetFeatureState(hpkg, "ten", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
todo_wine ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
state = 0xdeadbee; state = 0xdeadbee;
action = 0xdeadbee; action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "alpha", &state, &action); r = MsiGetComponentState(hpkg, "alpha", &state, &action);
@ -5104,6 +5271,13 @@ static void test_states(void)
ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state); ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state); ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "chi", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
MsiCloseHandle(hpkg); MsiCloseHandle(hpkg);
/* uninstall the product */ /* uninstall the product */
@ -5118,7 +5292,7 @@ static void test_states(void)
ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r); ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
/* this property must not be in the saved msi file */ /* this property must not be in the saved msi file */
r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine'"); r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine,ten'");
ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r ); ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
hpkg = package_from_db( hdb ); hpkg = package_from_db( hdb );
@ -5187,6 +5361,13 @@ static void test_states(void)
ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state); ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action); ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetFeatureState(hpkg, "ten", &state, &action);
ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
state = 0xdeadbee; state = 0xdeadbee;
action = 0xdeadbee; action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "alpha", &state, &action); r = MsiGetComponentState(hpkg, "alpha", &state, &action);
@ -5327,6 +5508,13 @@ static void test_states(void)
ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state); ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action); ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "chi", &state, &action);
ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
r = MsiDoAction( hpkg, "CostInitialize"); r = MsiDoAction( hpkg, "CostInitialize");
ok( r == ERROR_SUCCESS, "cost init failed\n"); ok( r == ERROR_SUCCESS, "cost init failed\n");
@ -5393,6 +5581,13 @@ static void test_states(void)
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetFeatureState(hpkg, "ten", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee; state = 0xdeadbee;
action = 0xdeadbee; action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "alpha", &state, &action); r = MsiGetComponentState(hpkg, "alpha", &state, &action);
@ -5533,6 +5728,13 @@ static void test_states(void)
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "chi", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
r = MsiDoAction( hpkg, "FileCost"); r = MsiDoAction( hpkg, "FileCost");
ok( r == ERROR_SUCCESS, "file cost failed\n"); ok( r == ERROR_SUCCESS, "file cost failed\n");
@ -5599,6 +5801,13 @@ static void test_states(void)
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetFeatureState(hpkg, "ten", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee; state = 0xdeadbee;
action = 0xdeadbee; action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "alpha", &state, &action); r = MsiGetComponentState(hpkg, "alpha", &state, &action);
@ -5739,6 +5948,13 @@ static void test_states(void)
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "chi", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
r = MsiDoAction( hpkg, "CostFinalize"); r = MsiDoAction( hpkg, "CostFinalize");
ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r); ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
@ -5805,6 +6021,13 @@ static void test_states(void)
ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state); ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state); ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetFeatureState(hpkg, "ten", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
state = 0xdeadbee; state = 0xdeadbee;
action = 0xdeadbee; action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "alpha", &state, &action); r = MsiGetComponentState(hpkg, "alpha", &state, &action);
@ -5945,6 +6168,13 @@ static void test_states(void)
ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state); ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state); ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "chi", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
MsiCloseHandle(hpkg); MsiCloseHandle(hpkg);
/* reinstall the product */ /* reinstall the product */
@ -5955,7 +6185,7 @@ static void test_states(void)
ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r); ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r);
/* this property must not be in the saved msi file */ /* this property must not be in the saved msi file */
r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine'"); r = add_property_entry( hdb, "'ADDSOURCE', 'one,two,three,four,five,six,seven,eight,nine,ten'");
ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r ); ok( r == ERROR_SUCCESS, "cannot add property: %d\n", r );
hpkg = package_from_db( hdb ); hpkg = package_from_db( hdb );
@ -6024,6 +6254,13 @@ static void test_states(void)
ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state); ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action); ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetFeatureState(hpkg, "ten", &state, &action);
ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
state = 0xdeadbee; state = 0xdeadbee;
action = 0xdeadbee; action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "alpha", &state, &action); r = MsiGetComponentState(hpkg, "alpha", &state, &action);
@ -6164,6 +6401,13 @@ static void test_states(void)
ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state); ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action); ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "chi", &state, &action);
ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
r = MsiDoAction( hpkg, "CostInitialize"); r = MsiDoAction( hpkg, "CostInitialize");
ok( r == ERROR_SUCCESS, "cost init failed\n"); ok( r == ERROR_SUCCESS, "cost init failed\n");
@ -6230,6 +6474,13 @@ static void test_states(void)
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetFeatureState(hpkg, "ten", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee; state = 0xdeadbee;
action = 0xdeadbee; action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "alpha", &state, &action); r = MsiGetComponentState(hpkg, "alpha", &state, &action);
@ -6370,6 +6621,13 @@ static void test_states(void)
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "chi", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
r = MsiDoAction( hpkg, "FileCost"); r = MsiDoAction( hpkg, "FileCost");
ok( r == ERROR_SUCCESS, "file cost failed\n"); ok( r == ERROR_SUCCESS, "file cost failed\n");
@ -6436,6 +6694,13 @@ static void test_states(void)
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetFeatureState(hpkg, "ten", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee; state = 0xdeadbee;
action = 0xdeadbee; action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "alpha", &state, &action); r = MsiGetComponentState(hpkg, "alpha", &state, &action);
@ -6576,6 +6841,13 @@ static void test_states(void)
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "chi", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
r = MsiDoAction( hpkg, "CostFinalize"); r = MsiDoAction( hpkg, "CostFinalize");
ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r); ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r);
@ -6642,6 +6914,13 @@ static void test_states(void)
ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state); ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action); ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetFeatureState(hpkg, "ten", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
state = 0xdeadbee; state = 0xdeadbee;
action = 0xdeadbee; action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "alpha", &state, &action); r = MsiGetComponentState(hpkg, "alpha", &state, &action);
@ -6660,7 +6939,7 @@ static void test_states(void)
action = 0xdeadbee; action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "gamma", &state, &action); r = MsiGetComponentState(hpkg, "gamma", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
todo_wine ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state); ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee; state = 0xdeadbee;
@ -6688,7 +6967,7 @@ static void test_states(void)
action = 0xdeadbee; action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "zeta", &state, &action); r = MsiGetComponentState(hpkg, "zeta", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
todo_wine ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state); ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee; state = 0xdeadbee;
@ -6730,8 +7009,8 @@ static void test_states(void)
action = 0xdeadbee; action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "nu", &state, &action); r = MsiGetComponentState(hpkg, "nu", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
todo_wine ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state); ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
todo_wine ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state); ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
state = 0xdeadbee; state = 0xdeadbee;
action = 0xdeadbee; action = 0xdeadbee;
@ -6758,8 +7037,8 @@ static void test_states(void)
action = 0xdeadbee; action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "rho", &state, &action); r = MsiGetComponentState(hpkg, "rho", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
todo_wine ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state); ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
todo_wine ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state); ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
state = 0xdeadbee; state = 0xdeadbee;
action = 0xdeadbee; action = 0xdeadbee;
@ -6782,6 +7061,13 @@ static void test_states(void)
ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state); ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state); ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "chi", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
MsiCloseHandle(hpkg); MsiCloseHandle(hpkg);
/* uninstall the product */ /* uninstall the product */