cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
gridman
Level 8

Component not installed in Maintenance Mode

I have a Basic MSI project where two of the components, call them Component1 and Component2 have conditions attached to them. The conditions are properties. So, if Property1 has a value, Component1 will be installed, and if Property2 has a value, Component2 will be installed.

During an initial install, Property1 and Property2 are set based on the state of two different checkboxes. If the user selects the checkbox for Property1, Component1 will be installed. Likewise for Component2.

The initial install works fine. But during the maintenance install, I call an InstallScript custom action after CostFinalize, and the custom action sets the values of Property1 and Property2 based on whether Component1 and Component2's files are installed on the hard drive.

I know the custom action is setting the properties correctly, however, the components files are or are not being installed during the maintenance install. For example, if during the initial install, if Property1 is set, then Component1's files will be installed to the hard drive. Then during maintenance install, if the user chooses Property2, then Component2's files should be installed to the hard drive. However this part is not happening.

I thought that if the properties are set according to the user's wishes, then the components will be installed or uninstalled accordingly. However, this is not happening during the maintenance install.

Does anyone have any ideas?
Labels (1)
0 Kudos
(6) Replies
Sairen
Level 7

I believe that any evaluation of condition that will control a component's installation has to be done BEFORE CostFinalize, since that's the final determination of what will get installed or not.

If you move your maintenance CA to before CostFinalize, does that work for you?
0 Kudos
gridman
Level 8

That's a good point. However, I don't think I've given enough information for you to understand what I am doing.

I display a dialog (that I created) during the Maintenance UI sequence that has two checkboxes. Each checkbox points to a property, and each property is the condition for installing a component.

So, the idea is that the user would be able to signal (via the checkboxes) how he wants to change the installation during the maintenance install. In other words, the user will indirectly install or uninstall a component based on whether it's corresponding checkbox is selected or unselected.

The process would never be able to be done before CostFinalize, because the UI elements have not occurred yet that allow the user to make his install choices.

Actually, I have everything working except for one thing. The dialog works and the checkboxes set the properties correctly. It's just that the component's state is not changing after the user signals what he wants. So evidentally, the right thing is not occuring during the execute sequence.
0 Kudos
SherylSikora
Level 6 Flexeran
Level 6 Flexeran

I am wondering if you set the components as transitive if that would work. I think that the component condition would be reevaluated then. You can set this in the component's "Reevaluate Condition" property. Does that work?
(If my reply answers a question you have raised, please click "ACCEPT AS SOLUTION".)
0 Kudos
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

In addition to the information provided by Sheryl, there needs to be a request for the component to be installed or removed. A request is typically only made at the feature level; if no requests are made to the features containing these components (Request: Null for the feature in a verbose log), the reevaluate condition setting and the values of your properties will likely not have any effect. You could try adding a Reinstall event to the dialog containing the two checkboxes, and set the argument to the feature(s) containing these components, or All for all features.
0 Kudos
gridman
Level 8

I just now got back to work on this.

I will try both of your suggestions and report back. Thanks.
0 Kudos
gridman
Level 8

I first tried Sheryl's suggestion and that did not work on its own. I then tried Josh's suggestion and that worked. Just so you know, I first tried tying the Reinstall event to the checkboxes, but that did not work. So, I had to tie the Reinstall event to the Next button of the dialog I created as the IS Help (actually the Windows Installer Help in the IS Help) states that the Reinstall event only works with push buttons and selection tree controls.

Thank you very much for the help. I think I will be able to complete the rest of this now.
0 Kudos