HOW TO: Use a Log File to Troubleshoot a Windows Installer Application Installation (830613)



The information in this article applies to:

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

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

  1. Create a file that is named Readme.txt. To do this, follow these steps:
    1. Start a text editor such as Notepad.
    2. Type the following text in the text editor:

      This is a readme file.

    3. On the File menu, click Save.
    4. In the Save As dialog box, locate the folder where you created the MyApp project in the "Create a Setup Project" section of this article.
    5. In the File name text box, type Readme.txt.
    6. Click Save.
  2. Switch to Visual Studio .NET.
  3. On the Project menu, point to Add, and then click File.
  4. In the Add Files dialog box, locate and then click the Readme.txt file that you created in step 1.
  5. Click Open. The Readme.txt file is added to the MyApp project.
  6. 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.
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 "Add a File and Then Build Your Setup Project" 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 "Add a File and Then Build Your Setup Project" section.
back to the top

Change the Version of Your Application

  1. Switch to Visual Studio .NET.
  2. In Solution Explorer, click MyApp.
  3. On the View menu, click Properties Window to select the Properties window for the MyApp project.
  4. Change the ProductName property to UpdatedMyApp.
  5. 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?
  6. 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.
  7. 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.
back to the top

Try to Install the Updated Version of Your Application

  1. Click Start, and then click Run. The Run dialog box appears.
  2. In the Open text box, type cmd, and then click OK to open a command prompt.
  3. At the command prompt, change the directory path to the directory where you recreated the Setup.exe file in step 7 of the "Change the Version of Your Application" section.
  4. 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.
  5. Click OK to dismiss the error message.
back to the top

Troubleshoot Your Installation by Using the Log File

  1. Switch to Windows Explorer.
  2. In a text editor, open the LogFile.txt log file that you created in step 4 of the "Try to Install the Updated Version of Your Application" 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.
    {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}

    Note The value {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} represents the product code of an earlier version of your application. Write down whatever this value is for your system.
  3. 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:
    1. Click Start, and then click Run. The Run dialog box appears.
    2. In the Open text box, type regedit, and then click OK to start Registry Editor.
    3. In Registry Editor, locate and then click the following registry subkey:

      HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}

      Note The {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} value in the subkey should be the same as the value that you wrote down in step 2.
    4. 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).
  4. Remove the earlier version of your application. To do this, follow these steps:

    On Windows 2000

    1. Click Start.
    2. Point to Settings, and then click Control Panel.
    3. In Control Panel, double-click Add/Remove Programs.
    4. In the Add/Remove Programs dialog box, click MyApp under Currently installed programs, and then click Remove.
    5. In the dialog box that appears, click Yes.
    6. When the removal process has completed, close the Add/Remove Programs dialog box, and then close Control Panel.

    On Windows XP

    1. Click Start, and then click Control Panel.
    2. Under Pick a category, click Add or Remove Programs.
    3. In the Add or Remove Programs dialog box, click MyApp under Currently installed programs, and then click Remove.
    4. In the dialog box that appears, click Yes.
    5. When the removal process has completed, close the Add or Remove Programs dialog box, and then close Control Panel.

    On Windows Server 2003

    1. Click Start, point to Control Panel, and then click Add or Remove Programs.
    2. 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.
    3. In the dialog box that appears, click Yes.
    4. When the removal process has completed, close the Add or Remove Programs dialog box, and then close Control Panel.
back to the top

Install the Updated Version of Your Application

  1. Switch to the command prompt.
  2. Make sure that the current directory is the same as the directory where you recreated the Setup.exe file in step 7 of the "Change the Version of Your Application" section.
  3. 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

  4. In the UpdatedMyApp dialog box, click Next three times to start installing the UpdatedMyApp 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 UpdatedMyApp application. Notice that the Readme.txt file is located in this folder.
  7. 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 "Add a File and Then Build Your Setup Project" section.
  8. Switch to Windows Explorer.
  9. 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:
    Product: UpdatedMyApp -- Installation completed successfully.
back to the top

REFERENCES

For additional information, click the following article numbers to view the articles in the Microsoft Knowledge Base:

241928 BUG: Error 1376 Using RemoveFile Table with Windows Installer

283243 PRB: Internal Error Message 2351 When You Apply a Windows Installer Patch

299803 PRB: Error 1706 "No Valid Source Could Be Found" When Installing MSI File from Removable Media

316309 Windows Installer Error 1619 When You Install from NTFS-Protected Directories

318705 FIX: Writing .ini Files to Network Location with Windows Installer Results in Error 1913

327533 INFO: List of Bugs That Are Fixed in Windows Installer Version 2.0.2600.3

814341 Windows Installer Installation Stops with an Error Stating System Files Could Not Be Updated

For more information, visit the following Microsoft Developer Network (MSDN) Web sites:back to the top


Modification Type:MinorLast Reviewed:5/23/2005
Keywords:kbCPApplet kbRegistry kbAppSetup kbPDWizard kbIDEProject kbsetup kbDeployment kberrmsg kbHOWTOmaster KB830613 kbAudDeveloper