TopShelf and WiX not working together

810 views
Skip to first unread message

Natan

unread,
Nov 2, 2011, 1:39:29 PM11/2/11
to topshelf-discuss
Hi,

I'm using TopShelf for service installation code.
It worked great.

Now I want to install my service automatically when I install the
software using Wix installer.

For some reason I am unable to finish the service installation, and
the service is unable to run afterwards.
In the Event viewer I get the following messages:
1. A timeout was reached (30000 milliseconds) while waiting for the
[Service Display Name] service to connect.
2. The [Service Display Name] service failed to start due to the
following error:
The service did not respond to the start or control request in a
timely fashion.

In this blog post: http://www.gbogea.com/2011/10/19/installing-a-topshelf-service-using-wix
It was suggested to add "an installer class derived from
System.Configuration.Install.Installer"
I tried it but it didn't help.

Any thoughts?

Dru Sellers

unread,
Nov 2, 2011, 10:39:28 PM11/2/11
to topshelf...@googlegroups.com
Ok, so I know crap about WiX, but tell me how WiX is interacting with TS, maybe I can help. 

-d

Chris Patterson

unread,
Nov 2, 2011, 11:58:43 PM11/2/11
to topshelf...@googlegroups.com
I'm guessing it didn't installed properly based on how the TOpshelf command-line installs it.

You can compare the registry values between WIX and Topshelf and see if something is not being set correctly. The are ImagePath changes and such that are setup by Topshelf that may not be getting set by WIX (which is just a way to make an MSI).

Natan

unread,
Nov 3, 2011, 2:03:45 PM11/3/11
to topshelf-discuss
Chris, Thank you very much for your quick reply.

I'll looked at what registry values TopShelf changes on install, and
indeed it is ImagePath. It adds the args passed to the execution path
string.

I've changed the registry keys after a wix installation to be exactly
like the ones when TopShelf installs.
Unfortunately the service still wasn't able to run with the same error
as I mentioned before.

Any other idea you may have?

Dru, If I knew how WiX interacts with TS (more than that Installer
class) I probably would have found the problem :-)

Dru Sellers

unread,
Nov 3, 2011, 2:15:18 PM11/3/11
to topshelf...@googlegroups.com
can you have WiX just call the command line?
-d

Chris Patterson

unread,
Nov 3, 2011, 7:28:46 PM11/3/11
to topshelf...@googlegroups.com
When running as a service, it's not running as a user account by default. Is the WIX install setting up the user account permissions properly?

Let me ask again, cause I forgot, but if you use the Topshelf command-line to install the service it works correctly?

Natan

unread,
Nov 4, 2011, 3:11:11 AM11/4/11
to topshelf-discuss
Yes, you do have custom action in Wix that can execute commands.
That is exactly what we have done very recently to bypass this
problem.

The problem with custom actions is that they are unpredictable much
more customizable and nondetrministic. For instance When repairing an
installation, should the service be uninstalled or not, it is all up
to you to configure.
> > > > Any thoughts?- Hide quoted text -
>
> - Show quoted text -

Dru Sellers

unread,
Nov 4, 2011, 11:59:44 AM11/4/11
to topshelf...@googlegroups.com
Doesn't seem like a bad thing. What do you want it to do on uninstall??

-d
Reply all
Reply to author
Forward
0 new messages