[wix-users] Custom Action Issue

Ven H venh.123 at gmail.com
Tue May 29 02:45:43 PDT 2018


I am building an MSI with a UI screen which captures a user name and
password to create a login in SQL. The DB server name is captured in one of
the previous screens and mapped to a property. When the user clicks on Next
button, a Custom Action is called. In this CA, the following things take
place.

A SQL statement is called to create the login, either in local / remote SQL
server.
ServiceController.GetServices (found in System.ServiceProcess.dll) method
is called to get all the services from the local / remote SQL Server
machine. Since the ServiceController instance doesn't provide the path of
the executable behind the service, I am making some registry calls (either
to local / SQL Server machine) to get the exact instance of the SQL Server
service running on the machine and then call Stop and Start methods to
restart the service from the CA code. You may argue this is bad, but
unfortunately, this is a requirement.

This CA is called on the Next button click, as mentioned earlier. There are
enough session.Log calls and I am trying to log each and every step. This
is built using .Net v4.0 (I tried with v4.6.1 also). I am using VS 2017 and
Windows 7 machine to build it.

1. Now, while testing by executing the MSI from within my local Windows 7
machine, I try to select a remote SQL machine (Win 2012 R2 Std server) and
it sucessfully adds the login and restarts the SQL service.

2. But when I try to execute the MSI from within the Windows 2012 R2 Std
server and select the same machine as the DB server, the CA fails.
Unfortunately, the log doesn't show any of my messages. However, there is a
line which says something like "Invoking remote custom action...". Looks
like the error number is 2896. I didn't get much from internet on this
error (except one slightly helpful link below. Things look fine as per that
link). However, while executing the MSI from the msiexec command in
PowerShell console as admin from the Windows 2012 machine, it runs
successfully. But here also, my log messages are not there in the logs. The
CA has no Impersonate attribute also.

https://siderite.blogspot.com/2010/07/msi-custom-action-error-2896-on-windows.html#at1688490813

I am not sure what is wrong. Why the log messages are not at all getting
logged into the MSI log file? Why does scenario 1 work whereas 2 doesn't.

Can anyone please help?


More information about the wix-users mailing list