cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
bme
Level 4

VS2013: ISLE: How to name your service anything but Service1?

How do I name my service anything else than Service1?

Let me explain:

I have created a windows service from scratch in VS2013. I have renamed the Service1 class to MonService and even renamed the file from Service1 to MonService. Everywhere have I done that. I even managed to make a ISLE setup project that registered this service upon install so it appears with the correct name in the Services window. Everything looks fine UNTIL I start my service in which case windows event viewer claims Service1 has started!?!?!

How do I fix this problem?

I have searched all files for "Service1" but none have been found. Even after installation, Service1 is not mentioned anywhere (in clear text) in any file nor in the registry.

Why is it then that the service, when installed by ISLE, is called Service1 upon startup (and shutdown) whereas the old microsoft installer would call this service by the name chosen (MonService)?

How do I fix this problem? Can I even fix it? I currently work under the assumption that this is an error in Flexera's software (ISLE) that I cannot work around, but it seriously annoys me and has costs me many hours to solve (in vain I might add).

Is this the expected quality of Flexera's software?
0 Kudos
(11) Replies
hidenori
Level 17

If you are using the Installer Class to install your service, make sure that you configure your .NET Windows service application correctly to get the service registered as expected. In order to change the name of your service, you need to set the ServiceName property. See the How to: Create Windows Services and How to: Add Installers to Your Service Application Microsoft help topics for more information.

If you are using the Services view to install your service, you can change the name of your service by changing the name of the service node. If you set the Start on Install setting to Yes, Windows Installer will start your service automatically during installation.



Hope that helps.
0 Kudos
bme
Level 4

Thank you for taking your time to try to help me, but your suggestions did not help. I already have named my service MonService using the ServiceName property in ProjectInstaller.cs->serviceInstaller1. I have successfully built 6 other services that are named correctly when installed using Microsofts old setup project. It just doesn't work with ISLE. The ServiceName property seems to be ignored.
0 Kudos
bme
Level 4

I did find another place where I forgot to set ServiceName (has to be set quite a few places) but once I did that, the installer always fails with error 1001 (i.e. during install). And as error 1001 is the most common error, it is of course not explained anywhere.

How do I analyse this problem any further?

Can anyone please provide a skeleton Windows Service project created in VS2013 with .NET 4.5 including a working ISLE installer, that when installed and started, does NOT use the service name Service1 nor does rely on the service class being called Service1?
0 Kudos
bme
Level 4

The error as logged in the Windows Event log:

The description for Event ID 11001 from source MsiInstaller cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event:

Product: MonService -- Error 1001.
(NULL)
(NULL)
(NULL)
(NULL)
(NULL)

the message resource is present but the message is not found in the string/message table



It occurs twice, once during install and once during rollback of the install.
0 Kudos
bme
Level 4

I have investigated a bit more. I enabled MSI install log and got a huge log file. This is a short extract of the lines just before and after the error:

MSI (s) (F8:10) [14:44:33:283]: Creating MSIHANDLE (24) of type 790536 for thread 18192
MSI (s) (F8:14) [14:44:33:284]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI57C4.tmp, Entrypoint: ManagedInstall
MSI (s) (F8:08) [14:44:33:284]: Generating random cookie.
MSI (s) (F8:08) [14:44:33:287]: Created Custom Action Server with PID 10532 (0x2924).
MSI (s) (F8:3C) [14:44:33:318]: Running as a service.
MSI (s) (F8:3C) [14:44:33:319]: Hello, I'm your 32bit Elevated custom action server.
MSI (s) (F8!CC) [14:44:33:597]: Creating MSIHANDLE (25) of type 790531 for thread 10956
Error 1001.
MSI (s) (F8!CC) [14:44:37:156]:
MSI (s) (F8:14) [14:44:37:157]: Leaked MSIHANDLE (25) of type 790531 for thread 10956
MSI (s) (F8:14) [14:44:37:157]: Note: 1: 2769 2: _CD211F54BBAE331F5EBCBFBB104809B0.install 3: 1
Info 2769. Custom Action _CD211F54BBAE331F5EBCBFBB104809B0.install did not close 1 MSIHANDLEs.
CustomAction _CD211F54BBAE331F5EBCBFBB104809B0.install returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
MSI (s) (F8:14) [14:44:37:161]: Closing MSIHANDLE (24) of type 790536 for thread 18192
Action ended 14:44:37: InstallFinalize. Return value 3.

So, while I as a user see error 1001, a different error is noted in the log file and that error code is 1603. According to the isl file, this maps to IDS_ERROR_66 which has this to say:

The file [2][3] is being held in use{ by the following process: Name: [4], ID: [5], Window Title: [6]}. Close that application and retry.

I have no idea which file is being references or why. The installation folder doesn't even exist upon installation start.
0 Kudos
bme
Level 4

Seeing as error 1001 means error in custom action and that is supplied by Flexera so I guess Flexera has to help me out here.
0 Kudos
bme
Level 4

Is there any free installer/setup project type for Visual Studio 2013 that works well with services?
0 Kudos
hidenori
Level 17

Installer classes are fragile and generally not recommended. If you have trouble installing your services via Installer classes, you might want to try using the native Windows Installer’s capability (ServiceInstall and ServiceControl tables) which can be configured through the Services view of InstallShield.
0 Kudos
bme
Level 4

I don't even use Installer Classes (at least not consciously). I just want my binary to be installed and registered correctly in the registry so when it is started, it is NOT called Service1.
0 Kudos
hidenori
Level 17

Please make sure that the Installer Class check box is not selected for your service application file. See this blog post on how to access to the Installer Class setting.
0 Kudos
bme
Level 4

Yes, that worked (took so long because I had other things to do). Apparently InstallShield is hardcoded to use the Service1 installer class. You should really make this clear in the tool that you have this requirement.

Now my problem is that InstallShield leaves out a dll file from the installation. The dll was added (with nuget) to the service after I created the ISLE project, but in ISLE I have already added the Primary output to the Files section. Why isn't the dll included? Another dll file added with nuget prior to creating the ILSE project is included in the msi file, though. The log has this to say:

Adding file 'Common.Logging.dll' that is a dependency of component 'MonService.Primary_output'
Adding file 'log4net.dll' that is a dependency of component 'MonService.Primary_output'

But Quartz.dll is not included and my service cannot start because of that.

Also, the log always says this:

ISEXP : warning -6245: One or more of the project's components contain .NET properties that require the .NET Framework. It is recommended that the release include the .NET Framework.

But in the Requirements section, .NET 4.5 Full Package is ticked. If that isn't enough, what is?
0 Kudos