@@ -1316,6 +1316,28 @@ static const CHAR x64_directory_dat[] =
13161316 "ProgramFiles64Folder\tTARGETDIR\t.\n"
13171317 "TARGETDIR\t\tSourceDir" ;
13181318
1319+ static const CHAR sr_install_exec_seq_dat [] =
1320+ "Action\tCondition\tSequence\n"
1321+ "s72\tS255\tI2\n"
1322+ "InstallExecuteSequence\tAction\n"
1323+ "CostInitialize\t\t200\n"
1324+ "FileCost\t\t300\n"
1325+ "CostFinalize\t\t400\n"
1326+ "InstallValidate\t\t500\n"
1327+ "InstallInitialize\t\t600\n"
1328+ "sourcedir_unset\tSourceDir\t700\n"
1329+ "ResolveSource\tRESOLVE_SOURCE\t800\n"
1330+ "ProcessComponents\tPROCESS_COMPONENTS\t800\n"
1331+ "sourcedir_set\tNOT SourceDir\t900\n"
1332+ "InstallFinalize\t\t1000\n" ;
1333+
1334+ static const CHAR sr_custom_action_dat [] =
1335+ "Action\tType\tSource\tTarget\n"
1336+ "s72\ti2\tS64\tS0\n"
1337+ "CustomAction\tAction\n"
1338+ "sourcedir_unset\t19\t\tSourceDir should not be set\n"
1339+ "sourcedir_set\t19\t\tSourceDir should be set\n" ;
1340+
13191341static const msi_table tables [] =
13201342{
13211343 ADD_TABLE (component ),
@@ -1984,6 +2006,19 @@ static const msi_table x64_tables[] =
19842006 ADD_TABLE (install_exec_seq ),
19852007};
19862008
2009+ static const msi_table sr_tables [] =
2010+ {
2011+ ADD_TABLE (media ),
2012+ ADD_TABLE (directory ),
2013+ ADD_TABLE (file ),
2014+ ADD_TABLE (component ),
2015+ ADD_TABLE (feature ),
2016+ ADD_TABLE (feature_comp ),
2017+ ADD_TABLE (property ),
2018+ ADD_TABLE (sr_install_exec_seq ),
2019+ ADD_TABLE (sr_custom_action ),
2020+ };
2021+
19872022/* cabinet definitions */
19882023
19892024/* make the max size large so there is only one cab file */
@@ -6109,6 +6144,32 @@ static void test_wow64(void)
61096144 DeleteFileA (msifile );
61106145}
61116146
6147+ /* Test what actions cause resolution of SourceDir when executed. */
6148+ static void test_source_resolution (void )
6149+ {
6150+ UINT r ;
6151+
6152+ if (is_process_limited ())
6153+ {
6154+ skip ( "process is limited\n" );
6155+ return ;
6156+ }
6157+
6158+ create_test_files ();
6159+ create_database (msifile , sr_tables , sizeof (sr_tables ) / sizeof (msi_table ));
6160+
6161+ MsiSetInternalUI (INSTALLUILEVEL_NONE , NULL );
6162+
6163+ r = MsiInstallProductA (msifile , "RESOLVE_SOURCE=1" );
6164+ ok (r == ERROR_SUCCESS , "got %u\n" , r );
6165+
6166+ r = MsiInstallProductA (msifile , "PROCESS_COMPONENTS=1" );
6167+ ok (r == ERROR_SUCCESS , "got %u\n" , r );
6168+
6169+ delete_test_files ();
6170+ DeleteFileA (msifile );
6171+ }
6172+
61126173START_TEST (install )
61136174{
61146175 DWORD len ;
@@ -6200,6 +6261,7 @@ START_TEST(install)
62006261 test_feature_tree ();
62016262 test_deferred_action ();
62026263 test_wow64 ();
6264+ test_source_resolution ();
62036265
62046266 DeleteFileA (customdll );
62056267
0 commit comments