This is useful when custom actions are required in the installer while Visual Studio .NET 2003 is used to build the setup using the setup/deployment project.
Visual Studio 2003 does not have an option to add the custom dialogs. It has some predefined dialogs which can be used for any custom actions. If we want to have our own custom dialog, we have to follow the class given below.
Using the Code
This is a generic class which can be used as given here. We need to create a project resulting in a DLL and add this class to the project. Add multiple dialogs required to be launched at the end of the installation.
public class CustomDialogLauncher : System.Configuration.Install.Installer
private string InstallDir;
public override void Install(IDictionary savedState)
string TheAssemblyPath = this.Context.Parameters["assemblypath"];
InstallDir = TheAssemblyPath.Substring
// Display the custom dialog
// If you want you can use InstallDir else, skip
CustomDialog custDialog = new CustomDialog(InstallDir);
DialogResult result = custDialog.ShowDialog();
if(result != DialogResult.OK)
DialogResult rollBack = MessageBox.Show
("This will roll back the installation, are you sure",
if(DialogResult.Yes == rollBack)
throw new InstallException("Installation aborted, rolling back");
// Overridden Uninstall method which will get called during un install.
public override void Uninstall(IDictionary savedState)
// Overridden Rollback method which will get called
// during installation rollback
public override void Rollback(IDictionary savedState)
public override void Commit(IDictionary savedState)
Add the multiple custom dialogs required in the setup project in the same project. Call all the dialogs in the
Install() function in the sequence required. Once the new DLL is created, add the DLL to Application folder using Add Custom action. Select the Add file button to add the newly built DLL.
- 30th July, 2007: Initial post