Hi 
You need to write installer class, Add from Add New Item by right click on your project 
Look into below code you will understand
  1. using System.Collections;  
  2. using System.ComponentModel;  
  3. namespace PATSInstaller  
  4. {  
  5. [RunInstaller(true)]  
  6. public partial class PATSInstall : System.Configuration.Install.Installer  
  7. {  
  8. public PATSInstall()  
  9. {  
  10. InitializeComponent();  
  11. }  
  12. public override void Install(System.Collections.IDictionary stateSaver)  
  13. {  
  14. base.Install(stateSaver);  
  15. //string fileName = "PATS Installed";  
  16. //using (StreamWriter sw = new StreamWriter(("ProjectConfigPath//PreviousConfig.txt").ToString(), false))  
  17. //{  
  18. // sw.WriteLine(fileName);  
  19. //}  
  20. }  
  21. [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]  
  22. public override void Uninstall(IDictionary savedState)  
  23. {  
  24. base.Uninstall(savedState);  
  25. //string fileName = "PATS UnInstalled";  
  26. //using (StreamWriter sw = new StreamWriter(("ProjectConfigPath//PreviousConfig.txt").ToString(), false))  
  27. //{  
  28. // sw.WriteLine(fileName);  
  29. //}  
  30. }  
  31. public override void Rollback(IDictionary savedState)  
  32. {  
  33. base.Rollback(savedState);  
  34. //Add custom code here  
  35. }  
  36. //public override void Commit(IDictionary savedState)  
  37. //{  
  38. // base.Commit(savedState);  
  39. // Add custom code here  
  40. //}  
  41. //public override void Uninstall(IDictionary savedState)  
  42. //{  
  43. // Process application = null;  
  44. // foreach (var process in Process.GetProcesses())  
  45. // {  
  46. // if (!process.ProcessName.ToLower().Contains("creatinginstaller")) continue;  
  47. // application = process;  
  48. // break;  
  49. // }  
  50. // if (application != null && application.Responding)  
  51. // {  
  52. // application.Kill();  
  53. // base.Uninstall(savedState);  
  54. // }  
  55. //}  
  56. }  
  57. }