Hi, @jianqiang qin
Thank you for posting in Microsoft Q&A forum.
We may consider creating a package and program to do the uninstallation, a package do not need a detection method.
https://learn.microsoft.com/en-us/mem/configmgr/apps/deploy-use/packages-and-programs
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Add comment".