This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- custom action based on feature selection not executing correctly
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
Mar 08, 2010
04:48 PM
custom action based on feature selection not executing correctly
I am using Basic MSI.
In my insaller, I have a feature and 2 subfeatures under this feature. By default, all the featuers and subfeatures are set not to install. So I set the install level for the feature and all 2 subfeatures to 200 (which is greater than INSTALLLEVEL value).
I have 4 custom action related to these 2 subfeatures. Two for each subfeature. Say for first subfeature Feature1, I have two custom actions CAFeature1Add and CAFeature1Remove. and for second subfeature Feature2, I have CAFeature2Add and CAFeature2Remove.
During installation, if subfeature is selected, its related "Add" custom action needs to be run and if subfeature is not selected, its related "remove" custom action needs to be run.
So if Feature1 is selected and Feature2 is not selected, then custom actions CAFeature1Add and CAFeature2Remove needs to be executed.
I have set the condition to execute these custom actions as $feature1.dll=3 for CAFeature1Add and $feature1.dll<>3 for CAFeature1Remove. feature1.dll is present only when Feature1 is installed. Similar conditions check for $feature2.dll is done for Feature2 custom actions
The behavior that I am seeing is -
During fresh install, all the features in feature selection dialog are shown as do not install. If I choose to say install Feature1 and leave Feature2 as not install, the custom action that will be running are CAFeature1Add and CAFeature2Remove.
Now during maintenance mode during modify, if I chose to say also install Feature2 (so at this stage, both features are set to install. Feature1 already installed, Feature2 set to install), the custom action that runs are CAFeature1Remove and CAFeature2Add.
But actually it should have run CAFeature1Add and CAFeature2Add because Feature1 is still selected. I can see the dll for feature1 is still there but the custom action condition returns false condition.
BUT if I simply click on Feature1 selection tree without changing it (i.e. Feature1 is still said to be install as it has been installed during first time install, I simply clicked on that feature selection tree only), then I see that CAFeature1Add is called now... Seems once the feature is clicked, then only correct condition is triggered
I even tried with checking for feature name instead of component for execution condtion but still same result...
Can anyone please help how to solve it
In my insaller, I have a feature and 2 subfeatures under this feature. By default, all the featuers and subfeatures are set not to install. So I set the install level for the feature and all 2 subfeatures to 200 (which is greater than INSTALLLEVEL value).
I have 4 custom action related to these 2 subfeatures. Two for each subfeature. Say for first subfeature Feature1, I have two custom actions CAFeature1Add and CAFeature1Remove. and for second subfeature Feature2, I have CAFeature2Add and CAFeature2Remove.
During installation, if subfeature is selected, its related "Add" custom action needs to be run and if subfeature is not selected, its related "remove" custom action needs to be run.
So if Feature1 is selected and Feature2 is not selected, then custom actions CAFeature1Add and CAFeature2Remove needs to be executed.
I have set the condition to execute these custom actions as $feature1.dll=3 for CAFeature1Add and $feature1.dll<>3 for CAFeature1Remove. feature1.dll is present only when Feature1 is installed. Similar conditions check for $feature2.dll is done for Feature2 custom actions
The behavior that I am seeing is -
During fresh install, all the features in feature selection dialog are shown as do not install. If I choose to say install Feature1 and leave Feature2 as not install, the custom action that will be running are CAFeature1Add and CAFeature2Remove.
Now during maintenance mode during modify, if I chose to say also install Feature2 (so at this stage, both features are set to install. Feature1 already installed, Feature2 set to install), the custom action that runs are CAFeature1Remove and CAFeature2Add.
But actually it should have run CAFeature1Add and CAFeature2Add because Feature1 is still selected. I can see the dll for feature1 is still there but the custom action condition returns false condition.
BUT if I simply click on Feature1 selection tree without changing it (i.e. Feature1 is still said to be install as it has been installed during first time install, I simply clicked on that feature selection tree only), then I see that CAFeature1Add is called now... Seems once the feature is clicked, then only correct condition is triggered
I even tried with checking for feature name instead of component for execution condtion but still same result...
Can anyone please help how to solve it
(1) Reply
Mar 12, 2010
09:39 AM
I figured it out. Execution condtion were not correct for remove custom action. Also, instead of checking for component, now I am checking for feature. The condition that I have set are for Add, &Feature1=3 and for remove &Feature1=2
savy17 wrote:
I am using Basic MSI.
In my insaller, I have a feature and 2 subfeatures under this feature. By default, all the featuers and subfeatures are set not to install. So I set the install level for the feature and all 2 subfeatures to 200 (which is greater than INSTALLLEVEL value).
I have 4 custom action related to these 2 subfeatures. Two for each subfeature. Say for first subfeature Feature1, I have two custom actions CAFeature1Add and CAFeature1Remove. and for second subfeature Feature2, I have CAFeature2Add and CAFeature2Remove.
During installation, if subfeature is selected, its related "Add" custom action needs to be run and if subfeature is not selected, its related "remove" custom action needs to be run.
So if Feature1 is selected and Feature2 is not selected, then custom actions CAFeature1Add and CAFeature2Remove needs to be executed.
I have set the condition to execute these custom actions as $feature1.dll=3 for CAFeature1Add and $feature1.dll<>3 for CAFeature1Remove. feature1.dll is present only when Feature1 is installed. Similar conditions check for $feature2.dll is done for Feature2 custom actions
The behavior that I am seeing is -
During fresh install, all the features in feature selection dialog are shown as do not install. If I choose to say install Feature1 and leave Feature2 as not install, the custom action that will be running are CAFeature1Add and CAFeature2Remove.
Now during maintenance mode during modify, if I chose to say also install Feature2 (so at this stage, both features are set to install. Feature1 already installed, Feature2 set to install), the custom action that runs are CAFeature1Remove and CAFeature2Add.
But actually it should have run CAFeature1Add and CAFeature2Add because Feature1 is still selected. I can see the dll for feature1 is still there but the custom action condition returns false condition.
BUT if I simply click on Feature1 selection tree without changing it (i.e. Feature1 is still said to be install as it has been installed during first time install, I simply clicked on that feature selection tree only), then I see that CAFeature1Add is called now... Seems once the feature is clicked, then only correct condition is triggered
I even tried with checking for feature name instead of component for execution condtion but still same result...
Can anyone please help how to solve it