MoveFiles Action

[This is preliminary documentation and subject to change.]

The MoveFiles action allows the author to locate files that already exist on the user's computer and move or copy those files to a new location. The MoveFiles action moves an entry in the MoveFile table only if the component linked to that entry is being installed locally or is being run from source.

Database Tables Queried

MoveFile Table

Component Table

MoveFile.FileKey Primary key, uniquely identifying an entry in the MoveFile table.
MoveFile.Component_ Foreign key into the Component table.
MoveFile.SourceName Name of the source file to be moved or copied.
MoveFile.DestName Name to be given to the destination file.
MoveFile.SourceFolder Property name whose value identifies the source folder.
MoveFile.DestFolder Property name whose value identifies the destination folder.
MoveFile.Options Option flags used to define the behavior of the move/copy operation.

Properties Used

None

Sequencing Restrictions

The LaunchConditions action must occur after the InstallValidate action and before the InstallFiles action.

Remarks

The Options field allows you to specify whether the source file(s) should be moved or copied (that is, whether the source file is to be deleted after it has been copied to a new location). For the exact syntax, see the MoveFile table.

The strings in the SourceFolder and DestFolder fields are property names whose values are expected to resolve to fully qualified paths. These properties could be any of the directory entries in the Directory table, any predefined folder property (FavoritesFolder, for example), or a property set by any entry in the AppSearch table.

Some properties can contain a full path to a specific file (that is, a full path with the file name appended). For example, AppSearch can be authored to search for a particular file and to set a property to the full path to that file. In a case such as this, the SourceName field in the MoveFile table can be left blank indicating that the value in the SourceFolder property contains a full file path. Since the list delimiter for transforms, sources and patches is a semicolon, this character should not be used in these filenames or paths.

For a particular entry in the MoveFile table, if either the SourceFolder or DestFolder property does not evaluate to a valid path, MoveFiles does nothing for that entry.

The MoveFiles action attempts to move or copy all files in the source directory that match the name given in the SourceName column. This name can include wildcards (* and ?), which allow a group of files to be moved or copied. For example, you could specify *.xls for the SourceName, and MoveFiles moves or copies every Microsoft® Excel workbook from the source directory to the destination.

When copying or moving files, the name to be given to the destination file can be specified in the DestName field. If this field is left blank, the destination file name is the same as the source file name.

The DestName field should normally be left blank if a wildcard is specified in the SourceName field. If you do specify a DestName when using wildcards, the first source file that matches the wildcard criteria is given the specified destination name. (All other moved/copied files have the same name as the source file.)

Files that are moved or copied by MoveFiles are not deleted when the product is uninstalled.