007coder
007coder

Reputation: 161

Wix re-install msi with windows service fails randomly

We have a msi package which installs a Windows Service. At end-of-day, the windows service downloads a new msi package from a public blob location and kick off reinstalls.

The reinstall command =

msiexec /i GatewayService.msi /qn REINSTALL=ALL REINSTALLMODE=vamus /L*V msi.log

What we want is as follows:

  1. This should reinstall the whole msi package again w/o any check on any conditions
  2. Whatever files are in the new msi should be copied to installed dir and files not in the new msi should be trashed.

So essentially what we want is like UNINSTALL old msi and RE-INSTALL new MSI in one command.

We were wondering

  1. if the REINSTALL/REINSTALLMODE flags value are correct ?
  2. Sometimes we see an orphaned Windows Service in TaskManager. Any idea why the re-install command resulted in 2 instance of Window Service?

Suggestions would be grateful!

Upvotes: 0

Views: 136

Answers (2)

PhilDW
PhilDW

Reputation: 20780

You produced a log - take a look and see if there are any mesasges about removal of components being unsupported. Also set MSIENFORCEUPGRADECOMPONENTRULES=1 on the command line and the install will fail if you broke a minor update rule. If it does fail, then the author of that MSI is breaking update rules and Chris' advice to do a major upgrade is required and not optional!

The services may not have ServiceControl actions to stop and start them, so they'll just keep running over the update because nothing is telling them to stop. This can be complicated by in-use files requiring updates because your silent install has no file-in-use dialog to prompt to shut down processes.

You can get an apparently orphaned service process if the service shuts down (the process ceases to be a service) but the containing process is still running. That might be normal if the service responds to the shutdown but continues afterwards for some time, that depends on the code in the service.

Upvotes: 1

Christopher Painter
Christopher Painter

Reputation: 55581

Your commandline indicates that you are doing a minor upgrade. Your requirements indicate a major upgrade would be more suitable for you.

How To: Implement a Major Upgrade In Your Installer

Minor upgrades are very picky and breaking rules are likely causing your duplicate service problems. See:

Changing the Product Code

Upvotes: 0

Related Questions