Automatic account creation is now enabled. Captcha authentication required for account creation and editing unless you are trusted here.

RemoveFolder Element

From WiX Wiki at MindCapers

Jump to: navigation, search

Contents

Description

Remove a file(s) if the parent component is selected for installation or removal. Multiple files can be removed by specifying a wildcard for the value of the Name attribute. By default, the source directory of the file is the directory of the parent component. This can be overridden by specifying the Directory attribute with a value corresponding to the Id of the source directory, or by specifying the Property attribute with a value corresponding to a property that will have a value that resolves to the full path to the source directory.

Windows Installer references

RemoveFile Table

Parents

Component

Inner Text

None

Children

None

Attributes

NameTypeDescriptionRequired
IdStringPrimary key used to identify this particular entry.Yes
DirectoryStringOverrides the directory of the parent component with a specific Directory. This Directory must exist in the installer database at creation time. This attribute cannot be specified in conjunction with the Property attribute.
LongNameWildCardLongFileNameTypeThis attribute has been deprecated; please use the Name attribute instead.
NameWildCardLongFileNameTypeThis value should be set to the localizable name of the file(s) to be removed. All of the files that match the wild card will be removed from the specified directory. The value is a filename that may also contain the wild card characters "?" for any single character or "*" for zero or more occurrences of any character. In prior versions of the WiX toolset, this attribute specified the short file name. This attribute's value may now be either a short or long file name. If a short file name is specified, the ShortName attribute may not be specified. If a long file name is specified, the LongName attribute may not be specified. Also, if this value is a long file name, the ShortName attribute may be omitted to allow WiX to attempt to generate a unique short file name. However, if you wish to manually specify the short file name, then the ShortName attribute may be specified. Yes
OnEnumerationThis value determines the time at which the file(s) may be removed. This attribute's value should be one of the following:
install
Removes the file only when the parent component is being installed (msiInstallStateLocal or msiInstallStateSource).
uninstall
Removes the file only when the parent component is being removed (msiInstallStateAbsent).
both
Removes the file when the parent component is being installed or removed.||Yes
PropertyStringOverrides the directory of the parent component with the value of the specified property. The property should have a value that resolves to the full path of the source directory. The property does not have to exist in the installer database at creation time; it could be created at installation time by a custom action, on the command line, etc. This attribute cannot be specified in conjunction with the Directory attribute.
ShortNameWildCardShortFileNameTypeThe short file name of the file in 8.3 format. This attribute should only be set if you want to manually specify the short file name.

Notes

Windows Installer only removes files that were installed and were not marked Permanent. It only deletes folders that are empty. If your application creates files in those folders and you want to ensure that they are deleted when you uninstall the application, use appropriate RemoveFile elements to describe the files to be removed.

See Also

WiX Schema, CopyFile Element

Content derived from WiX Manual, licensed under the Open Source Initiative OSI - Common Public License Version 1.0. Additional information is licensed under the GNU Free Doc License. Version 3.0.3015.0

Personal tools