Tech Community Live: Windows edition
Jun 05 2024, 07:30 AM - 11:30 AM (PDT)
Microsoft Tech Community

MSIX Fix-up Advice for Access Denied

Copper Contributor

Hi all.  I have an app that tries to write to a log file in a folder on the root of C:\, and is getting access denied errors in Process Monitor. 

 

The folder (C:\VIS), when captured, resolves to [{AppVPackageDrive}]\VIS in the package (note that it tries to write to C:\VIS though and not this folder in the VFS).  The log file also has an upper-case .LOG extension (I think the Regex patterns are a bit finicky with case).

 

I've tried a couple of FileRedirection fix-ups, but neither seems to make a difference - does anything look wrong here?  Thanks!

"redirectedPaths":  {
	"knownFolders":  [
		{
			"id":  "AppVPackageDrive",
            "relativePaths":  [
            {
				"base":  "VIS",
                "patterns":  ".+\\.LOG"
            }
            ]
        }
    ],
    "packageDriveRelative":  [
		{
			"base":  "VIS",
			"patterns":  [
				".+\\.LOG"
			]
		}
    ]
}

 

2 Replies

@CPUser  Your json looks OK to me.  Where did you get the PSF (I'd ask what version it is but PSF doesn't really have versions).  I think there were some issues with folders at the root of C: in the past.

 

If the log file could be moved to Program Files or Appdata roaming or local, you'd probably be good on any PSF.

 

Otherwise, replacing the PSF with the latest TimMangan branch and swapping in the MfrFixup instead of FileRedirectionFixup should work.

The root of the C Drive is a protected location, and elevated permissions are required to create files and folders there. I'm certain the Microsoft would not recommend writing to this location.

Have you considered moving the output location for you log file to say %programdata% which is an All User writable location?

What happens if you run your application as an Administrator? If it does work as an Administrator then permissions is your issue, and you might want to consider a different location for your log file.