File Redirection Fixup

MSIX applications work with the virtualized file system (VFS) that provides access to files deployed by the package and to the system files. Access to the system resources is virtualized and redirected to specific locations, so that the application considers that it works with a system resource using a well-known path, while the call is redirected to the corresponding directory in the MSIX package deployment location. MSIX redirects only a predefined list of well-known directories, such as a Windows folder, Program Files folder, etc. If an MSIX application uses a file or folder that isn’t redirected, an error is reported when you run the application. To resolve the error you need to create a file redirection fixup that helps MSIX to redirect a referred file. In this case the fixup provides configuration that describes how to redirect file system calls.

To create a fixup choose New File Redirection Fixup… in the context menu of Application Fixups. In the appeared dialog you can set the fixup settings. Set a name of the fixup in the Name filed and enter Description if required Pic 1. MSIX can contain multiple applications, so you can choose if the created fixup should be applied to All Applications, or apply it to specific applications only. Specify an application mask if you want to restrict applications to apply the fixup to. The mask is a regular expression (in the regexp format) to match the application names.

Configuring a file redirection fixup

Pic 1. Configuring a file redirection fixup

In Fixup Redirections you can specify one or multiple fixups. Click the toolbar buttons or context menu to add or delete fixups. When you create a new fixup, you can select the redirection type on the appeared dialog Pic 2.

Select a fixup redirection type

Pic 2. Select a fixup redirection type

You can redirect resources, located in the package deployment folder, the package deployment drive and in a system folder. Configuration of all of those redirections is described below.

All redirection types have the common configuration settings, including Pattern and a couple of options. You can configure one or multiple patterns for each redirection. Patterns are regular expressions (specified in the regexp format) that are matched with the actual file or folder names of the resources to decide if the redirection should be applied for the resource.

How redirection works? When MSIX application makes a Windows API call to work with a file system resource, its path is matched with the base path (specified as Redirect From) together with Patterns. If the path is matched to the regular expressions, the API call is redirected to the path specified as Redirect To.

The Read-only option specifies whether the redirected file system resources can be modified. If it is set to true, any changes are forbidden.

The Do not allow redirection of this pattern match option allows you to forbid redirection with the matched pattern. This option can be used to prevent redirections.

Package Relative Redirection

This option allows redirecting files and folders, located in the package installation root, to the specified location. Specify a path in the package installation root folder set in the Redirect From field, to be matched together with the specified Patterns to make a redirection Pic 3.

Package relative redirection configuration

Pic 3. Package relative redirection configuration

If the pattern matches, the call is redirected to the path specified in the Redirect To field. By default it is redirected to LocalAppDataFolder, but you can select any custom path.

Package Drive Relative

You can use this option to redirect files and folders, located on the same drive as the deployed application. The Redirect From field allows you to specify a path on the drive to be matched together with Patterns with the actual paths to redirect MSIX file system calls Pic 4.

Package drive relative redirection configuration

Pic 4. Package drive relative redirection configuration

If the pattern matches, the call is redirected. The redirection path is specified in the Redirect To field. You can specify a custom path, or the call will be redirected to LocalAppDataFolder if the field is set to empty.

System Folder

Use this option to redirect calls for system folders that aren’t redirected automatically. Specify the folder ID or name and specify a subfolder, if required, in the Redirect From field Pic 5. To redirect a system folder you can specify its GUID as an ID field. You can find a list of GUIDs for system folders in this atricle.

System folder redirection configuration

Pic 5. System folder redirection configuration

If the actual path matches the Redirect From together with Patterns, the corresponding MSIX file system call will be redirected to the folder specified in the Redirect To field.