File redirection is including Desktop, Documents etc and this is not wanted

Copper Contributor

Hi,

 

I'm trying to package SAP and things have been going fairly well, but I've an issues that I'm working through and I think it might be relating to redirection. Any help to resolve the issue would be great. Basically, all writes by the app into c:\users\<username>\* are being redirected into the VFS. 

My application performs as desired, but when a user tries, for example to save a file (eg PDF) or Print or Export (eg CSV or Excel file), things go wrong. It appears that the package virtualised the whole C drive.

For example, our expected behaviour is that when a user goes to save a file, they can save to their own documents folder, and it appears as if they do so, but it appears that the write is being virtualised. When I look in ProcMon, I can see lines showing documents has been virtualised.

I thought that might just be read operations, but saving a file to the documents folder got redirected. Basically, it looks like many accesses are. In this example, SAP thinks it saved the file to the local docs folder, then tries to open it and fails:

DavidOverton_2-1644930198588.png

My json.config file fixups looks like this :

 

 

"processes": [
    {
      "executable": "^PsfLauncher.*"
    },
    {
      "executable": ".*",
      "fixups": [
        {
          "dll": "FileRedirectionFixup.dll",
          "config": {
            "redirectedPaths": {
              "packageRelative": [
                {
                  "base": "",
                  "patterns": [
                    ".*\\.[eE][xX][eE]$",
                    ".*\\.[dD][lL][lL]$",
                    ".*\\.[tT][lL][bB]$",
                    ".*\\.[oO][cC][xX]$",
                    ".*\\.[cC][oO][mM]$",
                    ".*\\.[fF][oO][nN]$",
                    ".*\\.[tT][tT][cC]$",
                    ".*\\.[tT][tT][fF]$",
                    ".*\\.[zZ][iI][pP].*"
                  ],
                  "isExclusion": true
                },
                {
                  "base": "",
                  "patterns": [
                    ".*"
                  ]
                }
              ],
              "packageDriveRelative": [],
              "knownFolders": [
                {
                  "id": "LocalAppData",
                  "relativePaths": [
                    {
                      "base": "",
                      "patterns": [
                        ".*"
                      ]
                    }
                  ]
                },
                {
                  "id": "RoamingAppData",
                  "relativePaths": [
                    {
                      "base": "",
                      "patterns": [
                        ".*"
                      ]
                    }
                  ]
                },
                {
                  "id": "ProgramFilesX86",
                  "relativePaths": [
                    {
                      "base": "",
                      "patterns": [
                        ".*"
                      ]
                    }
                  ]
                },
                {
                  "id": "ProgramFilesCommonX86",
                  "relativePaths": [
                    {
                      "base": "",
                      "patterns": [
                        ".*"
                      ]
                    }
                  ]
                },
                {
                  "id": "SystemX86",
                  "relativePaths": [
                    {
                      "base": "",
                      "patterns": [
                        ".*"
                      ]
                    }
                  ]
                },
                {
                  "id": "Windows",
                  "relativePaths": [
                    {
                      "base": "",
                      "patterns": [
                        ".*"
                      ]
                    }
                  ]
                },
                {
                  "id": "ProgramData",
                  "relativePaths": [
                    {
                      "base": "",
                      "patterns": [
                        ".*"
                      ]
                    }
                  ]
                },
                {
                  "id": "{FD228CB7-AE11-4AE3-864C-16F3910AB8FE}",
                  "relativePaths": [
                    {
                      "base": "",
                      "patterns": [
                        ".*"
                      ]
                    }
                  ]
                }
              ]
            }
          }
        },
  

 

 

My VFS tree does not include the users folder:

DavidOverton_3-1644930507253.png

 

Would I need an exception for PDFs, CSVs, XLS? etc or have I done something wrong that all access seems to be redirected?

 

Thanks


David

5 Replies
David,

The procmon trace indicates the issue to me. Sometimes, depending on how the app makes the request, the FRF will decide that it should use a path in the form %MSIXPackageRoot%\VFS\C$\... instead of a more logical VFS path.

There probably isn't much you can do with the PSF version that you are using. This **may** have been addressed in the recent PSF updates, however I have not yet released an updated version of PsfTooling with that version (which I assume that you were using).

The updated PsfTooling should be out soon (it will be version 5.0 when released). If it does not solve the problem, please let me know.
Thanks Timothy. I did use PsfTooling as well as your MSIEditX tools.

Is there no exception I can put in, perhaps for a "C$\\users\\documents\\.*" pattern?

I'm supposed to go live on Friday, so a little desperate! Happy to do a private test.

thanks

David
Contact my email. I may have a pre-release.

@David Overton A late Follow-up on this thread: The new MfrFixup is designed as a replacement to the FileRedirectionFixup and would, by default, support redirection to the local documents folder, even when there are documents in the VFS.