vdms-mark
Posts: 9
Joined: Thu Apr 19, 2018 9:33 pm

Installing Windows Services as non-admin

Fri Sep 14, 2018 4:46 pm

Hello,

I'm working on a project that installs 3-4 Windows services. Each service is separated into its own merge module and is installed using AI's built-in Resources > Services features. If installing the MSI for the first time, it installs fine. If upgrading (we only do major upgrades, where the previous version is first uninstalled):
1. If you right-click the MSI and run as administrator, the upgrade works fine.
2. If you run the MSI normally, at some point in the install process, the user is asked to approve of the install. However, the services do not get upgraded properly. They get put in a disabled state are not removed. I'm guessing this happens when removing the old version of the product. Then, when the install of the new version happens, an error pops up saying the user does not have permissions to install the service.

Any ideas on how to address this are appreciated :)

Thanks

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Installing Windows Services as non-admin

Mon Sep 17, 2018 11:48 am

Hello,

Indeed, the "Service could not be installed. Verify that you have sufficient privileges to install system services." error might be encountered when you try to install a service that is already present on the machine.

Can you please make sure that the actions on uninstall for your service are "Stop" and "Delete"? In order to do this, you can go to "Services" page, click on your service under "Control Operations" and under "Actions", please make sure that the "On Uninstall" actions are "Stop" and "Delete".

Also, can you try to disable "Wait until the service completes" option from under the "Service Parameters" and see if that helps?

Let me know if this is of help! If not, please give me some more details about your scenario.

Kind regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

vdms-mark
Posts: 9
Joined: Thu Apr 19, 2018 9:33 pm

Re: Installing Windows Services as non-admin

Mon Sep 17, 2018 8:17 pm

Hi Catalin, thanks for the input. I had to take a step back, because I noticed another issue, and maybe you have some additional input. One of the services that is installed through the merge module is configured with start type of automatic (delayed). It is also configured with some fail-over actions. I noticed that when installing a service through a merge module, those configurations never take place. The service is installed and started, but it is not configured for delayed start or with fail-over actions.

Are service configurations only supported in a primary project?

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Installing Windows Services as non-admin

Tue Sep 18, 2018 2:03 pm

Hello,

I have tested your scenario and indeed, I can replicate this behavior.

As a workaround, you can proceed as it follows:

1) Open the merge modules project and go to "Table Editor" page ("Custom Behavior" group).

2) Click on "ModuleInstallExecuteSequence" table.

3) Right click --> "New Row" with the following arguments:

-Action: MsiConfigureServices

-Sequence: 5825

-BaseAction:

-After:

-Condition: VersionNT


4) Rebuild the module project.

5) Rebuild your main project which contains the merge module.

6) Install your main project and check in the "Services.msc" to see if your service has the "Startup Type" of "Automatic (Delayed Start)" type.

Let me know if this helps!

Kind regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

vdms-mark
Posts: 9
Joined: Thu Apr 19, 2018 9:33 pm

Re: Installing Windows Services as non-admin

Tue Sep 18, 2018 2:33 pm

Hi Catalin, that worked perfectly for the service configure operations, but not for the service failure operations. Any ideas? Thanks!

vdms-mark
Posts: 9
Joined: Thu Apr 19, 2018 9:33 pm

Re: Installing Windows Services as non-admin

Tue Sep 18, 2018 6:27 pm

Also, moving back to the original issue...
Can you please make sure that the actions on uninstall for your service are "Stop" and "Delete"? In order to do this, you can go to "Services" page, click on your service under "Control Operations" and under "Actions", please make sure that the "On Uninstall" actions are "Stop" and "Delete".

Also, can you try to disable "Wait until the service completes" option from under the "Service Parameters" and see if that helps?
Unfortunately, this does not help. The services are already setup for "Stop" and "Delete", and disabling "Wait until the service completes" option does not help. What I found out since then is that the disabled services are marked for deletion. I'm not sure how to ensure that they get deleted properly. Is it possible to force a restart of the box using a custom action if I detect that the services are not deleted properly?

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Installing Windows Services as non-admin

Thu Sep 20, 2018 3:54 pm

Hello,

I have tested this and indeed, I was able to reproduce this behavior.

It seems like this is a bug in what regards "Merge Modules" and "Services" in Advanced Installer.

Unfortunately, I do not have any workaround for this.

I have forwarded this to the developers team and, as soon as this will be fixed, I will update this thread.

In what regards the deletion of the services, you can check this by pressing Win+R --> "services.msc" and looking for your service.

Thanks for your understanding.

Kind regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Installing Windows Services as non-admin

Wed Jan 09, 2019 2:00 pm

Hello,

This was fixed in version 15.6 of Advanced Installer released on January 8th, 2019.

Kind regards,

Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”