kissack
Posts: 57
Joined: Fri Feb 04, 2011 11:45 am

Conditionally install windows service based on non UI property

Hello,

this topic has been answered in the forum previously, but I have a bit more complexity to it:

* the appication is multiple instance
* we allow upgrades

There must be only one instance of the service installed, no matter how many instances.

My strategy is to do a powershell search to see if there is already a service with given name. It sets AI property to true/false

Then on organization page I use that property to install or not the service based on the condition.



I install 1st instance of the application, it installs the service.
I install 2nd instance of the application, it does not install the service

So far, so good.

I want to do upgrade of the first instance of the application, and it fails. Can't tell why.

I was trying to move the powershell custom action to different position within the sequence, after RemoveExistingProducts, so it would see, that the service is not installed (after upgrade did first uninstall) and in theory should install it. However this installs the service for both instances of the application, so it does not work for initial install (not ugprade) scenario.

Any idea what would be the correct approach ?

Appreciate if you can point me in the right direction.

Thank you.
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Conditionally install windows service based on non UI property

Hi,
I want to do upgrade of the first instance of the application, and it fails. Can't tell why.
Can you please send us a screenshot with the error and a verbose log of the installation to support at advancedinstaller dot com, so we can investigate them?
I was trying to move the powershell custom action to different position within the sequence, after RemoveExistingProducts, so it would see, that the service is not installed (after upgrade did first uninstall) and in theory should install it. However this installs the service for both instances of the application, so it does not work for initial install (not ugprade) scenario.
In order to have a better view about this, please send us the project file and also a verbose log related to this scenario.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kissack
Posts: 57
Joined: Fri Feb 04, 2011 11:45 am

Re: Conditionally install windows service based on non UI property

Hello,

thank you for your reply. I think I have solved the problem. The error was unrelated to what I was trying to do. So I was able to get past that.

Now I can install service conditionally, just one thing left is to uninstall it only when uninstalling the last instance. I am optimistic about that. So for now we can consider this as solved. Thank you and sorry for the long time before my reply.
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Conditionally install windows service based on non UI property

You're welcome. I'm glad you solved the problem.

If you have other questions, just let us know.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”