@@ -736,30 +736,55 @@ static const char cf_custom_action_dat[] =
736736 "rf_immediate\t1\tcustom.dll\tcf_present\n"
737737 "rf_deferred\t1025\tcustom.dll\tcf_absent\n" ;
738738
739+ static const char sr_file_dat [] =
740+ "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
741+ "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
742+ "File\tFile\n"
743+ "selfreg.dll\tselfreg\tselfreg.dll\t1000\t\t\t8192\t1\n" ;
744+
745+ static const char sr_feature_dat [] =
746+ "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
747+ "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
748+ "Feature\tFeature\n"
749+ "selfreg\t\t\tselfreg feature\t1\t2\tMSITESTDIR\t0\n" ;
750+
751+ static const char sr_feature_comp_dat [] =
752+ "Feature_\tComponent_\n"
753+ "s38\ts72\n"
754+ "FeatureComponents\tFeature_\tComponent_\n"
755+ "selfreg\tselfreg\n" ;
756+
757+ static const char sr_component_dat [] =
758+ "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
759+ "s72\tS38\ts72\ti2\tS255\tS72\n"
760+ "Component\tComponent\n"
761+ "selfreg\t{BB4C26FD-89D8-4E49-AF1C-DB4DCB5BF1B0}\tMSITESTDIR\t0\t\tselfreg.dll\n" ;
762+
739763static const char sr_selfreg_dat [] =
740764 "File_\tCost\n"
741765 "s72\tI2\n"
742766 "SelfReg\tFile_\n"
743- "one.txt\t1 \n" ;
767+ "selfreg.dll\t \n" ;
744768
745769static const char sr_install_exec_seq_dat [] =
746770 "Action\tCondition\tSequence\n"
747771 "s72\tS255\tI2\n"
748772 "InstallExecuteSequence\tAction\n"
749- "CostFinalize\t\t1000\n"
750773 "CostInitialize\t\t800\n"
751774 "FileCost\t\t900\n"
752- "ResolveSource\t\t950\n"
753- "MoveFiles\t\t1700\n"
754- "SelfUnregModules\t\t3900\n"
775+ "CostFinalize\t\t1000\n"
776+ "InstallValidate\t\t1400\n"
777+ "InstallInitialize\t\t1500\n"
778+ "ProcessComponents\t\t1600\n"
779+ "SelfUnregModules\t\t3800\n"
780+ "RemoveFiles\t\t3900\n"
755781 "InstallFiles\t\t4000\n"
756- "DuplicateFiles\t\t4500\n"
757- "WriteEnvironmentStrings\t\t4550\n"
782+ "SelfRegModules\t\t4100\n"
758783 "CreateShortcuts\t\t4600\n"
759- "InstallFinalize \t\t6600 \n"
760- "InstallInitialize \t\t1500 \n"
761- "InstallValidate \t\t1400 \n"
762- "LaunchConditions \t\t100 \n" ;
784+ "RegisterProduct \t\t5100 \n"
785+ "PublishFeatures \t\t5200 \n"
786+ "PublishProduct \t\t5300 \n"
787+ "InstallFinalize \t\t6600 \n" ;
763788
764789static const char font_media_dat [] =
765790 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
@@ -2099,11 +2124,11 @@ static const msi_table sis_tables[] =
20992124
21002125static const msi_table sr_tables [] =
21012126{
2102- ADD_TABLE (component ),
2127+ ADD_TABLE (sr_component ),
21032128 ADD_TABLE (directory ),
2104- ADD_TABLE (feature ),
2105- ADD_TABLE (feature_comp ),
2106- ADD_TABLE (file ),
2129+ ADD_TABLE (sr_feature ),
2130+ ADD_TABLE (sr_feature_comp ),
2131+ ADD_TABLE (sr_file ),
21072132 ADD_TABLE (sr_selfreg ),
21082133 ADD_TABLE (sr_install_exec_seq ),
21092134 ADD_TABLE (media ),
@@ -5398,6 +5423,7 @@ static void test_install_services(void)
53985423
53995424static void test_self_registration (void )
54005425{
5426+ HKEY key ;
54015427 UINT r ;
54025428
54035429 if (is_process_limited ())
@@ -5407,6 +5433,7 @@ static void test_self_registration(void)
54075433 }
54085434
54095435 create_test_files ();
5436+ extract_resource ("selfreg.dll" , "TESTDLL" , "msitest\\selfreg.dll" );
54105437 create_database (msifile , sr_tables , sizeof (sr_tables ) / sizeof (msi_table ));
54115438
54125439 MsiSetInternalUI (INSTALLUILEVEL_NONE , NULL );
@@ -5419,21 +5446,21 @@ static void test_self_registration(void)
54195446 }
54205447 ok (r == ERROR_SUCCESS , "Expected ERROR_SUCCESS, got %u\n" , r );
54215448
5422- ok (delete_pf ("msitest\\cabout\\new\\five.txt" , TRUE), "File not installed\n" );
5423- ok (delete_pf ("msitest\\cabout\\new" , FALSE), "Directory not created\n" );
5424- ok (delete_pf ("msitest\\cabout\\four.txt" , TRUE), "File not installed\n" );
5425- ok (delete_pf ("msitest\\cabout" , FALSE), "Directory not created\n" );
5426- ok (delete_pf ("msitest\\changed\\three.txt" , TRUE), "File not installed\n" );
5427- ok (delete_pf ("msitest\\changed" , FALSE), "Directory not created\n" );
5428- ok (delete_pf ("msitest\\first\\two.txt" , TRUE), "File not installed\n" );
5429- ok (delete_pf ("msitest\\first" , FALSE), "Directory not created\n" );
5430- ok (delete_pf ("msitest\\filename" , TRUE), "File not installed\n" );
5431- ok (delete_pf ("msitest\\one.txt" , TRUE), "File not installed\n" );
5432- ok (delete_pf ("msitest\\service.exe" , TRUE), "File not installed\n" );
5433- ok (delete_pf ("msitest\\service2.exe" , TRUE), "File not installed\n" );
5434- ok (delete_pf ("msitest" , FALSE), "Directory not created\n" );
5449+ r = RegOpenKeyA (HKEY_CLASSES_ROOT , "selfreg_test" , & key );
5450+ ok (!r , "got %u\n" , r );
5451+ RegCloseKey (key );
5452+
5453+ r = MsiInstallProductA (msifile , "REMOVE=ALL" );
5454+ ok (!r , "got %u\n" , r );
5455+
5456+ r = RegOpenKeyA (HKEY_CLASSES_ROOT , "selfreg_test" , & key );
5457+ ok (r == ERROR_FILE_NOT_FOUND , "got %u\n" , r );
5458+
5459+ ok (!delete_pf ("msitest\\selfreg.dll" , TRUE), "file not removed\n" );
5460+ ok (!delete_pf ("msitest" , FALSE), "directory not removed\n" );
54355461
54365462error :
5463+ DeleteFileA ("msitest\\selfreg.dll" );
54375464 delete_test_files ();
54385465 DeleteFileA (msifile );
54395466}
0 commit comments