Forum Discussion
PSF File Redirection Fixup Confusion
1) If your package does not contain any documents, the end user would not need the Psf/FRF to be able to write there. Only files contained in the folder paths of your package need help to allow write access.
2) A quick review of the Psf/FileRedirection code shows that the Id field of the Json should not be the KnownFolderID Guid, but a name that is the VFS folder equivalent of the file system. The readme.md for the FileRedirection lists the id values supported MSIX-PackageSupportFramework/fixups/FileRedirectionFixup at master · microsoft/MSIX-PackageSupportFramework (github.com) and the code supports this list. The Documents folder is not part of it.
3) If there is a need to include files in the Documents folder in your package, I would recommend placing them elsewhere in the package and use a RunOnce package script from PsfLauncher that copies those files into the user's Documents folder the on the first run of the app. You probably want all document files available to other apps and if the FRF controlled them they would be trapped in this app's container redirection area. If you feel otherwise, please post some details so that we can better understand the scenario.
Hi.
I don't mind the folder being controlled by the FRF, but my main problem is that no matter what I try the FRF never seems to redirect the Folder being written to Documents in the first place.
I got this idea after reading the documentation for the File Redirection Fixup, where it states in the 'id' section under 'knownFolders':
"A string identifier indicating the input to SHGetKnownFolderPath. This can be one of the strings listed below or a string of the form "{GUID}" for some KNOWNFOLDERID value."
I have to ask again if the FRF even has the capability to do this. I'm still a bit worried that I'm just running a fools errand here. Although thank you for bringing up package scripts, for some reason it never crossed my mind to try and use one for this manner. I'll try working with those if my initial question turns out to be impossible.
Thanks.
- Feb 02, 2021
Currently, the FRF does not support this. Could it? Sure. I've added several other folders to that list in the past. We have not included it because it seemed bad for the customers. They might create a file in your app and then be unable to email to someone or use some other app with the file. Thus the documents folder (as well as other places like the desktop) are currently not covered by the FRF.
If you can explain the scenario of how it is needed, we (well, probably I) can consider adding in support into the FRF.
Regards,
Tim Mangan (not a Microsoft employee)
- Feb 03, 2021
Oh, another thought.
The FRF can handle redirection of a file in the documents folder by using relative path within the config.json instead of KnownFolderId.
Tim