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.
In the MyApp dialog box, click
Next three times to start installing the MyApp application on
your computer.
On the Installation Complete page, click
Close to quit your installation.
In Windows Explorer, locate the folder where you installed
the MyApp application. Notice that the Readme.txt file is located in this
folder.
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.
On the View menu, click Properties
Window to select the Properties window for the MyApp
project.
Change the ProductName property to
UpdatedMyApp.
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?
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.
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.
Try to Install the Updated Version of Your Application
Click Start, and then click
Run. The Run dialog box appears.
In the Open text box, type
cmd, and then click OK to open a
command prompt.
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.
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.
Troubleshoot Your Installation by Using the Log File
Switch to Windows Explorer.
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.
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:
Click Start, and then click
Run. The Run dialog box appears.
In the Open text box, type
regedit, and then click OK to start
Registry Editor.
In Registry Editor, locate and then click the following
registry subkey:
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.
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).
Remove the earlier version of your application. To do this,
follow these steps:
On Windows 2000
Click Start.
Point to Settings, and then click
Control Panel.
In Control Panel, double-click Add/Remove
Programs.
In the Add/Remove Programs dialog box,
click MyApp under Currently installed
programs, and then click Remove.
In the dialog box that appears, click
Yes.
When the removal process has completed, close the
Add/Remove Programs dialog box, and then close Control
Panel.
On Windows XP
Click Start, and then click
Control Panel.
Under Pick a category, click
Add or Remove Programs.
In the Add or Remove Programs dialog
box, click MyApp under Currently installed
programs, and then click Remove.
In the dialog box that appears, click
Yes.
When the removal process has completed, close the
Add or Remove Programs dialog box, and then close Control
Panel.
On Windows Server 2003
Click Start, point to Control
Panel, and then click Add or Remove
Programs.
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.
In the dialog box that appears, click
Yes.
When the removal process has completed, close the
Add or Remove Programs dialog box, and then close Control
Panel.
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.
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
In the UpdatedMyApp dialog box, click
Next three times to start installing the UpdatedMyApp
application on your computer.
On the Installation Complete page, click
Close to quit your installation.
In Windows Explorer, locate the folder where you installed
the UpdatedMyApp application. Notice that the Readme.txt file is located in
this folder.
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.
Switch to Windows Explorer.
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: