Microsoft KB Archive/830613

= HOW TO: Use a Log File to Troubleshoot a Windows Installer Application Installation =

Article ID: 830613

Article Last Modified on 4/3/2007

-

APPLIES TO


 * Microsoft Windows Installer 2.0
 * 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

-



IN THIS TASK

 * SUMMARY
 * Requirements
 * Create a Setup Project
 * Add a File and Then Build Your Setup Project
 * Install the Original Version of Your Application
 * Change the Version of Your Application
 * Try to Install the Updated Version of Your Application
 * Troubleshoot Your Installation by Using the Log File
 * Install the Updated Version of Your Application
 * REFERENCES



SUMMARY
This step-by-step article describes how to use a log file to troubleshoot errors that may occur if you use a Microsoft Windows Installer package to install an application.

Windows Installer uses a log file to record errors and to record events. You can use the information that appears in the log file that corresponds to an unsuccessful Windows Installer installation to troubleshoot any errors that occurred during the installation.

The example scenario in this article describes how to troubleshoot a Windows Installer installation that does not succeed when you try to install an updated version of an application before you remove an earlier version of the application. However, you can use the guidelines that this article discusses to troubleshoot other errors that may occur when you use a Windows Installer package to install an application.

back to the top

Requirements
This article assumes that you are familiar with the following topics:
 * Windows Installer
 * Microsoft Visual Studio .NET Setup Projects

The following list outlines the recommended hardware, software, network infrastructure, and service packs that you need:
 * Microsoft Windows 2000, Microsoft Windows XP, or Microsoft Windows Server 2003
 * Visual Studio .NET

back to the top

Create a Setup Project

 * 1) Start Visual Studio .NET.
 * 2) On the File menu, point to New, and then click Project. The New Project dialog box appears.
 * 3) Under Project Types, click Setup and Deployment Projects.
 * 4) Under Templates, click Setup Project.
 * 5) In the Name text box, type MyApp.
 * 6) Click OK.

back to the top

Add a File and Then Build Your Setup Project
 Create a file that is named Readme.txt. To do this, follow these steps:  Start a text editor such as Notepad. Type the following text in the text editor:

This is a readme file.

 On the File menu, click Save. In the Save As dialog box, locate the folder where you created the MyApp project in the &quot;Create a Setup Project&quot; section of this article. In the File name text box, type Readme.txt . Click Save.</li></ol> </li> Switch to Visual Studio .NET.</li> On the Project menu, point to Add, and then click File.</li> In the Add Files dialog box, locate and then click the Readme.txt file that you created in step 1.</li> Click Open. The Readme.txt file is added to the MyApp project.</li> On the Build menu, click Build MyApp. By default, the Setup.exe file is created in the Debug folder that is located in the MyApp folder.</li></ol>

back to the top

Install the Original Version of Your Application

 * 1) Start Microsoft Windows Explorer.
 * 2) Locate the Setup.exe file that you built in step 6 of the &quot;Add a File and Then Build Your Setup Project&quot; section.
 * 3) Run the Setup.exe file.
 * 4) In the MyApp dialog box, click Next three times to start installing the MyApp application on your computer.
 * 5) On the Installation Complete page, click Close to quit your installation.
 * 6) In Windows Explorer, locate the folder where you installed the MyApp application. Notice that the Readme.txt file is located in this folder.
 * 7) In a text editor such as Notepad, open the Readme.txt file. Notice that the Readme.txt file contains the text that you typed in step 1b of the &quot;Add a File and Then Build Your Setup Project&quot; section.

back to the top

Change the Version of Your Application
<ol> Switch to Visual Studio .NET.</li> In Solution Explorer, click MyApp.</li> On the View menu, click Properties Window to select the Properties window for the MyApp project.</li> Change the ProductName property to UpdatedMyApp .</li> Change the Version property to 2.0.0. A Microsoft Development Environment dialog box that contains the following text appears:

It is recommended that the ProductCode and PackageCode be changed if you change the version. Do you want to do this?

</li> Click No to make sure that you do not change either the product code or the package code of the MyApp application. If you use a Windows Installer package to install this version of the MyApp application before you remove the original version of the application, your installation will not succeed.</li> On the Build menu, click Build MyApp. By default, the Setup.exe file is recreated in the Debug folder that is located in the MyApp folder.</li></ol>

back to the top

Try to Install the Updated Version of Your Application
<ol> Click Start, and then click Run. The Run dialog box appears.</li> In the Open text box, type cmd, and then click OK to open a command prompt.</li> At the command prompt, change the directory path to the directory where you recreated the Setup.exe file in step 7 of the &quot;Change the Version of Your Application&quot; section.</li> At the command prompt, run the following command to try to install the updated version of your application with the logging feature enabled:

msiexec /i MyApp.msi /l* LogFile.txt

You receive the following error message:

Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Add/Remove Programs on the Control Panel.

Note The /l* command-line option specifies that Windows Installer will record all information (except verbose output and extra debugging options that are available only on Windows Server 2003) in the LogFile.txt log file.</li> <li>Click OK to dismiss the error message.</li></ol>

back to the top

Troubleshoot Your Installation by Using the Log File
<ol> <li>Switch to Windows Explorer.</li> <li>In a text editor, open the LogFile.txt log file that you created in step 4 of the &quot;Try to Install the Updated Version of Your Application&quot; section. Notice that the log file contains information that is similar to the following:

Another version of this product is already installed. Installation of this version cannot continue.

To configure or remove the existing version of this product, use Add/Remove Programs on the Control Panel.

Note The value  represents the product code of an earlier version of your application. Write down whatever this value is for your system.</li> <li>To determine the name of the earlier version of your application, you must locate the application that has the product code that you noticed in step 2. To do this, follow these steps: <ol style="list-style-type: lower-alpha;"> <li>Click Start, and then click Run. The Run dialog box appears.</li> <li>In the Open text box, type regedit, and then click OK to start Registry Editor.</li> <li>In Registry Editor, locate and then click the following registry subkey:

Note The  value in the subkey should be the same as the value that you wrote down in step 2.</li> <li>In the right pane of Registry Editor, notice the data that corresponds to the DisplayName registry entry. Notice that this data is the name of the earlier version of your application (in this case, MyApp).</li></ol> </li> <li> Remove the earlier version of your application. To do this, follow these steps:

On Windows 2000
<ol style="list-style-type: lower-alpha;"> <li>Click Start.</li> <li>Point to Settings, and then click Control Panel.</li> <li>In Control Panel, double-click Add/Remove Programs.</li> <li>In the Add/Remove Programs dialog box, click MyApp under Currently installed programs, and then click Remove.</li> <li>In the dialog box that appears, click Yes.</li> <li>When the removal process has completed, close the Add/Remove Programs dialog box, and then close Control Panel.</li></ol>

On Windows XP
<ol style="list-style-type: lower-alpha;"> <li>Click Start, and then click Control Panel.</li> <li>Under Pick a category, click Add or Remove Programs.</li> <li>In the Add or Remove Programs dialog box, click MyApp under Currently installed programs, and then click Remove.</li> <li>In the dialog box that appears, click Yes.</li> <li>When the removal process has completed, close the Add or Remove Programs dialog box, and then close Control Panel.</li></ol>

On Windows Server 2003
<ol style="list-style-type: lower-alpha;"> <li>Click Start, point to Control Panel, and then click Add or Remove Programs.</li> <li>In the Add or Remove Programs dialog box, click MyApp under Currently installed programs, and then click Remove. If you receive a Warning dialog box, click Continue.</li> <li>In the dialog box that appears, click Yes.</li> <li>When the removal process has completed, close the Add or Remove Programs dialog box, and then close Control Panel.</li></ol> </li></ol>

back to the top

Install the Updated Version of Your Application
<ol> <li>Switch to the command prompt.</li> <li>Make sure that the current directory is the same as the directory where you recreated the Setup.exe file in step 7 of the &quot;Change the Version of Your Application&quot; section.</li> <li>At the command prompt, run the following command to install the updated version of your application with the logging feature enabled:

msiexec /i MyApp.msi /l* LogFile.txt

</li> <li>In the UpdatedMyApp dialog box, click Next three times to start installing the UpdatedMyApp application on your computer.</li> <li>On the Installation Complete page, click Close to quit your installation.</li> <li>In Windows Explorer, locate the folder where you installed the UpdatedMyApp application. Notice that the Readme.txt file is located in this folder.</li> <li>In a text editor, open the Readme.txt file. Notice that the Readme.txt file contains the text that you typed in step 1b of the &quot;Add a File and Then Build Your Setup Project&quot; section.</li> <li>Switch to Windows Explorer.</li> <li> In a text editor, open the LogFile.txt log file that you created in step 3. Notice that the last line of the LogFile.txt log file contains the following text: <pre class="fixed_text">Product: UpdatedMyApp -- Installation completed successfully. </li></ol>

back to the top

<div class="references_section">