Context:
We're developing a windows service that runs as Local System Account. One of its features is to detect a new version and perform a self-update by launching msiexec.exe /i file.msi /qn
.
We expected the service would be updated and restart with the new version. But, what we observe is the installation finishes with "MainEngineThread is returning 1603".
We've read https://learn.microsoft.com/en-us/troubleshoot/windows-server/application-management/msi-installation-error-1603, and after analyzing the possible causes, we concluded:
- Windows Installer is attempting to install an app that is already installed on your PC. But, it is a new version. So, there should not be a problem.
- The folder that you are trying to install the Windows Installer package is NOT encrypted.
- The drive that contains the folder that you are trying to install the Windows Installer package to is NOT accessed as a substitute drive.
- The SYSTEM account HAS Full Control permissions on the folder that you are trying to install the Windows Installer package to. You notice the error message because the Windows Installer service uses the SYSTEM account to install software.
Questions:
- The current solution of self-update a windows service by calling
msiexec.exe
from the service or a child process possible? What are we missing? - If the current solution is not possible, what would be the solution for a windows service to perform a self-update?