Filtering Files in Dependency Scanners

InstallShield 2018

When you run the Static and Dynamic scanning wizards, you may find that they list as dependencies certain files that you do not want added to your installation. To avoid having these files added every time you run the scanner, you can edit Filters.xml. This file enables you to specify any files that you want the scanners to ignore or include.

Filters.xml is in the following location:

InstallShield Program Files Folder\Support

The file must remain in this location after you edit it; otherwise, the scanners will not work properly.

Tip • You can also use the Filters.xml file to control which registry items should be excluded during COM extraction. For more information, see Filtering Registry Changes for COM Extraction.

The Filters.xml file also lets you control which IIS settings should be excluded when you are importing an IIS Web site. For more information, see Filtering IIS Data When Importing a Web Site and Its Settings into an InstallShield Project.

Excluding Files

The <Exclude> element in the Filters.xml file is where you add subelements for each of the files that you want the scanners to exclude. Any files that are listed here will not be added to your installation project by the scanners.

By default, the <Exclude> element has subelements for common system files that are present on all Windows–based machines.

Including Files

The <Include> element in the Filters.xml file gives you the ability to override individual files that are subelements of the <Exclude> element. Any files that are listed in subelements of the <Include> element will be added to your installation project by the scanners, even if the files are also listed in subelements of the <Exclude> element.

Note • The following vital operating system files are never recognized by the scanner, even if you add them as subelements of the <Include> element:

kernel32.dll
ntdll.dll
user32.dll
gdi32.dll
advapi32.dll
shell32.dll
ole32.dll

Specifying Files in the <Exclude> and <Include> Elements

If you want to list a file under the <Exclude> or <Include> elements, you must add the file as a subelement. Following is a sample of a properly formatted subelement:

  <File name="myfile.dll" path="[SystemFolder]" We="needthis"/>

Recognized Attributes for the <File> Subelement

Attribute

Description

name

This attribute must be lowercase. The value of this attribute (for example, myfile.dll in the above example) indicates the name of the file that you want to include or exclude.

path

This attribute is optional. The value of this attribute (for example, [SystemFolder] in the above example) indicates the path of the file.

Any other attributes are optional and are not recognized by the scanners. You may want to add additional attributes—such as the We attribute in the example above and the corresponding "needthis" value—to identify why an item is being excluded or included.

Important • Ensure that your XML code is well formed; if its not well formed, all of the filters fail. In most cases, you can identify improperly formed XML code by opening the Filters.xml file in Internet Explorer. You should be able to expand and contract the <Filters>, <Include>, and <Exclude> elements; if you cannot, check the code for errors.

If you add subelements to the <Exclude> or <Include> elements, be sure that you do not place them within the commented-out section, since InstallShield ignores that area of the Filters.xml file.

The following sample XML code shows the format of the Filters.xml file:

<Filters>

 <Include>

  <!--Instructions on how to add files to this element.

  -->

  <File name="mfc42.dll" We="needthis"/>

 </Include>

 <Exclude>

  <!--Instructions on how to add files to this element.

  -->

  <Registry key="HKEY_CLASSES_ROOT\Interface\{00020404-0000-0000-C000-000000000046}"/>

  <File name="12520437.cpx" path="[SystemFolder]" wrp="4.0-10.0" />

  <File name="12520850.cpx" path="[SystemFolder]" wrp="4.0-10.0" />

 </Exclude>

</Filters>

See Also