0

I have a windows service that installs itself by executing it in a cmd with the command line --install. This service also knows how uninstall itself by passing the --uninstall param in a cmd.

I need to create a MSI installer that installs this service and start it. I have tried by using Components in Installshield and using Custom Actions but not getting the rights results either way.

I need some help here. Thanks

yosbel
  • 1,711
  • 4
  • 20
  • 32

1 Answers1

0

Please see my answer under Wix installer to replace INSTSRV and SRVANY for user defined service installation

The WiX ServiceInstall and ServiceControl elements are abstractions for the underlying Windows Installer ServiceInstall and ServiceControl tables. InstallShield uses this same feature but instead of authored as XML it's authored in the components view under the advanced settings | services area of the component.

In general it's not a windows installer best practice to call a custom action to register the service. Instead figure out the details being done by the --install command and author them natively into these tables using InstallShield.

Installing, Controlling, and Configuring Windows Services

Community
  • 1
  • 1
Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
  • So, definitely I can't rewrite my application code, so I need to create a Custom Action that execute the service executable with the --install param during installation and the --uninstall param during uninstall. The question remains exactly, how I can do it? – yosbel Jan 22 '15 at 18:57
  • 1
    You don't need to rewrite the application code, you just don't call the --install --uninstall routines. You just dissect what they are doing and author them in InstallShield per Windows Installer best practices. The question that you are asking is the wrong question. – Christopher Painter Jan 22 '15 at 19:03
  • I did what you told and seems the right way. I'm only having some problems starting the service once installed, but it is the correct way. – yosbel Feb 06 '15 at 16:07
  • Sometimes I'll set the installer up to not start it during the install until this gets worked out. You just have to profile the service to figure out what's missing and fix it. – Christopher Painter Feb 06 '15 at 20:29