The standard installer provides an overrideable Uninstall method - you could put your password mechanism in there. I haven't needed to do it myself, but it should work.
It also provides a
Installer.BeforeUninstall[
^] event which you could subscribe to - again I haven't tried it.