Registry keys created after installation and left behind after uninstallation.

Copper Contributor
Hello,
When we install an application using the MSIX package we created using the MSIX packaging tool, certain registry keys are created. Once we uninstall the application, some of the registry keys are left behind in the system. We are wondering why this might be the case ?"
Thank you,
Uvin
6 Replies

Hi @uvinabeysinghe 

 

By default, all the registry operations should be redirected inside the MSIX container.

 

Have you, or a colleague that maybe worked on that package, accidentally disabled the registry virtualization (This video shows how you can do that)?

 

Bogdan

@uvinabeysinghe  (Assuming OS 2004 in this discussion for simplicity, older versions have slight differences).  Registry key/item creation and write activity by processes running inside the container are held in the redirected application container hive for the user whenever that activity involves keys that are part of the package definition.

 

So if the package contains HKCU\Software\Vendor and the app writes to that area, it is redirected and will be removed (by default) when the package is removed.  The redirected application container hive exists as a file under the user localappdata packages folder for this package in the form of a .dat file.

 

But if the app writes to a different area of the registry, those writes will go to the appropriate underlying hive (HKLM/HKCU), be visible using regedit both while the app is present on the system and after removal.

 

Also if any part of the app "escapes" the container, activity we have previously seen on older OS versions such as powershell scripts, those writes are native and not tied to the package.

 

It may be possible that there are other small artifacts left behind by install/uninstall of the package alone, but those should be minor and likely reflect bugs.

 

You can always post additional details of what you are seeing here.

Hi @Bogdan Mitrache , @TIMOTHY MANGAN 

As for additional details, we have created “myapp_setup.exe” which we converted to “myapp.msix”. When we install “myapp_setup.exe”, we create below registry keys for supporting the URI protocol “myapp-name://“ . The MSIX packaging tool monitors this and includes the appropriate steps in the MSIX installer.
 

 

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\myapp-name]
@="URL:myapp-name"
"URL Protocol"=""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\myapp-name\shell]
@="open"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\myapp-name\shell\open]
@=""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\myapp-name\shell\open\command]
@="\"C:\\Users\\username\\Applications\\MyApp\\MyAppName.exe\""​

 


The MSIX packaging tool sees these registry keys getting created and adds the corresponding app manifest entry in the MSIX package to support the URI protocol. Since the registry keys are not required in the MSIX package, is there a way to make these keys not get created when MSIX package is installed?

Thank you,
Uvin

@uvinabeysinghe The MSIX Packaging tool contains a package editor (available after the manifest is created but just before you save the package) where cleanup of this kind could be performed.  Why do you feel the need to remove the entries?

 

I would recommend against cleaning up those entries unless you find that they are actually causing you a problem..

 

The registry entries inside the package are contained in the application hive and are not visible externally. They would not be used at all in most cases, but there are situations where keeping these inside the package may be necessary. 

  • These involve interference by forces outside of the package alter the external protocol handler entries.
  • Workflows (that do not exist yet but presumably will someday) that allow for using this package as a base for something. In App-V we have package upgrade scenarios that rely on having the original captured components intact, as well as external package enhancement tools that rely on the underlying registry entries to be present.
  • Converters to something new (there is always eventually something new to convert to) may need those entries similarly.

@TIMOTHY MANGAN 

Hi,

The registry keys listed in the above reply are created to support URI scheme in the desktop app installer. MSIX package converter correctly interprets these keys and adds the required AppManifest entry to support URI scheme in the MSIX package.

Based on the discussion in https://techcommunity.microsoft.com/t5/msix-packaging-and-tools/adding-uri-activation-to-appxmanifes... , our understanding is that only the AppManifest entries are required to support the URI scheme in MSIX and registry keys are not required.

> The registry entries inside the package are contained in the application hive and are not visible externally.

The registry entries the MSIX package creates are visible externally using RegEdit under HKEY_LOCAL_MACHINE\SOFTWARE\Classes\myapp-name.

Is there a way to make these registry keys not get created when the MSIX package is used to install our App?

Thanks,
Uvin

@uvinabeysinghe  So when the installation occurs and is then removed, some of the registry keys natively created due to the FTA extension remain.  Hopefully @ShakersMSFT can look into this.  

 

I would think that this is due to the info in the Manifest and cleaning out the container registry during packaging would not help.  I would also guess that the particular integrations added during install include some shell extensions, and we could be looking the extension being in use.  I'm not aware of MSIX having a pending state on the removal like App-V has, but you might need to try logging off and on to see if it cleans up automatically.