Sumnoon
Sumnoon

Reputation: 135

Show a toast notification when UWP app is being uninstalled

I want to find a solution when the user uninstalls my app, a toast notification will be shown. But I could not find any solution for it. I tried using, the package uninstall event: https://learn.microsoft.com/en-us/uwp/api/windows.applicationmodel.packagecatalog.packageuninstalling?view=winrt-18362 But this only worked when the app was opened. Not when the app is closed. Is there any way to observe app uninstallation? I heard I can do that using win32 API but not sure how. Can you guys help me? If you can suggest any win32 API that will also be helpful.

Upvotes: 2

Views: 273

Answers (1)

Andy Schmidt
Andy Schmidt

Reputation: 88

You maybe able to use the desktop6:UninstallAction package extension, which requires the customInstallActions restricted capability. You specify an executable in your package, a name for the action, and arguments to pass to the executable. Have the executable when invoked with the arguments display the desired toast notification.

Upvotes: 1

Related Questions