Creating a setup wizard within Visual Studio does not include an uninstall shortcut with it. The uninstalleasiest and quickest way would be to do the following. This post assumes you already know how to create a setup wizard.

Create a batch file (say name it uninstall.bat) with the contents below
@echo off
msiexec /x {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}

Where {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} is the product code that is found in your setup project’s product code. Make sure you include the brackets as well.

Under Application Folder, right click, choose ADD, then FILE and browser to where uninstall.bat is located. Under User’s Program Menu, right click and create a shortcut. Then browser to Application Folder and choose the uninstall.bat file that you just added.

Rebuild your project and voila! Your uninstall shortcut is now included when the setup wizard installs your application.

ASP.NET provides a control that uses the Membership API to create users on the fly via the CreateUserWizard control. The only drawback with this control is that you cannot include any other details like first name, last name, address and others. You would have to place all other details as a separate page, called a Wizard Step. When you use forms, naturally, you would have to use validation in order to have the correct data that will be stored in your database.

ASP.NET also has a nifty control called ValidationSummary that collects all errors of controls found in the tag and displays them as either a List or a Bulleted List. I typically got stuck for half a day looking for a solution because my ValidationSummary control does not display when it is in the CreateUserStep of my wizard. You can use a property called ValidationGroup to specify which set of controls will be collected by the ValidationSummary control for display. You do this by giving the ValidationGroup a name, which is case-sensitive by the way. My problem persisted because the ValidationSummary control for my CreateUserStep has a different name. I later found out that you would have to use the CreateUserWizard's ID as the ValidationSummary's ValidationGroup's name for this to work. See the sample code below.

I specifically added a StartNavigationTemplate tag and overrode the asp:Button and its properties because the validation does not work if you do not set the button’s CausesValidation property to true. Hence, your ValidationSummary control would show nothing since no validation took place. Notice that my ValidationSummary's ValidationGroup is called PersonalVG. You can name it any way you want but to use the ValidationSummary's ValidationGroup for the CreateUserStep, you would have to use the CreateUserWizard's ID for this to work. Otherwise, no validation error messages will be displayed and you will just be stuck on the CreateUserStep page.

Related Posts Plugin for WordPress, Blogger...