Microsoft KB Archive/837225

= BUG: You receive an &quot;installation is in progress&quot; message when you remove a program that was created in Visual Studio .NET =

Article ID: 837225

Article Last Modified on 5/17/2007

-

APPLIES TO


 * Microsoft Visual Studio .NET 2003 Enterprise Architect
 * Microsoft Visual Studio .NET 2003 Enterprise Developer
 * Microsoft Visual Studio .NET 2003 Academic Edition
 * Microsoft Visual Studio .NET 2002 Professional Edition
 * Microsoft Visual Studio .NET 2002 Enterprise Architect
 * Microsoft Visual Studio .NET 2002 Enterprise Developer
 * 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 &quot;Symptoms&quot; 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 &quot;Applies to&quot; section.



Steps to reproduce the behavior
 Create a new solution project:  Start Microsoft Visual Studio .NET. On the File menu, point to New, and then click Project. The New Project dialog box appears. Under Project Type, click Visual Basic Projects. Under Templates, click Windows Application.</li> In the Name box, type MyApplication, and then click OK.</li> On the Build menu, click Build MyApplication.</li></ol> </li> Add a Setup project to your solution: <ol style="list-style-type: lower-alpha;"> On the File menu, point to Add Project, and then click New Project. The Add New Project dialog box appears.</li> Under Project Type, click Setup and Deployment Projects.</li> Under Templates, click Setup Project.</li> In the Name box, type MySetup, and then click OK.</li></ol> </li> Add a custom action to the MySetup project: <ol style="list-style-type: lower-alpha;"> On the View menu, point to Editor, and then click Custom Actions. The Custom Actions Editor appears.</li> Right-click the Install node, and then click Add Custom Action. The Select Item in Project dialog box appears.</li> Double-click Application Folder, and then click Add Output. The Add Project Output Group dialog box appears.</li> Click Primary output, and then click OK.</li> Click OK to return to the Custom Actions Editor.</li> On the View menu, click Properties Window.</li> In the Properties window, set the CustomActionData property to /Action=i .</li> In the Custom Actions Editor, right-click the Uninstall node, and then click Add Custom Action. The Select Item in Project dialog box appears.</li> <li>Double-click Application Folder.</li> <li>Click Primary output from MyApplication (Active), and then click OK.</li> <li>On the View menu, click Properties Window.</li> <li>In the Properties window, set the CustomActionData property to /Action=i .</li></ol> </li> <li>Create an Installer class: <ol style="list-style-type: lower-alpha;"> <li>In Solution Explorer, right-click MyApplication, point to Add, and then click Add New Item. The Add New Item - MyApplication dialog box appears.</li> <li>Under Templates, click Installer Class.</li> <li>In the Name box, type InstClass, and then click Open. The Design view of the Installer1.vb Installer class appears.</li> <li>Click the click here to switch to code view link. The code view of the Installer1.vb Installer class appears.</li> <li> Locate the following code: End Class </li> <li> 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(&quot;Action&quot;) If ActionName = &quot;i&quot; Then MsgBox(&quot;Installation is in progress.&quot;) 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(&quot;Action&quot;) If ActionName = &quot;i&quot; Then MsgBox(&quot;Uninstallation is in progress.&quot;) End If End Sub </li></ol> </li> <li>On the Build menu, click Build MyApplication.</li> <li>In Solution Explorer, right-click MySetup, and then click Build.</li> <li>Right-click MySetup, and then click Install.</li> <li>On the first three pages of the MySetup dialog box that appears, click Next. You receive the following message:

Installation is in progress.

</li> <li>Click OK, and then click Close.</li> <li>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.</li></ol>

<div class="references_section">