rtischer8277
Posts: 22
Joined: Fri Nov 30, 2012 2:26 pm

installing a service freezes halfway

I have a simple Advanced Installer program that includes installing a service. The dialog screen 'Installing servces' freezes and I have to cancel the install.

One of the last tasks I have in evaluating Advanced Installer is to make sure it can (I'm sure it can) and that I know how to install a service. My platform is Win8 desktop and I am using Visual Studio 12. As a test service, I used the service program called 'A basic Windows serv1' which produces the CppWindowsService.exe file. This service is a sample program found in VS12's sample code. This sample service program command-line installs when run with argument -install and uninstalls with argument -remove.

Here is a shot of the frozen service dialog: 'Hiveware frozen service install.png'.
Also attached is the .aip file: 'Hiveware debug.aip'.
Also attached is the verbose log file: ''.

Please advise.
Attachments
Hiveware debug 2.0.0.log
(282.08 KiB) Downloaded 599 times
Hiveware debug.aip
(19.03 KiB) Downloaded 546 times
Hiveware frozen service install.png
Hiveware frozen service install.png (18.97 KiB) Viewed 10655 times
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: installing a service freezes halfway

Hello and welcome to Advanced Installer forums,

Thank you for your interest in Advanced Installer.

I'm not sure why you are encountering this behavior. It seems the related service cannot be started. Can you please try to manually install and start the service on the target machine? If the service fails to start manually then obviously it cannot start from the installer. If this is the case, then you should contact the service's author support for this compatibility issue.

Also, you can take a look on our "Verify that you have sufficient privileges to start service" thread which debates a similar issue.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rtischer8277
Posts: 22
Joined: Fri Nov 30, 2012 2:26 pm

Re: installing a service freezes halfway

Thank you for your response, Daniel.
I chose the sample service program from Visual Studio in order to eliminate server problems during my testing and focus on AI functionality or problems. I downloaded and tested the CppWindowsService program on my PC and it works exactly like the MSDN output description that accompanies the sample project. Instead of me making a lot of screen shots, here is the link in MSDN that describes the sample service's behavior: http://code.msdn.microsoft.com/windowsd ... e-cacf4948 .

By the way, in the verbose log file I attached in my original posting, at the bottom it reported an error status of 1603.

Regarding the Insufficient Privileges suggestion, I ran the .msi file on this my development machine, that created it, and it installed without a problem. But when I transferred the .msi file to the target PC, I get the error. Here is the screen shot of it running on my source PC:
Attachments
CppWindowsService running.png
CppWindowsService running.png (37.3 KiB) Viewed 10648 times
rtischer8277
Posts: 22
Joined: Fri Nov 30, 2012 2:26 pm

Re: installing a service freezes halfway

Here is more info on the freezing service. From the log file:

MSI (s) (F8:C8) [14:32:39:426]: Executing op: ServiceInstall(Name=CppWindowsService,DisplayName=CppWindowsService,ImagePath=C:\Hiveware\Windows\bin\CppWindowsService.exe -install,ServiceType=16,StartType=2,ErrorControl=1,,Dependencies=[~],,,Password=**********,Description=Your Service Description,,)
InstallServices: Service:
MSI (s) (F8:C8) [14:32:39:442]: Executing op: ActionStart(Name=StartServices,Description=Starting services,Template=Service: [1])
Action 14:32:39: StartServices. Starting services
MSI (s) (F8:C8) [14:32:39:442]: Executing op: ProgressTotal(Total=1,Type=1,ByteEquivalent=1300000)
MSI (s) (F8:C8) [14:32:39:442]: Executing op: ServiceControl(,Name=CppWindowsService,Action=1,Wait=0,)
StartServices: Service: CppWindowsService

On the target machine the call to CppWindowsService.exe -install installs the service correctly, but when the last line is executed, that is, ServiceControl StartServices, progress freezes. When executed on the command-line of the target machine, the service installs and removes correctly and also starts and stops from the Services applet. Any ideas as to why this is happening?
Attachments
CppWindowsServices runs on target machine if started manually.png
CppWindowsServices runs on target machine if started manually.png (9.86 KiB) Viewed 10627 times
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: installing a service freezes halfway

Hello,

This may happens because your installation type is per user. Can you please set the "Installation Type" field, from "Install Parameters" page, to "Per-machine only (fails if user is not administrator)" and see if the behavior still persist?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rtischer8277
Posts: 22
Joined: Fri Nov 30, 2012 2:26 pm

Re: installing a service freezes halfway

No change. Here is the log where it fails, which is the same for per-user and per-machine:

MSI (s) (B4:F0) [07:45:48:002]: Executing op: ServiceControl(,Name=CppWindowsService,Action=1,Wait=0,)
MSI (s) (B4:F0) [07:49:51:261]: Product: Hiveware debug from Visual Studio -- Error 1920. Service 'CppWindowsService' (CppWindowsService) failed to start. Verify that you have sufficient privileges to start system services.
Action ended 7:49:53: InstallExecute. Return value 3.

What does Return value 3 refer to? The User Guide does not provide error codes. Is it GetLastError()? If so, then 3 would mean ERROR_PATH_NOT_FOUND which can't be true since the CppWindowsService.exe was executed on the target machine. What is ServiceControl? Is it a call to the Windows function ControlService? (just guessing here) Then the return SERVICE_STATUS code 3 doesn't make sense. And so on and so on.

Your logs are filled with references to types and return values. Could you please make available a directory so that I can look them up? This would give me a fighting chance for figuring this out (for your company, free!). Let's start with ServiceControl. To what function is that precisely referring to so I can look that up.
rtischer8277
Posts: 22
Joined: Fri Nov 30, 2012 2:26 pm

Re: installing a service freezes halfway

After researching the system event logs, it looks like AI is not giving the msiexec sufficient privileges to create and run my service. Here is my setup.

In my .aip I set the Installation Type to Per-user-only (with administrator rights only) which should be sufficient to run my service exe in some user mode and not SYSTEM mode.

Here are the shots that show the privilege disparity. A shot of my service being run at the wrong level can be seen in 'msiinstall error 3.png'. A shot of the msiexec privilege level at a lower level, which causes the security error, can be seen in 'msiinstall error 2.png'.

In shot 'msiinstall error.png', the service is actually being installed without problem, but its Service Account, LocalSystem, is suspiciously high. I would think that the AI per-user Installation Type would set it to a lower privilege.

Please advise as to whether AI agrees with this analysis and if so what the plans are for fixing it.
Attachments
MsiInstall error.png
MsiInstall error.png (37.64 KiB) Viewed 10586 times
MsiInstall error 3.png
MsiInstall error 3.png (55.29 KiB) Viewed 10586 times
MsiInstall error 2.png
MsiInstall error 2.png (54.76 KiB) Viewed 10586 times
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: installing a service freezes halfway

Hi,

I just downloaded the sample service and tested it (manual install and automatic using the install package).

As you can see the attached project file installs and starts the service correctly. Please note that I used the "Release" build of the service to test it. Can you try the sample on your machines? Advanced Installer 9.8 was used to create this setup.

Also, when I manually installed the service (on Win 8 and Win 7), with the command line "-install", it installed with a password and username and failed to start. I had to manually change that setting from "Services.msc" so I can start it.

Regards,
Bogdan
Attachments
ServiceResources.zip
Contains MSI file, service binary(release build) and aip file.
(124.73 KiB) Downloaded 503 times
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rtischer8277
Posts: 22
Joined: Fri Nov 30, 2012 2:26 pm

Re: installing a service freezes halfway

Your attached AI installer project using the same test CppWindowsService.exe as I did, installed and unintalled without error.

In order to determine what the difference was between your and my .aip files, I began a new install project using your working .aip file. I step by step added in my functionality. The project never failed and is working now. About the only difference I see between my new install project and my old one that doesn't work is, in my .aip I had eliminated a number of dialogs, whereas your project had the full complement of dialogs. The important thing is that it works now.

I have attached my old Hiveware (service install freezes).msi file, so you can run it on your machine and tell me what the problem was. (was unable to upload .msi file. will try again later)
rtischer8277
Posts: 22
Joined: Fri Nov 30, 2012 2:26 pm

Re: installing a service freezes halfway

Here is a link to the misbehaving .msi file:
https://skydrive.live.com/redir?resid=B ... sf1nquDAuc

Return to “Common Problems”