How to configure post-build events for setup/deployment projects in Visual Studio 2005

Aaron Stebner's WebLog -

While researching a previous blog post, I discovered a way to configure post-build events for setup/deployment projects in Visual Studio 2005.  I had not realized that previous versions of Visual Studio did not support configurable post-build events for setup projects, but Visual Studio 2005 does.  In addition, the way to access the UI needed to configure this setting for a setup project is different than for other project types in the Visual Studio 2005 IDE.

The following steps can be used to add a post-build step to your setup/deployment project:

  1. Open or create a setup/deployment project in Visual Studio 2005
  2. Press F4 to display the Properties window
  3. Click on the name of your setup/deployment project in the Solution Explorer
  4. Click on the PostBuildEvent item in the Properties window to cause a button labeled "..." to appear
  5. Click on the "..." button to display the Post-build Event Command Line dialog
  6. Add a command line of your choice in the Post-build event command line text box
  7. Build your project in Visual Studio and verify that the post-build event is executed after the main MSI build

You can also configure a pre-build event in a similar manner - there is also an item in the Properties window named PreBuildEvent.

As I described in this previous blog post, it can be useful to run a script as a post-build event if you want to automatically modify the MSI that is built as a part of your project to include settings that are not available as part of the setup/deployment project options in the Visual Studio IDE UI.

 

 

Recent Posts

Tag Cloud

1 Comment

  • I want a third party component to be installed when installation of my application is about to finish. How should I go about it? Is it correct to use Post Build Event for this reason. One more thing: Could you please post an example of How to mention a post build event here using macros. I am getting an error: "Error code'1' 'Unspecified Error'". Any idea!

Comments have been disabled for this content.