How to restrict macOS app from uninstall using password?

Where could I find such info? My app once installed should now require the user to move it to bin trash. A kind of customized uninstaller should be fine but most users would just drag to bin. My app is a daemon and maybe I need to stop it before the user uninstall.

I saw some macos apps that do that but I dunno where to start.

How to restrict macOS app from uninstall using password?
 
 
Q