Using variables in Folder Redirection


I want to redirect a text file from AppDir to the users Appdata folder.


In advanced installer I have setup:

Folder: APPDIR

File Name Pattern: .\.*txt

Destination: c:\users\<myusername>\Appdata\Roaming\<vendor>


Then the MSIX works fine for me but not for 15.000 other users. So I would like to use a variable in Destination.  So far I have tried and failed:







Can anyone tell me what the convention is to get a variable in the Destination path name?

1 Reply
best response confirmed by siebrasse (Visitor)
When running inside of the container any code, including PSF based code, that attempts to write to the user's Appdata (by which I assume you mean C:\Users\Username\AppData\Roaming) folder will end up redirected by the lower level code back to the package area for the folder under LocalAppData. And there is nothing the PSF can do about it.

But presumably the user's system has something redirecting the roaming data and you can target that location directly instead.

Maybe it is a home drive, maybe it is mounted drive, those are easy and presumably advanced installer has an option that would do.

If it is a profile redirection system implemented as a filter driver (UEV, AppSense, FsLogix, but not Roaming Profiles or Folder Redirection ) you can ask ai to redirect to LocalAppData and train the configuration rules of the filter driver to pick it up from the package LocalAppData after.