GovardhanaReddy
Posts: 12
Joined: Mon Oct 28, 2013 10:43 am

Custom Features Installation Through Command Prompt

Hi,

We were able to install full and typical features of our product through command line installation by providing respective values to INSTALLLEVEL property and which was fine. In our application we are having around 10 features and based on the customer needs they will install their respective feature. This can be achieved through normal Installation with UI(where all the features will be showed in a custom dialogue). But how to achieve the same through command line installation(means how to specify a particular feature needs to be installed).

Thanks for your support
Last edited by GovardhanaReddy on Fri Feb 14, 2014 7:09 am, edited 1 time in total.
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Custom Features Installation Through Command Prompt

Hi,

Indeed, you can condition the installation of a feature through the Installation behavior from the Feature Properties. Every feature has an attached integer number which represents the feature's "Install level". This install level is compared with the user-selected application install level and it dictates if the feature should be installed or not. There are three well known install levels values: 0 (Disabled), 1 (Typical) and 4 (Complete).

Also, feature installation behavior can be changed at install-time using Install-time Conditions. Use the [ Add Install-time Conditions ] to display available options.

I’ve attached a zip file that contains a sample which implements this scenario. In my installation package there are 4 features:
MainFeature - installed by default
Feature_A - installed by default
Feature_B - installed only in Complete installation ( INSTALLLEVEL=4 )
Feature_C - which will be installed based on a condition ( FEATURE_C_INSTALL="true" )
So, the Feature_C will be installed only if the FEATURE_C_INSTALL="true" statement will be passed through command line.
e.g.
msiexec.exe /i <path_to_package> FEATURE_C_INSTALL="true"

If you want to install all features you can use a command line statement like that:
msiexec.exe /i <path_to_package> FEATURE_C_INSTALL="true" INSTALLLEVEL=4

Please let me know if there is anything else I can help with.

Best regards,
Dan
Attachments
Custom Features Installation Through Command Prompt.zip
(3.63 KiB) Downloaded 755 times
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
GovardhanaReddy
Posts: 12
Joined: Mon Oct 28, 2013 10:43 am

Re: Custom Features Installation Through Command Prompt

Dan,

Thanks for your sample. Now we can able to install feature wise as well.

Thanks for your support
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Custom Features Installation Through Command Prompt

You're welcome.

If you have other questions, please let us.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
GovardhanaReddy
Posts: 12
Joined: Mon Oct 28, 2013 10:43 am

Re: Custom Features Installation Through Command Prompt

Dan,

In the sample which you attached above, Feature_C will be installed only if the FEATURE_C_INSTALL="true"

The Feature_C will not be installed if we choose that feature from custom installation dialogue. What we need to do, if we want to install it through custom dialogue selection and through silent installation as well?

Thanks for your support
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Custom Features Installation Through Command Prompt

Hello,

In order to achieve that you go in the Custom Actions page and add the predefined Set installer property custom action with sequence right above the UpdateFeaturesInstallStates action from the Wizard Dialogs Stage.
You can edit the custom actions properties like that:
  • Property: FEATURE_C_INSTALL
    Value: true
Also, you need to add the following statement in the Condition field from the custom action properties:

Code: Select all

((&Feature_C = 3) AND NOT (!Feature_C = 3))
Please take a look on the Edit Conditions article which may be useful to you.

Also, I've attached a zip archive that contains a sample which implements this scenario.

Best regards,
Dan
Attachments
Custom Features Installation Through Command Prompt.zip
(3.77 KiB) Downloaded 796 times
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Olaf S
Posts: 23
Joined: Wed Oct 16, 2013 7:11 pm

Re: Custom Features Installation Through Command Prompt

Dan wrote: Feature_C - which will be installed based on a condition ( FEATURE_C_INSTALL="true" )
So, the Feature_C will be installed only if the FEATURE_C_INSTALL="true" statement will be passed through command line.
e.g.
msiexec.exe /i <path_to_package> FEATURE_C_INSTALL="true"
Dan,
that's exactly what I want to do, too. Unfortunately the files have the same name, it's an XML file that holds database connection information, its content differs depending on the installation situation (TEST="true" vs. PRODUCTIVE="true"). So my idea was to exclude it from the main feature, add two features "TEST" and "PRODUCTIVE", setting up the condition and.... voilà: Not possible with the same file name despite the mutual exclusive install conditions.

How do I get around that?

best regards
Olaf
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Custom Features Installation Through Command Prompt

Hi Olaf,

If you want to have the same component under different features, you can share the related component. Drag and drop the component to a new feature, while the Shift key is pressed. The component will be present under both features.

Please let us know if that helped.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Olaf S
Posts: 23
Joined: Wed Oct 16, 2013 7:11 pm

Re: Custom Features Installation Through Command Prompt

Dan wrote:If you want to have the same component under different features, you can share the related component. Drag and drop the component to a new feature, while the Shift key is pressed. The component will be present under both features.
Hi Dan,
I'm not sure if that's what I want: I have 2 files with the same file name, but different content. One of them will get installed into the (same) taget directory based on a installer property.

best regards
Olaf
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Custom Features Installation Through Command Prompt

Hi Olaf,

Please take a look on our several file in same folder forum thread which debates a similar subject.

Please let us know if that helped.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Olaf S
Posts: 23
Joined: Wed Oct 16, 2013 7:11 pm

Re: Custom Features Installation Through Command Prompt

Dan wrote:Hi Olaf,

Please take a look on our several file in same folder forum thread which debates a similar subject.

Please let us know if that helped.

Best regards,
Dan
Dan,
thank you! Perfect description and easy if done once :-)
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Custom Features Installation Through Command Prompt

You're welcome Olaf,

If you have other questions, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ischafer
Posts: 8
Joined: Fri Dec 06, 2013 12:03 pm

Re: Custom Features Installation Through Command Prompt

Hi

I have a problem with a similar situation. To show, I used the project from this thread and changed it so it has the same issue as our Installer has. (see attached "test.zip")

What I want to do:
- "Enable" or "Disable" a feature according to a Combo Box on a dialog before the "ConfigureDlg"

The Combo Box is on "NewDialog" and sets the property DB_LOCATION_GUI to LOCAL or REMOTE. This property is then used as Install-time Condition for the feature "MySQL Server".

But there are two problems:
1. The Disable doesn't work. When selecting "Remote Database", the feature is shown as "Not installed", but it should not be shown at all.

2. When going back and forward in the dialogs and changing the property DB_LOCATION_GUI, the feature can't be enabled again. When it is shown as "Not installed" once, it won't change to "Installed" again. I tried to fix it by using a "UpdateFeaturesInstallStates" custom action, but that didn't help.

What I found out, is that when using a property from "Install parameters" page (DB_LOCATION) and setting it to "REMOTE", the disabling works. Why the difference?

Thanks fou your help in advance.

Best regards
Iwan
Attachments
test.zip
(3.99 KiB) Downloaded 850 times
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Custom Features Installation Through Command Prompt

Hello,

I've tested and replicated the behavior. This seems to be caused by an Advanced Installer limitation. We'll investigate further this issue and we will try to add a fix in a future version of Advanced Installer. We'll notify you as soon as we'll have a resolution.

Until then, as a workaround, you can create your own custom feature selection dialog and edit it to behave the way you want.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Custom Features Installation Through Command Prompt

Hello,

The issue regarding the Features state is not updated accordingly with their install conditions on ConfigureDlg was fixed in version 12.6 of Advanced Installer released on December 8th, 2015.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”