Forum Discussion
How to remove the custom path while uninstalling MSIX package ?
Thanks for your response.
Yes, the folder creating under C:\ProgramData folder and its creating by C++ applications.
- Mar 08, 2024MSIX does not have a method to remove files written to those locations. However, by adding the PSF (PsfLauncher.exe to front the application, plus PsfRuntime.dll and either FileRedirectionFixup or MfrFixup), you can cause those writes to be redirected to the user's local appdata\Packages redirection area for the package. The redirected location is removed by default when the package is uninstalled, which would be a solution.
- DhanarajGMar 12, 2024Copper Contributor
TIMOTHY_MANGAN , Thank you so much, your suggested solution should work.
Our scenario is little different, we are creating folder\<files> under C:\ProgramData\.. due to easy access by the other applications as well, so we have to clean it only when uninstall this MSIX application.
I have gone through the below information, kind of this, is possible in MSIX?
Here, this "Setup_AntiCheat.bat" contains the info what to delete during uninstall.
<Extensions>
<desktop6:UninstallActions>
<desktop6:UninstallAction File="Setup_AntiCheat.bat" Name="AC_1" Arguments="/remove /silent" /> </desktop6:UninstallActions>
</Extensions>
Ref: https://learn.microsoft.com/en-us/uwp/schemas/appxpackage/uapmanifestschema/element-desktop6-installaction
Note: This element is currently intended to be used only by desktop PC games that are packaged in an MSIXVC container. It requires the customInstallActions https://learn.microsoft.com/en-us/windows/uwp/packaging/app-capability-declarations#restricted-capabilities.
[Intent is to execute the .exe or .bat during MSIX uninstallation. Note: I have tried PowerShell script, but our clients may not be having permission to run PowerShell script.]
Thank you so much for your prompt response.
- Mar 12, 2024
DhanarajG I may not be much help then, as I don't use that extension.
But if your package does not also use the install option, then you may have hit something basic, such as this could be something basic like the custom action and/or MinVersion/MaxTestedVersion in the AppXManifest not being high enough.