5
votes

I have made a change to a custom action in my msi file to not attempt to stop a windows service if the service is stopped or stop pending. However, after re-caching the msi using msiexec /fv mymsi.msi, when running the major upgrade to the next version (which also has the corrected service stopping custom action) the verbose logging is showing that the old custom action code is still being run even though the cached msi was updated. I even ran a binary comparison of the cached msi against the one that was used in the re-caching.

What am I doing wrong here.

2
Try msiexec /I foo.msi REINSTALL=ALL REINSTALLMODE=vomus - Christopher Painter
Why do you have a custom action to stop a service? That's what the ServiceControl element / table is for. - Christopher Painter
I will try the msiexec /i reinstall=all reinstallmode=vomus. I have not played with the ServiceControl Element. - user1990900
I have one service that I create, start, stop, and remove. I also have another that I just start and stop (it is created and removed by a third party batch file). - user1990900
Have you got a hard coded package GUID in your source file? - Stein Åsmul

2 Answers

5
votes

If the old custom action is still running it means one of two things:

  1. The new MSI logic is not correct and is still running the custom action.

  2. The recache/reinstall did not work.

To re-cache/reinstall make sure your MSI is basically identical (same ProductCode/Upgradecode etc) to the old MSI except with the updated custom action. Then do:

msiexec /fv new.msi /l*v log.txt

That will overwrite the old MSI and do a repair using the new MSI (and give you a log file in case anything goes wrong).

2
votes

In my case it was a cached copy of my MSI in %windir%\Installer and corresponding keys in the system registry (found them by GUID in HKLM and HKCR).