MSIX VFS AppData - Notepad++ disable autoupdate issues

Written by Horatiu Vladasel · December 28th, 2023

When deploying with MSIX, the files and folders within the user's AppData directory (located under C:\Users\<user_name>\AppData) are written to a per-user, per-app location.

This method ensures a clear state separation, which is particularly useful for MSIX-exclusive artifacts. Such an approach enables the system to efficiently clean up these resources during application uninstallation, contributing to a cleaner system.

When an MSIX-packaged application runs, it seamlessly combines its stored files with the actual AppData folder. However, when trying to access these files, the system redirects it to a separate storage area for the application. But sometimes, this doesn't work as expected.

In this article, we delve into a specific challenge encountered in this context - the issue of disabling auto-updates in Notepad++ within an MSIX container, and we explore effective solutions to this problem.

MSIX: Notepad++ Auto-Update Issue

Notepad++ usually controls its auto-update setting through a config.xml file in the VFS\AppData\Notepad++ folder.

Notepad++ config.xml file

Even if you set it to disable auto-updates, this setting might not work in an MSIX container, especially when using the MSIX Packaging Tool.

Enable/disable Notepad++ auto-updates

When using a tool like Process Monitor, we see that:

  • Notepad++ can't find the config.xml file in an MSIX container.
  • As a result, it creates a new file with default values, which includes enabling auto-updates.
Process Monitor tool

PSF (Package Support Framework) as a Solution

To fix this, we need to use the Package Support Framework (PSF). It involves adding a piece called FileRedirectionFixup to the package.

This makes sure that Notepad++ can see and use its config file properly.

The config.json should look like the following:

{
  "enableReportError": true,
  "applications": [
    {
      "id": "PSFLAUNCHEROne",
      "executable": "VFS\\ProgramFilesX64\\Notepad++\\notepad++.exe",
      "arguments": "",
      "workingDirectory": ""
    }
  ],
  "processes": [
    {
      "executable": "^PsfLauncher.*"
    },
    {
      "executable": "^[Pp]ower[Ss]hell.*"
    },
    {
      "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": "VFS\\FONTS",
                  "patterns": [
                    ".*"
                  ],
                  "isExclusion": true
                },
                {
                  "base": "",
                  "patterns": [
                    ".*"
                  ]
                }
              ],
              "packageDriveRelative": [],
              "knownFolders": [
                {
                  "id": "RoamingAppData",
                  "relativePaths": [
                    {
                      "base": "",
                      "patterns": [
                        ".*"
                      ]
                    }
                  ]
                },
                {
                  "id": "ProgramFilesX64",
                  "relativePaths": [
                    {
                      "base": "",
                      "patterns": [
                        ".*"
                      ]
                    }
                  ]
                }
              ]
            }
          }
        }
      ]
    }
  ]
}

Now, If we install the MSIX package and run Process Monitor, we can see that the file operations for config.xml are now redirected to LocalCache\Local\Microsoft\WritablePackageRoot folder.

Notepad++ config file running in Process Monitor

Streamlining with Advanced Installer

Having a tool like Advanced Installer you don’t need to worry too much – it is all catered for you in the background.

Even if you use the package created with MSIX Packaging Tool, it is enough to open that in Advanced Installer and save it.

How does it work?

  • If we install the MSIX file created with Advanced Installer and run the application, we can see that the auto-update is disabled.
  • Advanced Installer automatically evaluates the resources from each MSIX package and injects file or folder redirections for the resources included in the package.
  • This increases the percentage of successful conversions to MSIX considerably.
Disable Notepad++ auto-updates successful in MSIX

New to Advanced Installer? Master conversions to MSIX with our 30-day full-featured free trial.

Conclusion

In summary, managing Notepad++ auto-update settings within an MSIX packaged environment can present unique challenges, primarily due to the way MSIX handles user data and application files. However, with the right tools and understanding, these challenges can be effectively overcome.

With Package Support Framework (PSF), specifically the FileRedirectionFixup, we can ensure that Notepad++ accesses its configuration files correctly, maintaining the desired settings.

Furthermore, tools like Advanced Installer streamline the process, making it more accessible and less technical for users.

Overall, while MSIX may introduce new complexities in application management, the solutions and tools available demonstrate that these challenges are not insurmountable. With continued innovation and community collaboration, MSIX continues to evolve as a robust and reliable packaging format for modern software deployment.

Written by
See author's page
Horatiu Vladasel

Horatiu is a Software Packager/Sequencer with over 10 years experience, who has worked as a Software Packager at IBM and is currently offering software packaging services to companies such as BT or Nationwide.

Comments: