PsfTooling 3.1.0

Recently, I outlined changes I made to the MSIX Package Support Framework (PSF) in this post. In that post I indicated that there was to be a follow-up submission into the PSF and then I would be releasing a new version of the free PsfTooling tool that includes the updated PSF. That work is now complete.

PsfTooling 3.1.0 is now available in the Microsoft Store, which is where you also get the Microsoft MSIX Packaging Tool (MMPT) that you’ll probably use it with. If you are using the MSIX Packaging tool to repackage apps into MSIX, then you’ll likely need to include the PSF and that is what PsfTooling is so good at.

Version 3.1.0 has a revamped user interface from version 2. If you think of the older version as being a Json editor with a wizard bolted on to help with the PSF components, version 3 is a wizard to help with injecting and configuring the PSF components that also has a JSON editor included. Here’s what else is new.

Previously, to include the PSF in an MSIX package, you had to specify the installation folder in the MMPT and then PsfTooling had to be told where that was. PsfTooling would guess at the folder, but it was up to you to ensure we got it right. That was because we had to put the config.json file and dependent dlls in the root folder of the package. Thanks to my latest changes, this is no longer the case.

So when repackaging you can choose to specify the folder in the MMPT, or not.

Let’s look at an example of this packaging up Notepad++. Using the MMPT, we see this screen.

In the past we would have created and specified the “C:\Program Files\Notepad++” folder on this dialog before installing Notepad++ during the installation phase. (Those of you familiar with App-V might recognize this as a PVAD-style installation, although MSIX has no name for this yet). If you want to use this style of packaging, you still can. But you can now also just leave it blank, even if you plan to inject the PSF into the package.

After entering installation phase of the MMPT, you install and configure the app as you normally would. But after installing and configuration of the app is complete, you then run PsfTooling. Notepad++ needs the PSF in order to have visibility to the application configuration files and any dll plugins that you include in the package. You’ll certainly need that configuration file, which is located in the VFS Appdata/Roaming folder if you want to disable self update feature of the application.

From the menu of PsfTooling, select Wizards–>Shortcut to start the shortcut wizard. The purpose of the shortcut wizard is to modify an application shortcut, pointing it to the PsfLauncher process and configuring the PSF to do the right things for you. After starting the wizard, you first configure what you want the wizard to do, and then select the shortcut(s) to be fixed.

In our example, we want the launcher to start Notepad++, fix the CWD problem so dlls are found, and add the FileRedirectionFixup shim configured to perform copy-on-access to files in the package AppData/Roaming folder. So after starting the wizard, you select the checbox for the FileRedirectionFixup, and then the Appdata/roaming checbox. The other checkboxes shown are already enabled by default.

By default, MSIX redirects changes to a special location in the User’s Appdata/Local folder for this package. If you want the PSF to redirect to a more persistent location, such as a home drive or network share, you would enter that location in the redirect target base field (this is the other change I made to the PSF to support non-persistent and semi-persistent deployment scenarios, plus desktop replacement strategies). When you have the configuration you want, you then click the Modify Shortcut(s) button and select the shortcut for Notepad++. The wizard will then show you the potential modified shortcut.

You can see in the proposed changes that the target of the lnk shortcut file will change to point to PsfLauncher. Clic the Apply to Proposed Change List button to add these changes into the proposed list.

At this time, no system modifications have been made. If needed, you could run more wizards or manually edit the JSON file used to configure the PSF.

You probably won’t have to manually edit the config.json file, but it might be helpful to understand what the tool puts in the file. Here is a portion of that file for our package:

Close the view. Then click the Execute these changes button to have the tool make the changes shown to your system.

In this display, you can see the changes that were made:

  • The config.json file is copied to the folder of the original target exe.
  • The appropriate PsfRuntime and FileRedirectionFixup dlls are also copied there.
  • A copy of the appropriate bitness PsfLauncher is placed in the folder of the original target exe.
  • The icon used by the original shortcut is extracted and injected into the PsfLauncher exectable file. This is a new feature that solves the blank icons we used to get if you included the PSF.
  • The shortcut lnk file is updated.

After making these changes to your system, close PsfTooling, and return to the MMPT to end installation monitoring and finish saving the package. You should have a very good package that works well in the enterprise environment.

By Tim Mangan

Tim is a Microsoft MVP, and a Citrix CTP Fellow. He is an expert in App-V and MSIX.