-
Notifications
You must be signed in to change notification settings - Fork 3
Home
Welcome to the TimMangan/MSIX-PackageSupportFramework wiki! This wiki provides documentation on this fork's version of the PSF.
The Package Support Framework (or PSF for short) is a collection of software used when (re)packaging software originally developed as Win32 or Dot Net Framework based applications into MSIX when that software requires remediation to be able to work correctly from inside the MSIX container without modification to the source code of the original application.
This fork of the PSF comes from the original Microsoft open-source project of the same name, which (unfortunately) is not being well maintained any more. This fork appears to be the active fork used in a variety of my own tools but is ingested in some way in other third-party tools used for (re)packaging.
The PSF consists of a Launcher application, and a number of Fixup dlls that each offer different kinds of remediation support.
To use the PSF in an MSIX package, the PsfLauncher must be made as the entry point into the container for the end user. This exe will end up being the target of shortcuts, file type associations, and other entry-points to the application.
PsfLauncher supports the following remediations:
- Adds support for parameters that might be used in an original shortcut (lnk) that are not directly available in MSIX:
-
- Command line arguments to the target application.
-
- Specifying the Working Directory for the target process (which is changed to the System32 folder under MSIX by default)
- Allows for start/end of application scripts, which may be used for client-side configuration of the application. MSIX does not support any kind of client-side scripting to be performed at installation time.
- Allows for the specification of a monitor program to be run prior to the application. This is used in debugging in conjunction with the PsfTrace fixup.
The PsfLauncher can also inject any of the following Fixups dlls into the target application. This injection occurs prior to the application being allowed to run and offers a variety of intercepts into well-known Windows API calls to affect the behavior of the app when running in the container.
PsfTraceFixup provides for logging of the well-known API calls that the application makes. The specific calls that are intercepted for this logging line up with the calls intercepted by other fixup types. This fixup is used without other fixups to help detect what fixups are required. When used in EventLog mode, the fixup output may be viewed in a convenient monitor also started by PsfLauncher (PsfMonitor).
This fixup supports the redirection of file requests by the application to ensure correct functinality. This fixup is used for one of the following situations:
- The package contains VFS files that would normally have been placed under either the user's AppData\Local or AppData\Roaming folders. Without FileRedirectionFixup support the application would not see these files layered into the virtual file system like other VFS paths.
- The package contains files that the end-user can modify. These are often configuration files that have default files that are part of the package. Package files are generally immutable without the FRF.
The fixup had considerable configuration to adjust what may be intercepted or not.
This fixup supports older applications that request registry permissions or actions that are not compatible with the MSIX container. Currently the fixup only addresses issues with HKCU requests.
The fixup is configured using rules. There are currently two types of rules supported:
- ModifyKeyAccess - adjusts the permissions being requested when the application open a registry key. Some older applications request full access to the key, which would grant them permissions that the MSIX runtime won't allow but would have been OK in a native application running outside of the MSIX container. In so many cases, we see that the app did not need those extra permissions, so this rule adjusts the permissions requested to the MSIX registry to the subset supported.
- FakeDelete - Deletion of a key/item that is part of the package is not allowed by the MSIX runtime. This rule simply returns a success result to the application without asking for the delete. Some apps use the registry as a scratchpad area and make these calls as part of cleanup when shutting down. Adding this rule may prevent an application crash at shutdown.
This fixup ensures that the application will find a dll if it is located anywhere in the package. There are several causes of dlls not being found when migrating to MSIX, and this ensures they are fixed.
This fixup makes Environment Variables that are part of the package available under MSIX. The application may also update one of these variables at runtime (or this may be prevented by configuration of the fixup)
Typically, this fixup is only used by a developer wanting to attach a source code debugger to the target application.