There are several methods, two of which are as follows. Provide a custom installer or installation project.
Here's how to create a custom installer
[RunInstaller(true)] public class MyInstaller : Installer { public HelloInstaller() : base() { } public override void Commit(IDictionary mySavedState) { base.Commit(mySavedState); System.IO.File.CreateText("Commit.txt"); } public override void Install(IDictionary stateSaver) { base.Install(stateSaver); System.IO.File.CreateText("Install.txt"); } public override void Uninstall(IDictionary savedState) { base.Uninstall(savedState); File.Delete("Commit.txt"); File.Delete("Install.txt"); } public override void Rollback(IDictionary savedState) { base.Rollback(savedState); File.Delete("Install.txt"); } }
To add an installation project
See How to create an installation package using Visual Studio .NET for details.
Asad Butt Feb 12 '10 at 10:39
source share