ICEM09

Windows Installer

ICEM09

ICEM09 verifies the merge module safely handles predefined directories. It does this by verifying that no component in the module installs a directory to a predefined system directory such as "ProgramFilesFolder" or "StartMenuFolder". Instead, modules should use directories with unique names (created with the merge module naming convention) and use custom actions to target the appropriate target directory. This approach prevents modules from conflicting with an existing directory structure in the final database. ICEM09 checks that the custom actions needed for this technique to work either do not exist (so that the merge tool can generate them) or exist in the correct form (so that they work as expected).

Failure to fix a warning or error reported by ICEM09 could cause problems for the clients of your merge module. Directory table rows with primary keys such as ProgramFilesFolder often exist in a database; therefore, if components in your module install directly to predefined directories such as ProgramFilesFolder, the directory entries in the module may collide with already existing rows. This condition would require the user of your module to split the source files from your module in order to match the existing source directory.

Result

ICEM09 reports an error or warning when a module component installs a directory to a pre-defined system directory, causing a possible name conflict with the existing directory structure.

Example

ICEM09 posts the following warnings for a module containing the database entries shown.

Warning: The component 'Component1.<GUID>' installs directly into the pre-defined 
directory 'ProgramFilesFolder'. It is recommended that merge modules alias 
all such directories to unique names.

Rename the merge module directory so it does not match a Windows Installer property and therefore is unique. Then set a property of the same name to the value of the Windows Installer directory. When directory resolution takes place, the directory has a property of the same name, so the install location of the directory is the value of the property. Files move from the distinct source location to the same target location. This process should completely remove the merge conflicts.

Warning: The 'ModuleInstallExecuteSequence' table contains a type 51 action 
(StartMenuFolder.<GUID>) for a pre-defined directory, but this action 
does not have sequence number '1'

If the action does not have sequence number 1, it may not merge in to the target database early enough in the sequence to work effectively.

To fix this warning, set the sequence number to 1. Note that most current merge tools (but not some older versions) will generate these custom actions at merge time, so it is not always necessary to explicitly author the actions into the merge module.

Warning: The 'CustomAction' table contains a type 51 action (MyAppDataFolderAction) 
for a pre-defined directory, but the name is not the same as the target directory. 
Many merge tools will generate duplicate actions."

Because the CustomAction column is the primary key of CustomAction table, some merge tools may generate duplicate actions because the pre-authored action name is different.

To fix this warning, name the action the same as the target directory. Note that most current merge tools (but not some older versions) generate these custom actions at merge time, so it is not always necessary to explicitly author the actions into the merge module.

Directory Table

Directory Directory_Parent DefaultDir
ProgramFilesFolder Directory1 A
StartMenuFolder Directory2 B:C
AppDataFolder Directory3 D
MyPicturesFolder Directory4 E

 

Component Table

Component Directory
Component1.<GUID> ProgramFilesFolder
Component2.<GUID> StartMenuFolder
Component3.<GUID> AppDataFolder
Component4.<GUID> MyPicturesFolder

 


CustomAction Table

CustomAction Type Source Target
StartMenuFolder.<GUID> 51 StartMenuFolder.<GUID> [StartMenuFolder]
MyAppDataFolderAction 51 AppDataFolder.<GUID> [AppDataFolder]

 


ModuleInstallExecuteSequence Table

Action Sequence BaseAction After Condition
StartMenuFolder.<GUID> 100

 


See Also

Merge Module ICE Reference

Send comments about this topic to Microsoft

Build date: 8/13/2009

© 2009 Microsoft Corporation. All rights reserved.