简体   繁体   中英

MSI installation succeeds but services are not installed, MsiExec error in event log

I have an msi installer that installs two windows services. There are no errors during installation on a Windows Server 2016 64-bit machine, the installation succeeds but the services are not installed. I was able to install the services manually using installutil but there are no clues as to why the msi failed to install the services. The installer has worked so far in hundreds of installations. I was able to get the event logs from the machine and the only errors I was able to find are in the Application log are of the kind:

     Faulting application name: MsiExec.exe, version: 5.0.14393.0, time 
     stamp: 0x57899002
     Faulting module name: MSIC9AE.tmp, version: 4.0.30319.33440, time 
     stamp: 0x52004298
     Exception code: 0xc0000005
     Fault offset: 0x000064ff
     Faulting process id: 0x2244
     Faulting application start time: 0x01d3db09c12691f2
     Faulting application path: C:\Windows\syswow64\MsiExec.exe
     Faulting module path: C:\Windows\Installer\MSIC9AE.tmp
     Report Id: c5ffdc35-5ccd-4b00-9d60-1a198848062e
     Faulting package full name: 
     Faulting package-relative application ID: 

Installing again with verbose logging is not an option. Any help is greatly appreciated.

There isn't much information on how you are installing the services, or what tool you are using to generate the MSI and install those services, but I can make some guesses from that log:

It appears that you are using installer class custom actions to install the services. In every case I'm aware of (except Visual Studio setups) this is unnecessary. Windows Installer has built-in support for installing services without running any code. Custom actions (instead of standard built-in functionality) are error prone. The better tools provide support for the ServiceInstall table and the ServiceControl table and that gets you out of the need to run code and the related issues.

That log shows that you are running a 32-bit msiexec.exe process to install services on a 64-bit system. I believe the 32-bit subsystem is optional on Windows Server, but it's not clear if that's an issue because the install apparently succeeds, although installer class failures typically throw an error and completely roll back the install. Are you installing silently? The other issue could be that there is no 32-bit NET FW to run that (apparently) 32-bit custom action. Or there is a NET FW architecture mismatch (you have some NET 2 code attempting to run in the 4.0 runtime). If that error 0xC0000005 is to be trusted, then you have an access violation inside the custom action code - custom actions work by extracting the code from the MSI Binary table into a random name .tmp file and then calling it from an msiexec.exe process, so perhaps the custom action code has lost access to that \\installer folder for some reason. There is also a C++ shim Dll that loads a framework to run the managed code, so there is room for a C++ dependency failure in there as well

The installer class custom action framework is really difficult to debug when it fails because there are plenty of failure points, which is why I pointed out that installer classes can be error-prone as well as unnecessary.

Windows requires different setups for different architectures, so for a 64-bit install it's worth making sure that all the custom action code is explicitly built for 64-bit, if the issue is cross-architecture related.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM