cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Brandon_Lowe
Level 6

FeatureListItems in Basic MSI project not working for me

I'm creating a new Basic MSI install with many features and I'm trying to use FeatureListItems in an installscript custom action.
I'm getting a return value of -132 and the list is empty. It is not getting any of the features.

Here is the code from the function

export prototype SelectDefaultFeatures(HWND);


function SelectDefaultFeatures(hMSI)

NUMBER nResult;
LIST listFeatures;

begin
listFeatures = ListCreate(STRINGLIST);
nResult = FeatureListItems(MEDIA,"",listFeatures);
SdShowInfoList("Feature List","Features",listFeatures);

At this point the list is empty and I cannot do anything I need to do. Any help would be great. I need this list of features so I can have features selected that the customer has purchased and have in their product key. Features they have not purchased with not be selected to install.

Brandon
Labels (1)
0 Kudos
6 Replies
hidenori
Level 17

As documented in the FeatureListItems function help topic, the function only applies to InstallScript and InstallScript MSI projects.
0 Kudos
Brandon_Lowe
Level 6

In a basic MSI install is there a way to get a list of all the parent features? I do not need sub features.
0 Kudos
mumbles
Level 7

WHat are you trying to do with the returned list of features? There may be a better way of using them, once we know how you want to use that list.
0 Kudos
Brandon_Lowe
Level 6

During our install the user enters in a product key. That key is encoded with the features the customer has purchased. So I need to take the information and go through the list of features and select the features they have purchased and unselect the ones they have not.

We do this currently using an installscript installation but we are now moving to an MSI based install.

I have the selecting and unselecting part working ok I just need to be able to get a list of the features. I could do it by hard coding a list but I would rather read the features in as we do change them from time to time.

Thanks.
Brandon
0 Kudos
RobertDickau
Flexera Alumni

If nothing else, see this ancient newsletter tip about reading MSI tables at run time, in your case the Feature table (PDF): http://www.flexerasoftware.com/webdocuments/PDF/msiaccess.pdf.
0 Kudos
Brandon_Lowe
Level 6

Thank you.
We were leaning that way so I guess we will keep going.
0 Kudos