Alex Rivera | Logout

Running msiexec from a service (Local System account)

Asked 2010-04-08T22:48:13.733
14

We are working on an update system for our software. The updater should run in the background as a service, and when an update is available, download and install it. We need the service to install the update since the MSI requires elevation to run, but some of our clients will be restricted users.

The MSI is a WiX MSI and does a major upgrade when run. The problem is, the update does not seem to work when run from our service. I can see msiexec run, and it returns successfully, but it seems to make no changes to the system. The same command, when run from my user account works as expected.

Is there some caveat to running msiexec from a Local System service?

We are simply doing:

string arguments = "/i /quiet /lv*x " + pathToLogFile;   
System.Diagnostics.Process.Start("msiexec.exe", arguments);
Edit
Report

1 Answer

2

You may need to use the REINSTALLMODE parameter that allows you to control the upgrade. If they are not provided, the installation may silently fail to upgrade your app (or at least that's what I've found, though I'm still a little unsure whether the same behaviour applies under System.Diagnostics.Process.Start):

msiexec.exe /i /quiet yourinstaller.msi REINSTALL=All REINSTALLMODE=vomus

See here for more info on the various flags that you can pass to msiexec.exe.

answered 2010-08-24T02:49:06.130

Your Answer