microsoft / MSIX-PackageSupportFramework

The Package Support Framework (PSF) is a kit for applying compatibility fixes to packaged desktop applications.
MIT License
114 stars 57 forks source link

Support for SetWorkingDirectory needed #159

Closed TimMangan closed 3 years ago

TimMangan commented 4 years ago

Application (Calibre) runtime calls set working directory to set it to a subfolder of it's installation folder. The app is believed to do this to aid in dll loading. As the app requests the native path (C:\Program Files\Vendor\subfolder) that it stored into the registry upon install, this folder does not exist, SetWorkingDirectory fails and the app fails.

In this situation, the FRF should have additional intercepts that cause this app call to be redirected to the equivalent VFS folder under the package root. I believe this code should first see if the requested folder exists and do what it asked, and then only look for the package VFS equivalent if that fails. This would better handle other potential situations such as the app requesting the System32 folder as attempts to use this CWD in other file operations will find both the native and package VFS files later on.

In addition to adding support to the FRF, support should also be added to TraceFixup.

TimMangan commented 3 years ago

Resolved in PR #170 to Develop branch.