BUG: You receive an "installation is in progress" message when you remove a program that was created in Visual Studio .NET (837225)



The information in this article applies to:

  • Microsoft Visual Studio .NET (2003), Enterprise Architect Edition
  • Microsoft Visual Studio .NET (2003), Enterprise Developer Edition
  • Microsoft Visual Studio .NET (2003), Academic Edition
  • Microsoft Visual Studio .NET (2002), Professional Edition
  • Microsoft Visual Studio .NET (2002), Enterprise Architect Edition
  • Microsoft Visual Studio .NET (2002), Enterprise Developer Edition
  • Microsoft Visual Studio .NET (2002), Academic Edition

SYMPTOMS

If you create an installation package for an application by using Microsoft Visual Studio .NET, and if the Setup program in the package contains custom actions, the Setup program runs correctly and the application installs as expected. However, when you remove the application, you may receive the following message: Installation is in progress.

CAUSE

This problem may occur if the Setup program invokes the Installer.Install method instead of the Installer.Uninstall method during the removal process.

When you use custom actions that use the CustomActionData property to pass data to the custom actions, some internal keywords in the CustomAction table may be overwritten. If any internal keywords have been overwritten, unexpected behavior may occur, such as the behavior that the "Symptoms" section describes.

WORKAROUND

To work around this behavior, do not use the CustomActionData property to pass data to custom actions that your Setup programs use.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

Steps to reproduce the behavior

  1. Create a new solution project:
    1. Start Microsoft Visual Studio .NET.
    2. On the File menu, point to New, and then click Project. The New Project dialog box appears.
    3. Under Project Type, click Visual Basic Projects.
    4. Under Templates, click Windows Application.
    5. In the Name box, type MyApplication, and then click OK.
    6. On the Build menu, click Build MyApplication.
  2. Add a Setup project to your solution:
    1. On the File menu, point to Add Project, and then click New Project. The Add New Project dialog box appears.
    2. Under Project Type, click Setup and Deployment Projects.
    3. Under Templates, click Setup Project.
    4. In the Name box, type MySetup, and then click OK.
  3. Add a custom action to the MySetup project:
    1. On the View menu, point to Editor, and then click Custom Actions. The Custom Actions Editor appears.
    2. Right-click the Install node, and then click Add Custom Action. The Select Item in Project dialog box appears.
    3. Double-click Application Folder, and then click Add Output. The Add Project Output Group dialog box appears.
    4. Click Primary output, and then click OK.
    5. Click OK to return to the Custom Actions Editor.
    6. On the View menu, click Properties Window.
    7. In the Properties window, set the CustomActionData property to /Action=i.
    8. In the Custom Actions Editor, right-click the Uninstall node, and then click Add Custom Action. The Select Item in Project dialog box appears.
    9. Double-click Application Folder.
    10. Click Primary output from MyApplication (Active), and then click OK.
    11. On the View menu, click Properties Window.
    12. In the Properties window, set the CustomActionData property to /Action=i.
  4. Create an Installer class:
    1. In Solution Explorer, right-click MyApplication, point to Add, and then click Add New Item. The Add New Item - MyApplication dialog box appears.
    2. Under Templates, click Installer Class.
    3. In the Name box, type InstClass, and then click Open. The Design view of the Installer1.vb Installer class appears.
    4. Click the click here to switch to code view link. The code view of the Installer1.vb Installer class appears.
    5. Locate the following code:
      End Class
    6. Add the following code before the code that you located in step 4e:
      Public Overrides Sub Install(ByVal stateSaver As System.Collections.IDictionary)
         MyBase.Install(stateSaver)
         Dim ActionName As String = Me.Context.Parameters.Item("Action")
         If ActionName = "i" Then
            MsgBox("Installation is in progress.")
         End If
      End Sub
      
      Public Overrides Sub Uninstall(ByVal stateSaver As System.Collections.IDictionary)
         MyBase.Uninstall(stateSaver)
         Dim ActionName As String = Me.Context.Parameters.Item("Action")
         If ActionName = "i" Then
            MsgBox("Uninstallation is in progress.")
         End If
      End Sub
  5. On the Build menu, click Build MyApplication.
  6. In Solution Explorer, right-click MySetup, and then click Build.
  7. Right-click MySetup, and then click Install.
  8. On the first three pages of the MySetup dialog box that appears, click Next. You receive the following message:Installation is in progress.
  9. Click OK, and then click Close.
  10. Try to remove the application from your computer. During the removal process, you receive the same message that you received in step 8. This behavior occurs because the Installer.Install method is invoked instead of the Installer.Uninstall method during the removal process.

Modification Type:MinorLast Reviewed:3/4/2006
Keywords:kbvs2005swept kbvs2005doesnotapply kbvs2002sp1sweep kbpending kbDeployment kbCustomAct kbAppSetup kbbug KB837225 kbAudDeveloper