Customized setup and deployment process


In this article I have explained about how to use custom actions during installation, uninstallation, commit and rollback of the setup project.

I have explained about the customization of the setup and deployment process below. I have taken an example of form display during the installation of the setup project.

Steps to do this are:

1. Create a new project say DemoApplication.
2. Declare controls on the form. Form name is given as DemoForm I have took one two buttons and two labels.
3. Write the code inside the form. I have added code to button click events.
4. Add installer class to the project. This is by done by the following.
* Right click on "DemoApplication" project and click Add -> New Item.
* Select Installer Class from the "visual studio installed templates". Change the name to "InstallerFile.cs".
5. After adding the installer file click on "View Code" of that and go the definition of InitializeComponent() funtion.
6. Add the following two lines in the InitializeComponent() definition


private void InitializeComponent()
{
System.Windows.Forms.Form f = new DemoForm();
f.ShowDialog();

}


7. Build the Application.
8. Click on the solution and Add a new Setup Project. I have created DemoSetup project
9. Add Project output as "Primary output from DemoApplication"
10. Right click on DemoSetup project -> "View" and click on "Custom Actions"
11. In the Custom Actions window right click on Install and click on "Add Custom Action"
12. In the dialog box displayed select Application folder and click on "Primary output from DemoApplication(Active).
13. Build the setup project and click on install of the setup project.
14. The form will be invoked when the actual installation of the setup project starts.
15. You can repeate the steps from 10 to 13 for Uninstall, Commit and Rollback actions.

Please find the attached code :"DemoApplication" link below.


Attachments

  • DemoApplication (41109-4132-WindowsFormsApplication1.zip)
  • Comments

    No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: