PDA

View Full Version : Need Help with Conditional Feature Install



DMorisseau
08-26-2005, 04:19 PM
I thought I had this in a small scale working in an earlier project, but now I'm not so sure :confused:

I have a project that will have a large number of features relating to three different products we sell. For the moment, there are 6 features (2 for each) Based on the serial number, only the features available for the corresponding product should be available for selection. I am storing the product category in a property called POMIS_PRODUCT. I have verified that the property is writing and retrieving the correct value. I want to set Feature Install Conditions that set the Install Level of the feature to 0 if the feature does not belong to the product represented by POMIS_PRODUCT.

Property Manager has INSTALLLEVEL=100

When I get to the Custom Setup screen, I get none of my features displayed!

In an earlier project, I set properties in System_Search that I later used in Feature and Custom Action conditions and that worked fine.

What could I be doing wrong???

Stefan Krueger
08-26-2005, 05:16 PM
Feature conditions are evaluated during CostFinalize, typically before your dialogs are shown. So you would need to set POMIS_PRODUCT before CostFinalize (e.g. a separate dialog that you insert before costing)

DMorisseau
08-26-2005, 06:40 PM
Stefan, I have my evaluation logic triggered from clicking Next on the Customer Information Dialog. Based on what you're saying, is that too late?

I don't have the smaller project I did in front of me, but the fact that I was basing my property against System Search results make a difference in that that particular setup worked as I wanted?

Stefan Krueger
08-27-2005, 02:34 AM
Yes, that would be too late.
System Search happens before costing, that's why it worked in the other project.

DMorisseau
08-27-2005, 05:33 PM
Is it safe to move the Customer Information Dialog before CostFinalize in the sequence?

DMorisseau
08-31-2005, 09:00 AM
I've been trying to get my Customer Information Dialogs to fire before the Costing process, but when I test run the setup, I keep getting an internal error 2235, which seems to imply I have no features/components in my setup. I have features and I have components. What am I doing wrong???

Stefan Krueger
09-06-2005, 07:25 AM
Costing must be completed before you can display dialogs such as the feature tree. So in general your dialog sequence should be shceduled after CostFinalize.
You could however insert a single dialog before costing, and the others after that. This however means users will not be able to go back from a later dialog to a dialog that's located before CostFinalize.

DMorisseau
09-09-2005, 03:20 PM
I found an old article from searching the site that was in the ISPro-Windows Installer edition Developer's Guide that describes almost exactly what I seek to do..I'm not that great w/C++, so I started wrote an InstallScript CA to do what the article described. I had to set it aside to work on another project, but so far it looks like it might work. The concept is to set conditions so that the normal sequences of CostInitialize to CostFinalize that will always return FALSE to prevent them from being executed, and then use MsiDoAction for each of the actions in the sequence that was disabled.

In my initial test, it correctly identified the features that I wanted to see displayed after I entered the serial number. Next step is to make sure that only those features get installed.

sdesikan
09-19-2005, 09:52 AM
Hi,
I need to implement this conditional feature installation exactly for several different types of products in one product family. Could you possible give me a little more detail about how you went through this?

Thanks in advance !

DMorisseau
09-19-2005, 10:16 AM
What I did was go to the Sequence View and set a condition on CostInitalize through CostFinalize and set the Condition so that it would always return a false value (knowing that my product doesn't run on Win 95, I put in a condition to detect Windows 95). I then wrote an InstallScript function that more or less matched what was described in the article I found and created a custom action fired from the Next button of my Customer Information dialog box.

Here's the link to the articleInstallShield Professional Developer's Guide - Windows Installer Edition (http://www.installshield.com/news/books/iswidg/files/working_with_features.doc)

As I said, I had to set this aside temporarily to work on other projects, so I'd be interested to see if this works for you. Please keep me advised.

Dennis