Is there any way to run custom code during the installation or uninstallation of a ClickOnce app?
This question has been asked before here, but that was a long time ago, the answer given there was IMHO very kludgy, and I'm kind of hoping that the later releases of VS have provided a more elegant solution...
To uninstall a ClickOnce application, users can go to the Control Panel and launch the "Add or Remove Programs" application. In the "Change or Remove Programs" section, users then select the application to uninstall and click the Change/Remove button.
Windows Installer deployment requires administrative permissions and allows only limited user installation; ClickOnce deployment enables non-administrative users to install and grants only those Code Access Security permissions necessary for the application.
Click the Prerequisites button to open the Prerequisites dialog box. In the Prerequisites dialog box, make sure that the Create setup program to install prerequisite components check box is selected. In the Prerequisites list, check the components that you wish to install, and then click OK.
Check the following articles:
Administering ClickOnce Deployments
Walkthrough: Creating a Custom Installer for a ClickOnce Application
This solution is not very elegant but works:
ClickOnce application autostart and clean uninstall or the way to customize ClickOnce installation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With