aho
Posts: 58
Joined: Thu Jul 21, 2016 4:38 pm

Error when Setup tries to install service which already exists

Hi,
my setup wizard should install a windows service. This basically works, but I have troubles when the service is already installed.

The error message is:
Service 'myService' (myService.exe) could not be installed. Verify that you have sufficient privileges to install system services.

Followed by another error message:
Service '' (myService.exe) could not be configured. This could be a problem with the package or your permissions. Verify that you have sufficient privileges to configure system services.

Those two error messages are followed by a rollback of the setup.

My questions:
  • What can I do to avoid the rollback?
  • Is there a possibility to hide both error messages?
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Error when Setup tries to install service which already exists

Hello,

To achieve what you want you can use our "Detect service" predefined custom action. The custom action must be scheduled before "Install Execution Stage" -> "Paths Resolution" actions group.

Then, you should just condition the installation of your service component using the "AI_SERVICE_STATE" property. Go to "Services" page, right click on your service item and then choose "Go To Component" context menu option. Then, on the selected component from "Organization" page add the following condition:

Code: Select all

AI_SERVICE_STATE="Not Found"
If you have any questions let us know.

All the best,
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
aho
Posts: 58
Joined: Thu Jul 21, 2016 4:38 pm

Re: Error when Setup tries to install service which already exists

Thanks! It seems to work now!
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Error when Setup tries to install service which already exists

You are always welcome.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
aho
Posts: 58
Joined: Thu Jul 21, 2016 4:38 pm

Re: Error when Setup tries to install service which already exists

Hi,
in some cases I still get the error message:
Product: ProductName --Error 1939. Service 'ServiceName' '(ProcessName.exe) could not be configured. This could be a problem with the package or your permissions. Verify that you habe sufficent pricileges to configure system services
The difference is that before the log above occurs, I get also the following log message.
Error: 1072. Failed to change current configuration of service ProcessName.exe with ConfigType SERVICE_CONFIG_PRESHUTDOWN_INFO
I did not get this log when I investigated this issue the previous time (when i started this thread).

I have MSI-Logs from two incidents.
  • In both cases, "Remove older versions" (instead of "side by side installation") was selected.
  • In both cases, the DetectService action sets the AI_SERVICE_STATE property to 'Not Found' in both cases.
  • In both cases, a rollback was done.
  • From at least one incident I know, that setup worked as expected, when it was run a second time.
My questions:
  • Do you have an idea, why this is happening?
  • Is there something i can check in the logs?
  • At least I need to prevent the rollback. I could live with a failed service installation, but a rollback is not OK.

Thanks in advance!
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Error when Setup tries to install service which already exists

Hi,

I am afraid I am not aware of any scenario when those issues could be triggered.

The only way I can further investigate on this will be so you can isolate the behavior into a sample or stet by step test case and share them with me so I can fully test and investigate this on my side.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”