0

In an InstallShield Basic MSI project I have some features and component but I wan't to add some features at run time that will be displayed in the CustomSetup dialog without any associated components. Is that possible ?
I have been trying this code in InstallScript:

hDB = MsiGetActiveDatabase(hMSI); 
MsiDatabaseOpenView(hDB, "SELECT * FROM `Feature`", hView); 
hRec = MsiCreateRecord(6);

MsiRecordSetString (hRec,1,"TEST");
MsiRecordSetString (hRec,3,"TEST");
MsiRecordSetInteger(hRec,5,2);
MsiRecordSetInteger(hRec,6,1);
MsiRecordSetString (hRec,7,INSTALLDIR);
MsiRecordSetInteger(hRec,8,0);
MsiViewModify(hView, MSIMODIFY_INSERT_TEMPORARY, hRec);
MsiCloseHandle(hRec);

MsiCloseHandle(hRec);
MsiCloseHandle(hView);  
MsiCloseHandle(hDB); 
Epligam
  • 741
  • 2
  • 14
  • 36
  • This kind of thing is usually done by putting the features in the MSI setup anyway, giving them a level (installation level) that prevents them from being shown. Features require components also. However this appears to be a XY problem so we don't know what you're trying to accomplish http://www.perlmonks.org/?node=XY+Problem – PhilDW Dec 27 '16 at 17:38
  • yes its right as PhilDW said. You create feature in your MSI setup, you add components in it, add files in it. And at runtime you can just set flag to show/install that feature or not. – Ajit Medhekar Dec 28 '16 at 13:53

0 Answers0