The Microsoft Installer format (* .msi) supports what you want to do, unfortunately, Visual Studio offers limited customization and is intended for use in basic projects.
There are many resources in this thread, and many others ask similar questions. My best advice would be to spend some time examining the MSDN documentation.
...
Update
OK Having spent 30 minutes reading several articles, I think that this can be possible with the help of a special action that you pack together with the new installer.
Follow this MSDN article in creating custom actions . This involves creating a new class library, adding the System.Configuration.Install.Installer class, adding it as output to the installation project , and then selecting it as a custom action.
To view the custom actions tab, right-click the installation project and choose View> Custom Actions.
From here: you will need to write code to remove the installation directory and AppData profile. This article on how to set up Custom Activity Data may be helpful.
Good luck.
Hth,
Dennis
source share