cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Vladimir
Level 3

Major upgrade fails to remove the previous version due to writing to MSI log

First I install one version of my product. Then I create a major upgrade. After installing the major upgrade the previous version is still shown in programs and features along with the newest version. This was tested on Vista and on Windows 7.

This situation happens only when my installer creates a log. I do it by setting the following line to the MSI Command Line Arguments in Release->Setup.exe tab:
/L*v "%TEMP%\MyProduct.log"

When not writing to the log the upgrade removes a previous version correctly.
Labels (1)
0 Kudos
(10) Replies
Reureu
Level 10

Vladimir wrote:
When not writing to the log the upgrade removes a previous version correctly.

In a way, that's quite lucky that the problem occurs when the installer logs its activity to a file.
It means you shall be able to see what's going wrong by reading the logfile.
If you want anyone to help you, you better upload the logfile.
0 Kudos
Vladimir
Level 3

I have uploaded the log.

Reureu wrote:
In a way, that's quite lucky that the problem occurs when the installer logs its activity to a file.
It means you shall be able to see what's going wrong by reading the logfile.
If you want anyone to help you, you better upload the logfile.
0 Kudos
Reureu
Level 10

Hi there,

These few lines in your log mean RemoveExistingProducts is skipped:
MSI (s) (74:00) [18:23:20:638]: Skipping RemoveExistingProducts action: current configuration is maintenance mode or an uninstall
Action start 18:23:20: RemoveExistingProducts.
MSI (s) (74:00) [18:23:20:639]: Doing action: InstallInitialize
Action ended 18:23:20: RemoveExistingProducts. Return value 0.


Now, my questions:

  • Am I right in thinking that your project an InstallScript MSI?
  • Did you change the product code of your new setup?
  • Check in the InstallExecuteSequence: Is there any condition to enable the execution of RemoveExistingProducts?
  • Have you entered any "MSI Command-Line Arguments" in the Release view (under the Setup.exe tab)?
  • Does the problem still occur if you bypass setup.exe and directly launch the MSI package?
  • Can you add the following registry entry, clean your temp folder and try to execute your major upgrade again.
    [CODE]Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer]
    "Logging"="voicewarmupx"[/CODE]This will create an MSI logfile with a random name in your Temp folder. Does the problem still occur?
0 Kudos
Vladimir
Level 3

Here are my answers.

1. The project is and InstallScript MSI.

2. The product code is changes in the upgrade.

3. In InstallExecuteSequence there is no condition for RemoveExistingProducts.

4. MSI Command-Line Arguments are entered - to create the log. This is the point of the question. The arguments are:
/L*v "%TEMP%\MyProduct.log"

5. I can not launch the MSI package directly. In my setup type the setup.exe must be launched.

6. When adding the key to the registry the random logs (4 files) are created. When removing the line from MSI Command-Line Arguments (for named log) the problem does not occur. But I want 1) to have the possibility to write to the predefined log and 2) I think it is not an option to change the policy on the client computer.


Reureu wrote:
Hi there,

These few lines in your log mean RemoveExistingProducts is skipped:


Now, my questions:

  • Am I right in thinking that your project an InstallScript MSI?
  • Did you change the product code of your new setup?
  • Check in the InstallExecuteSequence: Is there any condition to enable the execution of RemoveExistingProducts?
  • Have you entered any "MSI Command-Line Arguments" in the Release view (under the Setup.exe tab)?
  • Does the problem still occur if you bypass setup.exe and directly launch the MSI package?
  • Can you add the following registry entry, clean your temp folder and try to execute your major upgrade again.
    [CODE]Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer]
    "Logging"="voicewarmupx"[/CODE]This will create an MSI logfile with a random name in your Temp folder. Does the problem still occur?
0 Kudos
Reureu
Level 10

Vladimir wrote:

5. I can not launch the MSI package directly. In my setup type the setup.exe must be launched.

6. When adding the key to the registry the random logs (4 files) are created. When removing the line from MSI Command-Line Arguments (for named log) the problem does not occur. But I want 1) to have the possibility to write to the predefined log and 2) I think it is not an option to change the policy on the client computer.



  • Point 5: You can launch your MSI package directly, but it needs be launched in silent mode from the command prompt if I remember well, for instance with:
    msiexec /i "Blabla.msi" /L*vx C:\Logfile.log /qb+

  • Point 6: I perfectly understand your point, but it was just to check whether the problem was due to the logfile creation itself, or to something else, like the arguments that setup.exe passes to your MSI package.

Now, I have had another look at your logfile. It seems that the previous version gets uninstalled all ok! I didn't check carefully enough the first time.
The deinstallation of the previous version is logged between lines 537 and 1245.

  • Are you sure that you aren't seeing a red herring?
  • Why don't you use the "Create MSI Logs" functionality in the "General Information/General" view? I know it only works with Windows Installer 4.0, but why don't you try, as it seems you are encountering this problem on Windows 7 anyway?
0 Kudos
Vladimir
Level 3

1. I tried with running directly msi package with log parameters. It is upgraded OK, no problems. No previous version left.

2. It is not a red herring :). The line of the previous setup stays in Programs and features. (The corresponding key is not deleted from the Registry).
Here is the picture.


3. I tried logging with Create MSI Logs parameters (MSI 4.0). As I found it created a log with a random name in a %Temp% folder. I could not get the file name, nor could I write my own data to this log. So questions:
a) How to get this log name? I tried the MsiLogFileLocation property but it was empty.
b) How to write my own lines? I tried SprintfMsiLog("Some data.") but nothing was written.
c) IS help states that a check box should appear at the end of the installation allowing to show this MSI 4.0 log. I also could not get it work.
0 Kudos
Reureu
Level 10

You are using 4 fields in the product version number.
Windows Installer will only handle 3 fields. See here:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa370859%28v=vs.85%29.aspx
At least one of the three fields of ProductVersion must change for an upgrade using the Upgrade table.
Try that, and tell me if that works.
0 Kudos
Vladimir
Level 3

I tried using only 3 fields. Unfortunately, it did not work, the result is the same.

Reureu wrote:
You are using 4 fields in the product version number.
Windows Installer will only handle 3 fields. See here:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa370859%28v=vs.85%29.aspx
Try that, and tell me if that works.
0 Kudos
Kelter
Level 10


a) How to get this log name? I tried the MsiLogFileLocation property but it was empty.


I've never had a problem with SprintfMsiLog, but then again, i haven't used the InstallScript MSI project type before either. Also, why do you need the log file name? The SprintfMsiLog function takes care of that for you.
0 Kudos
Reureu
Level 10

I don't know what's going wrong with your InstallScript MSI project.
Just for curiosity, I have tried the same with a dummy project and it worked all fine.

According to your log, the previous version is removed. So you might have to look for issues in the previous setup. Maybe the previous setup is leaving some registry entries behind when deinstalling? Can you do a clean deinstall of the previous version?

Alternatively, post both versions of your project (the old and the new one) in this thread.
0 Kudos