Posts: 3
Joined: Mon Mar 20, 2017 6:56 pm

Optional Window Service

Wed Apr 14, 2021 2:03 pm

I am trying to add a Window Service to the installer but I want it to be optional based on a UI checkbox. I have created a checkbox and added the window service to the installer. The only thing that I am having trouble with it getting the window service to only install if the checkbox is checked. Is there a way to do this? If not, can a window service be optional in any way?

Posts: 4086
Joined: Wed Jun 13, 2018 7:49 am

Re: Optional Window Service

Wed Apr 14, 2021 6:05 pm


In order to achieve that, you can condition the installation of the component assigned to the executable that you create a service for.

Let's consider the following checkbox control:
checkbox.png (168.26 KiB) Viewed 228 times

We can see that the checkbox has a property assigned to it that stores its' state and, when the checkbox is checked, the property's value is "CheckBox".

If you want to condition the installation of your service, please go to "Organization" page, select the component assigned to your executable and use the "Condition" field:
organization.png (44.9 KiB) Viewed 228 times

This way, your service will only be installed & configured if the checkbox is checked.

Hope this helps!

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

Return to “Building Installers”