Service Installation: Batch files are not run as services (normally), but in some cases they are used to install service files in EXE format. Typically this is done by developers during development, or for manual installation of services on a limited amount of computers. Some people also use scheduled tasks to run batch files such as these on system startup. Not an approach I would recommend.
For larger scale distributions you use a proper package for deployment. MSI is one such format. When you use MSI you are not supposed to install services with batch files. Rather you should register and configure the service via the appropriate MSI tables to take advantage of the built-in service configuration capabilities. Essentially you author the ServiceInstall and InstallControl tables to install and control the service in question respectively.
Using this built-in approach is much more reliable than using a custom action. Some context on why custom actions should only be used when needed: Why is it a good idea to limit the use of custom actions in my WiX / MSI setups?
Use the appropriate MSI features for service configuration and control and you will have a much esier time upgrading and maintaining your package.
Installshield Procedure:
Service installation batch files are often intimidating to look at, but when you analyze them they might not actually do much. In some cases huge chunks of them relate to parsing a command line and deal with error conditions.
It is usually possible to extract the information required from these scripts - and it tends to center around finding if there are any login credentials for the service, and to replicate the install of all files the batch file copies in place inside the MSI - so the MSI entirely replaces the BAT file as deployment solution.
- Open your batch file in an editor and locate the EXE file it installs.
- This EXE file will be the real Windows service file. There could be several versions - such as 32-bit and 64-bit flavors.
- Add the appropriate EXE file to your MSI file / Installshield project.
- Add any support files the service needs to run. You can analyze this with dependency walkers and process monitors if problems are seen.
- I don't have a recent version of Installshield available to test with. In older versions you opened the component view and located the component with the service in it. You opened it and went to Advanced Settings and configured the Install NT Services and the Control NT Services entries.
- You can set several settings for the service, including startup type (automatic, for example) and login credentials (if any are required).
- You mention that your Installshield version has the view
System Configuration => Service
. Use this view after you have added the service EXE file via the Files or Component views.
- I normally set a service to start and stop during install and to stop and delete on uninstall.
If the service requires credentials to run you need to extract that information from the BAT file and add as properties to the service control items.