Uninstall and Cleanup: MSI vs. MSIX

Most of the time, when you uninstall an MSI package the application files from AppData and the registry entries created by the applications during its lifetime are left on the machine, polluting the system with garbage. The famously called “Windows rot”. This makes your PC slower every time you install an application.

MSIX packages, on the other hand, reduce machine clutter by simplifying the install and uninstall process.

Due to its containerized model, uninstalling an MSIX package will remove any files that the app has created while running (only the files redirected to its %LocalAppData%) by default. This includes all the application files installed under %ProgramFiles%WindowsApps, and any installation activities performed elsewhere. Additionally, any redirected registry writes to the application hive are removed. This helps to keep a clean machine and avoid the Windows rot.

Keep in mind that if the application creates files in other locations on the machine (not recommended, but possible if it has the right permissions), those files will not be deleted upon uninstallation. For example, a file saved in the Downloads or Desktop folder.

Generally, an update of a package will remove the previous version (if no other user on the system has it installed), but package data will be retained in the newer version.

The MSIX PowerShell commandlets provide you with options to automate your uninstalls:

> Remove-AppPackage <package full name, possibly using wildcards>

Microsoft made two types of changes in OS 2004 that now can impact the removal of package-related data. These are new as the book is being written, so while we do not have experience in using them in production, we just want to mention them:

  • There is a new option in the package manifest (UAP10 schema)called UpdateActions that appears to be related to the upgrade scenario but might also apply during an uninstallation.

Uninstalling Modification Packages

Important! When you uninstall an MSIX package, its related modification packages will be removed automatically.

As explained in the MSIX Modification Packages chapter, these are independently managed packages with regards to their deployment.

Make sure your deployment team receives correct and clear instructions for removing these packages.